Make HTTP/2 logging use QUICHE logging
Also replace (D)CHECK with QUICHE_(D)CHECK.
PiperOrigin-RevId: 355220010
Change-Id: If829acb1f1669ef581f356c0d584b7275894bed9
diff --git a/http2/decoder/decode_buffer.cc b/http2/decoder/decode_buffer.cc
index b0519f3..2d1b6f7 100644
--- a/http2/decoder/decode_buffer.cc
+++ b/http2/decoder/decode_buffer.cc
@@ -11,7 +11,7 @@
}
uint16_t DecodeBuffer::DecodeUInt16() {
- DCHECK_LE(2u, Remaining());
+ QUICHE_DCHECK_LE(2u, Remaining());
const uint8_t b1 = DecodeUInt8();
const uint8_t b2 = DecodeUInt8();
// Note that chars are automatically promoted to ints during arithmetic,
@@ -21,7 +21,7 @@
}
uint32_t DecodeBuffer::DecodeUInt24() {
- DCHECK_LE(3u, Remaining());
+ QUICHE_DCHECK_LE(3u, Remaining());
const uint8_t b1 = DecodeUInt8();
const uint8_t b2 = DecodeUInt8();
const uint8_t b3 = DecodeUInt8();
@@ -29,7 +29,7 @@
}
uint32_t DecodeBuffer::DecodeUInt31() {
- DCHECK_LE(4u, Remaining());
+ QUICHE_DCHECK_LE(4u, Remaining());
const uint8_t b1 = DecodeUInt8() & 0x7f; // Mask out the high order bit.
const uint8_t b2 = DecodeUInt8();
const uint8_t b3 = DecodeUInt8();
@@ -38,7 +38,7 @@
}
uint32_t DecodeBuffer::DecodeUInt32() {
- DCHECK_LE(4u, Remaining());
+ QUICHE_DCHECK_LE(4u, Remaining());
const uint8_t b1 = DecodeUInt8();
const uint8_t b2 = DecodeUInt8();
const uint8_t b3 = DecodeUInt8();
@@ -49,42 +49,42 @@
#ifndef NDEBUG
void DecodeBuffer::set_subset_of_base(DecodeBuffer* base,
const DecodeBufferSubset* subset) {
- DCHECK_EQ(this, subset);
+ QUICHE_DCHECK_EQ(this, subset);
base->set_subset(subset);
}
void DecodeBuffer::clear_subset_of_base(DecodeBuffer* base,
const DecodeBufferSubset* subset) {
- DCHECK_EQ(this, subset);
+ QUICHE_DCHECK_EQ(this, subset);
base->clear_subset(subset);
}
void DecodeBuffer::set_subset(const DecodeBufferSubset* subset) {
- DCHECK(subset != nullptr);
- DCHECK_EQ(subset_, nullptr) << "There is already a subset";
+ QUICHE_DCHECK(subset != nullptr);
+ QUICHE_DCHECK_EQ(subset_, nullptr) << "There is already a subset";
subset_ = subset;
}
void DecodeBuffer::clear_subset(const DecodeBufferSubset* subset) {
- DCHECK(subset != nullptr);
- DCHECK_EQ(subset_, subset);
+ QUICHE_DCHECK(subset != nullptr);
+ QUICHE_DCHECK_EQ(subset_, subset);
subset_ = nullptr;
}
void DecodeBufferSubset::DebugSetup() {
start_base_offset_ = base_buffer_->Offset();
max_base_offset_ = start_base_offset_ + FullSize();
- DCHECK_LE(max_base_offset_, base_buffer_->FullSize());
+ QUICHE_DCHECK_LE(max_base_offset_, base_buffer_->FullSize());
// Ensure that there is only one DecodeBufferSubset at a time for a base.
set_subset_of_base(base_buffer_, this);
}
void DecodeBufferSubset::DebugTearDown() {
// Ensure that the base hasn't been modified.
- DCHECK_EQ(start_base_offset_, base_buffer_->Offset())
+ QUICHE_DCHECK_EQ(start_base_offset_, base_buffer_->Offset())
<< "The base buffer was modified";
// Ensure that we haven't gone beyond the maximum allowed offset.
size_t offset = Offset();
- DCHECK_LE(offset, FullSize());
- DCHECK_LE(start_base_offset_ + offset, max_base_offset_);
- DCHECK_LE(max_base_offset_, base_buffer_->FullSize());
+ QUICHE_DCHECK_LE(offset, FullSize());
+ QUICHE_DCHECK_LE(start_base_offset_ + offset, max_base_offset_);
+ QUICHE_DCHECK_LE(max_base_offset_, base_buffer_->FullSize());
clear_subset_of_base(base_buffer_, this);
}
diff --git a/http2/decoder/decode_buffer.h b/http2/decoder/decode_buffer.h
index 2b701c9..4757c06 100644
--- a/http2/decoder/decode_buffer.h
+++ b/http2/decoder/decode_buffer.h
@@ -28,12 +28,12 @@
public:
DecodeBuffer(const char* buffer, size_t len)
: buffer_(buffer), cursor_(buffer), beyond_(buffer + len) {
- DCHECK(buffer != nullptr);
+ QUICHE_DCHECK(buffer != nullptr);
// We assume the decode buffers will typically be modest in size (i.e. often
// a few KB, perhaps as high as 100KB). Let's make sure during testing that
// we don't go very high, with 32MB selected rather arbitrarily.
const size_t kMaxDecodeBufferLength = 1 << 25;
- DCHECK_LE(len, kMaxDecodeBufferLength);
+ QUICHE_DCHECK_LE(len, kMaxDecodeBufferLength);
}
explicit DecodeBuffer(absl::string_view s)
: DecodeBuffer(s.data(), s.size()) {}
@@ -49,7 +49,7 @@
bool Empty() const { return cursor_ >= beyond_; }
bool HasData() const { return cursor_ < beyond_; }
size_t Remaining() const {
- DCHECK_LE(cursor_, beyond_);
+ QUICHE_DCHECK_LE(cursor_, beyond_);
return beyond_ - cursor_;
}
size_t Offset() const { return cursor_ - buffer_; }
@@ -66,15 +66,18 @@
const char* cursor() const { return cursor_; }
// Advances the cursor (pointer to the next byte/char to be decoded).
void AdvanceCursor(size_t amount) {
- DCHECK_LE(amount, Remaining()); // Need at least that much remaining.
- DCHECK_EQ(subset_, nullptr) << "Access via subset only when present.";
+ QUICHE_DCHECK_LE(amount,
+ Remaining()); // Need at least that much remaining.
+ QUICHE_DCHECK_EQ(subset_, nullptr)
+ << "Access via subset only when present.";
cursor_ += amount;
}
// Only call methods starting "Decode" when there is enough input remaining.
char DecodeChar() {
- DCHECK_LE(1u, Remaining()); // Need at least one byte remaining.
- DCHECK_EQ(subset_, nullptr) << "Access via subset only when present.";
+ QUICHE_DCHECK_LE(1u, Remaining()); // Need at least one byte remaining.
+ QUICHE_DCHECK_EQ(subset_, nullptr)
+ << "Access via subset only when present.";
return *cursor_++;
}
@@ -114,7 +117,7 @@
const char* const buffer_;
const char* cursor_;
const char* const beyond_;
- const DecodeBufferSubset* subset_ = nullptr; // Used for DCHECKs.
+ const DecodeBufferSubset* subset_ = nullptr; // Used for QUICHE_DCHECKs.
};
// DecodeBufferSubset is used when decoding a known sized chunk of data, which
@@ -153,8 +156,8 @@
private:
DecodeBuffer* const base_buffer_;
#ifndef NDEBUG
- size_t start_base_offset_; // Used for DCHECKs.
- size_t max_base_offset_; // Used for DCHECKs.
+ size_t start_base_offset_; // Used for QUICHE_DCHECKs.
+ size_t max_base_offset_; // Used for QUICHE_DCHECKs.
void DebugSetup();
void DebugTearDown();
diff --git a/http2/decoder/decode_http2_structures.cc b/http2/decoder/decode_http2_structures.cc
index 2f0b06e..a5582c2 100644
--- a/http2/decoder/decode_http2_structures.cc
+++ b/http2/decoder/decode_http2_structures.cc
@@ -16,9 +16,9 @@
// Http2FrameHeader decoding:
void DoDecode(Http2FrameHeader* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2FrameHeader::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2FrameHeader::EncodedSize(), b->Remaining());
out->payload_length = b->DecodeUInt24();
out->type = static_cast<Http2FrameType>(b->DecodeUInt8());
out->flags = static_cast<Http2FrameFlag>(b->DecodeUInt8());
@@ -28,9 +28,9 @@
// Http2PriorityFields decoding:
void DoDecode(Http2PriorityFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2PriorityFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2PriorityFields::EncodedSize(), b->Remaining());
uint32_t stream_id_and_flag = b->DecodeUInt32();
out->stream_dependency = stream_id_and_flag & StreamIdMask();
if (out->stream_dependency == stream_id_and_flag) {
@@ -46,18 +46,18 @@
// Http2RstStreamFields decoding:
void DoDecode(Http2RstStreamFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2RstStreamFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2RstStreamFields::EncodedSize(), b->Remaining());
out->error_code = static_cast<Http2ErrorCode>(b->DecodeUInt32());
}
// Http2SettingFields decoding:
void DoDecode(Http2SettingFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2SettingFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2SettingFields::EncodedSize(), b->Remaining());
out->parameter = static_cast<Http2SettingsParameter>(b->DecodeUInt16());
out->value = b->DecodeUInt32();
}
@@ -65,18 +65,18 @@
// Http2PushPromiseFields decoding:
void DoDecode(Http2PushPromiseFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2PushPromiseFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2PushPromiseFields::EncodedSize(), b->Remaining());
out->promised_stream_id = b->DecodeUInt31();
}
// Http2PingFields decoding:
void DoDecode(Http2PingFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2PingFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2PingFields::EncodedSize(), b->Remaining());
memcpy(out->opaque_bytes, b->cursor(), Http2PingFields::EncodedSize());
b->AdvanceCursor(Http2PingFields::EncodedSize());
}
@@ -84,9 +84,9 @@
// Http2GoAwayFields decoding:
void DoDecode(Http2GoAwayFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2GoAwayFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2GoAwayFields::EncodedSize(), b->Remaining());
out->last_stream_id = b->DecodeUInt31();
out->error_code = static_cast<Http2ErrorCode>(b->DecodeUInt32());
}
@@ -94,27 +94,27 @@
// Http2WindowUpdateFields decoding:
void DoDecode(Http2WindowUpdateFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2WindowUpdateFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2WindowUpdateFields::EncodedSize(), b->Remaining());
out->window_size_increment = b->DecodeUInt31();
}
// Http2PriorityUpdateFields decoding:
void DoDecode(Http2PriorityUpdateFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2PriorityUpdateFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2PriorityUpdateFields::EncodedSize(), b->Remaining());
out->prioritized_stream_id = b->DecodeUInt31();
}
// Http2AltSvcFields decoding:
void DoDecode(Http2AltSvcFields* out, DecodeBuffer* b) {
- DCHECK_NE(nullptr, out);
- DCHECK_NE(nullptr, b);
- DCHECK_LE(Http2AltSvcFields::EncodedSize(), b->Remaining());
+ QUICHE_DCHECK_NE(nullptr, out);
+ QUICHE_DCHECK_NE(nullptr, b);
+ QUICHE_DCHECK_LE(Http2AltSvcFields::EncodedSize(), b->Remaining());
out->origin_length = b->DecodeUInt16();
}
diff --git a/http2/decoder/frame_decoder_state.cc b/http2/decoder/frame_decoder_state.cc
index 5acee1b..ee53964 100644
--- a/http2/decoder/frame_decoder_state.cc
+++ b/http2/decoder/frame_decoder_state.cc
@@ -10,14 +10,14 @@
bool report_pad_length) {
HTTP2_DVLOG(2) << "ReadPadLength db->Remaining=" << db->Remaining()
<< "; payload_length=" << frame_header().payload_length;
- DCHECK(IsPaddable());
- DCHECK(frame_header().IsPadded());
+ QUICHE_DCHECK(IsPaddable());
+ QUICHE_DCHECK(frame_header().IsPadded());
// Pad Length is always at the start of the frame, so remaining_payload_
// should equal payload_length at this point.
const uint32_t total_payload = frame_header().payload_length;
- DCHECK_EQ(total_payload, remaining_payload_);
- DCHECK_EQ(0u, remaining_padding_);
+ QUICHE_DCHECK_EQ(total_payload, remaining_payload_);
+ QUICHE_DCHECK_EQ(0u, remaining_padding_);
if (db->HasData()) {
const uint32_t pad_length = db->DecodeUInt8();
@@ -54,9 +54,9 @@
HTTP2_DVLOG(2) << "SkipPadding remaining_padding_=" << remaining_padding_
<< ", db->Remaining=" << db->Remaining()
<< ", header: " << frame_header();
- DCHECK_EQ(remaining_payload_, 0u);
- DCHECK(IsPaddable()) << "header: " << frame_header();
- DCHECK(remaining_padding_ == 0 || frame_header().IsPadded())
+ QUICHE_DCHECK_EQ(remaining_payload_, 0u);
+ QUICHE_DCHECK(IsPaddable()) << "header: " << frame_header();
+ QUICHE_DCHECK(remaining_padding_ == 0 || frame_header().IsPadded())
<< "remaining_padding_=" << remaining_padding_
<< ", header: " << frame_header();
const size_t avail = AvailablePadding(db);
diff --git a/http2/decoder/frame_decoder_state.h b/http2/decoder/frame_decoder_state.h
index cdce155..f0c1357 100644
--- a/http2/decoder/frame_decoder_state.h
+++ b/http2/decoder/frame_decoder_state.h
@@ -107,7 +107,7 @@
// after the variables have been initialized, which in practice means once a
// payload decoder has called InitializeRemainders and/or ReadPadLength.
size_t remaining_total_payload() const {
- DCHECK(IsPaddable() || remaining_padding_ == 0) << frame_header();
+ QUICHE_DCHECK(IsPaddable() || remaining_padding_ == 0) << frame_header();
return remaining_payload_ + remaining_padding_;
}
@@ -125,7 +125,7 @@
// which in practice means once a payload decoder has called
// InitializeRemainders and/or ReadPadLength.
size_t remaining_payload_and_padding() const {
- DCHECK(IsPaddable()) << frame_header();
+ QUICHE_DCHECK(IsPaddable()) << frame_header();
return remaining_payload_ + remaining_padding_;
}
@@ -135,7 +135,7 @@
// practice means once a payload decoder has called InitializeRemainders,
// and isn't set to a non-zero value until ReadPadLength has been called.
uint32_t remaining_padding() const {
- DCHECK(IsPaddable()) << frame_header();
+ QUICHE_DCHECK(IsPaddable()) << frame_header();
return remaining_padding_;
}
@@ -147,7 +147,7 @@
// How many bytes of the remaining payload and padding are in db?
// Call only for frames whose type is paddable.
size_t AvailablePayloadAndPadding(DecodeBuffer* db) const {
- DCHECK(IsPaddable()) << frame_header();
+ QUICHE_DCHECK(IsPaddable()) << frame_header();
return db->MinLengthRemaining(remaining_payload_ + remaining_padding_);
}
@@ -156,8 +156,8 @@
// been cleared (for unpadded frames); and after all of the non-padding
// payload has been decoded.
size_t AvailablePadding(DecodeBuffer* db) const {
- DCHECK(IsPaddable()) << frame_header();
- DCHECK_EQ(remaining_payload_, 0u);
+ QUICHE_DCHECK(IsPaddable()) << frame_header();
+ QUICHE_DCHECK_EQ(remaining_payload_, 0u);
return db->MinLengthRemaining(remaining_padding_);
}
@@ -166,7 +166,7 @@
// listener; remaining_payload_ will be automatically reduced when fixed
// size structures and padding, including the Pad Length field, are decoded.
void ConsumePayload(size_t amount) {
- DCHECK_LE(amount, remaining_payload_);
+ QUICHE_DCHECK_LE(amount, remaining_payload_);
remaining_payload_ -= amount;
}
diff --git a/http2/decoder/http2_frame_decoder.cc b/http2/decoder/http2_frame_decoder.cc
index e395a27..449d649 100644
--- a/http2/decoder/http2_frame_decoder.cc
+++ b/http2/decoder/http2_frame_decoder.cc
@@ -188,7 +188,7 @@
// buffer we pass to the start method that is specific to the frame type
// does not exend beyond this frame.
size_t remaining = frame_decoder_state_.remaining_total_payload();
- DCHECK_LE(remaining, frame_header().payload_length);
+ QUICHE_DCHECK_LE(remaining, frame_header().payload_length);
DecodeBufferSubset subset(db, remaining);
DecodeStatus status;
switch (frame_header().type) {
@@ -279,8 +279,8 @@
}
DecodeStatus Http2FrameDecoder::ResumeDecodingAltSvcPayload(DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return altsvc_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -294,8 +294,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingContinuationPayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return continuation_payload_decoder_.ResumeDecodingPayload(
&frame_decoder_state_, db);
}
@@ -315,8 +315,8 @@
}
DecodeStatus Http2FrameDecoder::ResumeDecodingGoAwayPayload(DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return goaway_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -328,8 +328,8 @@
db);
}
DecodeStatus Http2FrameDecoder::ResumeDecodingHeadersPayload(DecodeBuffer* db) {
- DCHECK_LE(frame_decoder_state_.remaining_payload_and_padding(),
- frame_header().payload_length);
+ QUICHE_DCHECK_LE(frame_decoder_state_.remaining_payload_and_padding(),
+ frame_header().payload_length);
return headers_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -340,8 +340,8 @@
}
DecodeStatus Http2FrameDecoder::ResumeDecodingPingPayload(DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return ping_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_, db);
}
@@ -353,8 +353,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingPriorityPayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return priority_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -368,8 +368,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingPriorityUpdatePayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return priority_payload_update_decoder_.ResumeDecodingPayload(
&frame_decoder_state_, db);
}
@@ -382,8 +382,8 @@
}
DecodeStatus Http2FrameDecoder::ResumeDecodingPushPromisePayload(
DecodeBuffer* db) {
- DCHECK_LE(frame_decoder_state_.remaining_payload_and_padding(),
- frame_header().payload_length);
+ QUICHE_DCHECK_LE(frame_decoder_state_.remaining_payload_and_padding(),
+ frame_header().payload_length);
return push_promise_payload_decoder_.ResumeDecodingPayload(
&frame_decoder_state_, db);
}
@@ -397,8 +397,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingRstStreamPayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return rst_stream_payload_decoder_.ResumeDecodingPayload(
&frame_decoder_state_, db);
}
@@ -411,8 +411,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingSettingsPayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return settings_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -425,8 +425,8 @@
}
DecodeStatus Http2FrameDecoder::ResumeDecodingUnknownPayload(DecodeBuffer* db) {
// We don't known what type of frame this is, so we treat it as not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return unknown_payload_decoder_.ResumeDecodingPayload(&frame_decoder_state_,
db);
}
@@ -440,8 +440,8 @@
DecodeStatus Http2FrameDecoder::ResumeDecodingWindowUpdatePayload(
DecodeBuffer* db) {
// The frame is not paddable.
- DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
- frame_decoder_state_.remaining_payload());
+ QUICHE_DCHECK_EQ(frame_decoder_state_.remaining_total_payload(),
+ frame_decoder_state_.remaining_payload());
return window_update_payload_decoder_.ResumeDecodingPayload(
&frame_decoder_state_, db);
}
diff --git a/http2/decoder/http2_structure_decoder.h b/http2/decoder/http2_structure_decoder.h
index f27ea59..367e225 100644
--- a/http2/decoder/http2_structure_decoder.h
+++ b/http2/decoder/http2_structure_decoder.h
@@ -67,7 +67,7 @@
DoDecode(out, &buffer_db);
return true;
}
- DCHECK_LT(offset_, S::EncodedSize());
+ QUICHE_DCHECK_LT(offset_, S::EncodedSize());
return false;
}
@@ -104,7 +104,7 @@
DoDecode(out, &buffer_db);
return true;
}
- DCHECK_LT(offset_, S::EncodedSize());
+ QUICHE_DCHECK_LT(offset_, S::EncodedSize());
return false;
}
diff --git a/http2/decoder/payload_decoders/altsvc_payload_decoder.cc b/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
index 39ae7e9..2b34104 100644
--- a/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
@@ -40,9 +40,9 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "AltSvcPayloadDecoder::StartDecodingPayload: "
<< state->frame_header();
- DCHECK_EQ(Http2FrameType::ALTSVC, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
- DCHECK_EQ(0, state->frame_header().flags);
+ QUICHE_DCHECK_EQ(Http2FrameType::ALTSVC, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(0, state->frame_header().flags);
state->InitializeRemainders();
payload_state_ = PayloadState::kStartDecodingStruct;
@@ -56,13 +56,13 @@
const Http2FrameHeader& frame_header = state->frame_header();
HTTP2_DVLOG(2) << "AltSvcPayloadDecoder::ResumeDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::ALTSVC, frame_header.type);
- DCHECK_LE(state->remaining_payload(), frame_header.payload_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload());
- DCHECK_NE(PayloadState::kMaybeDecodedStruct, payload_state_);
+ QUICHE_DCHECK_EQ(Http2FrameType::ALTSVC, frame_header.type);
+ QUICHE_DCHECK_LE(state->remaining_payload(), frame_header.payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload());
+ QUICHE_DCHECK_NE(PayloadState::kMaybeDecodedStruct, payload_state_);
// |status| has to be initialized to some value to avoid compiler error in
// case PayloadState::kMaybeDecodedStruct below, but value does not matter,
- // see DCHECK_NE above.
+ // see QUICHE_DCHECK_NE above.
DecodeStatus status = DecodeStatus::kDecodeError;
while (true) {
HTTP2_DVLOG(2)
@@ -81,8 +81,8 @@
state->listener()->OnAltSvcStart(frame_header, origin_length,
value_length);
} else if (status != DecodeStatus::kDecodeDone) {
- DCHECK(state->remaining_payload() > 0 ||
- status == DecodeStatus::kDecodeError)
+ QUICHE_DCHECK(state->remaining_payload() > 0 ||
+ status == DecodeStatus::kDecodeError)
<< "\nremaining_payload: " << state->remaining_payload()
<< "\nstatus: " << status << "\nheader: " << frame_header;
// Assume in progress.
@@ -90,7 +90,8 @@
return status;
} else {
// The origin's length is longer than the remaining payload.
- DCHECK_GT(altsvc_fields_.origin_length, state->remaining_payload());
+ QUICHE_DCHECK_GT(altsvc_fields_.origin_length,
+ state->remaining_payload());
return state->ReportFrameSizeError();
}
HTTP2_FALLTHROUGH;
@@ -130,8 +131,8 @@
}
}
// All that is left is the value string.
- DCHECK_LE(state->remaining_payload(), value_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload());
+ QUICHE_DCHECK_LE(state->remaining_payload(), value_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload());
if (db->HasData()) {
size_t avail = db->Remaining();
state->listener()->OnAltSvcValueData(db->cursor(), avail);
diff --git a/http2/decoder/payload_decoders/continuation_payload_decoder.cc b/http2/decoder/payload_decoders/continuation_payload_decoder.cc
index 1f7d263..10e9d95 100644
--- a/http2/decoder/payload_decoders/continuation_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/continuation_payload_decoder.cc
@@ -22,9 +22,9 @@
HTTP2_DVLOG(2) << "ContinuationPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::CONTINUATION, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::END_HEADERS));
+ QUICHE_DCHECK_EQ(Http2FrameType::CONTINUATION, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::END_HEADERS));
state->InitializeRemainders();
state->listener()->OnContinuationStart(frame_header);
@@ -37,12 +37,13 @@
HTTP2_DVLOG(2) << "ContinuationPayloadDecoder::ResumeDecodingPayload"
<< " remaining_payload=" << state->remaining_payload()
<< " db->Remaining=" << db->Remaining();
- DCHECK_EQ(Http2FrameType::CONTINUATION, state->frame_header().type);
- DCHECK_LE(state->remaining_payload(), state->frame_header().payload_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload());
+ QUICHE_DCHECK_EQ(Http2FrameType::CONTINUATION, state->frame_header().type);
+ QUICHE_DCHECK_LE(state->remaining_payload(),
+ state->frame_header().payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload());
size_t avail = db->Remaining();
- DCHECK_LE(avail, state->remaining_payload());
+ QUICHE_DCHECK_LE(avail, state->remaining_payload());
if (avail > 0) {
state->listener()->OnHpackFragment(db->cursor(), avail);
db->AdvanceCursor(avail);
diff --git a/http2/decoder/payload_decoders/data_payload_decoder.cc b/http2/decoder/payload_decoders/data_payload_decoder.cc
index ee750b9..03e442d 100644
--- a/http2/decoder/payload_decoders/data_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/data_payload_decoder.cc
@@ -40,10 +40,10 @@
HTTP2_DVLOG(2) << "DataPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::DATA, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags &
- ~(Http2FrameFlag::END_STREAM | Http2FrameFlag::PADDED));
+ QUICHE_DCHECK_EQ(Http2FrameType::DATA, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::END_STREAM |
+ Http2FrameFlag::PADDED));
// Special case for the hoped for common case: unpadded and fits fully into
// the decode buffer. TO BE SEEN if that is true. It certainly requires that
@@ -80,10 +80,10 @@
HTTP2_DVLOG(2) << "DataPayloadDecoder::ResumeDecodingPayload payload_state_="
<< payload_state_;
const Http2FrameHeader& frame_header = state->frame_header();
- DCHECK_EQ(Http2FrameType::DATA, frame_header.type);
- DCHECK_LE(state->remaining_payload_and_padding(),
- frame_header.payload_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload_and_padding());
+ QUICHE_DCHECK_EQ(Http2FrameType::DATA, frame_header.type);
+ QUICHE_DCHECK_LE(state->remaining_payload_and_padding(),
+ frame_header.payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload_and_padding());
DecodeStatus status;
size_t avail;
switch (payload_state_) {
diff --git a/http2/decoder/payload_decoders/goaway_payload_decoder.cc b/http2/decoder/payload_decoders/goaway_payload_decoder.cc
index 51ed305..17b7e7d 100644
--- a/http2/decoder/payload_decoders/goaway_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/goaway_payload_decoder.cc
@@ -40,9 +40,9 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "GoAwayPayloadDecoder::StartDecodingPayload: "
<< state->frame_header();
- DCHECK_EQ(Http2FrameType::GOAWAY, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
- DCHECK_EQ(0, state->frame_header().flags);
+ QUICHE_DCHECK_EQ(Http2FrameType::GOAWAY, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(0, state->frame_header().flags);
state->InitializeRemainders();
payload_state_ = PayloadState::kStartDecodingFixedFields;
@@ -57,13 +57,13 @@
<< state->remaining_payload() << ", db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
- DCHECK_EQ(Http2FrameType::GOAWAY, frame_header.type);
- DCHECK_LE(db->Remaining(), frame_header.payload_length);
- DCHECK_NE(PayloadState::kHandleFixedFieldsStatus, payload_state_);
+ QUICHE_DCHECK_EQ(Http2FrameType::GOAWAY, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), frame_header.payload_length);
+ QUICHE_DCHECK_NE(PayloadState::kHandleFixedFieldsStatus, payload_state_);
// |status| has to be initialized to some value to avoid compiler error in
// case PayloadState::kHandleFixedFieldsStatus below, but value does not
- // matter, see DCHECK_NE above.
+ // matter, see QUICHE_DCHECK_NE above.
DecodeStatus status = DecodeStatus::kDecodeError;
size_t avail;
while (true) {
@@ -82,10 +82,10 @@
// Not done decoding the structure. Either we've got more payload
// to decode, or we've run out because the payload is too short,
// in which case OnFrameSizeError will have already been called.
- DCHECK((status == DecodeStatus::kDecodeInProgress &&
- state->remaining_payload() > 0) ||
- (status == DecodeStatus::kDecodeError &&
- state->remaining_payload() == 0))
+ QUICHE_DCHECK((status == DecodeStatus::kDecodeInProgress &&
+ state->remaining_payload() > 0) ||
+ (status == DecodeStatus::kDecodeError &&
+ state->remaining_payload() == 0))
<< "\n status=" << status
<< "; remaining_payload=" << state->remaining_payload();
payload_state_ = PayloadState::kResumeDecodingFixedFields;
diff --git a/http2/decoder/payload_decoders/headers_payload_decoder.cc b/http2/decoder/payload_decoders/headers_payload_decoder.cc
index 28e20e7..9b219d7 100644
--- a/http2/decoder/payload_decoders/headers_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/headers_payload_decoder.cc
@@ -46,11 +46,12 @@
HTTP2_DVLOG(2) << "HeadersPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::HEADERS, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags &
- ~(Http2FrameFlag::END_STREAM | Http2FrameFlag::END_HEADERS |
- Http2FrameFlag::PADDED | Http2FrameFlag::PRIORITY));
+ QUICHE_DCHECK_EQ(Http2FrameType::HEADERS, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(
+ 0, frame_header.flags &
+ ~(Http2FrameFlag::END_STREAM | Http2FrameFlag::END_HEADERS |
+ Http2FrameFlag::PADDED | Http2FrameFlag::PRIORITY));
// Special case for HEADERS frames that contain only the HPACK block
// (fragment or whole) and that fit fully into the decode buffer.
@@ -86,7 +87,7 @@
} else if (frame_header.IsPadded()) {
payload_state_ = PayloadState::kReadPadLength;
} else {
- DCHECK(frame_header.HasPriority()) << frame_header;
+ QUICHE_DCHECK(frame_header.HasPriority()) << frame_header;
payload_state_ = PayloadState::kStartDecodingPriorityFields;
}
state->InitializeRemainders();
@@ -103,10 +104,10 @@
const Http2FrameHeader& frame_header = state->frame_header();
- DCHECK_EQ(Http2FrameType::HEADERS, frame_header.type);
- DCHECK_LE(state->remaining_payload_and_padding(),
- frame_header.payload_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload_and_padding());
+ QUICHE_DCHECK_EQ(Http2FrameType::HEADERS, frame_header.type);
+ QUICHE_DCHECK_LE(state->remaining_payload_and_padding(),
+ frame_header.payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload_and_padding());
DecodeStatus status;
size_t avail;
while (true) {
diff --git a/http2/decoder/payload_decoders/ping_payload_decoder.cc b/http2/decoder/payload_decoders/ping_payload_decoder.cc
index 9c637f9..6c73cf7 100644
--- a/http2/decoder/payload_decoders/ping_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/ping_payload_decoder.cc
@@ -20,9 +20,9 @@
HTTP2_DVLOG(2) << "PingPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::PING, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::ACK));
+ QUICHE_DCHECK_EQ(Http2FrameType::PING, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::ACK));
// Is the payload entirely in the decode buffer and is it the correct size?
// Given the size of the header and payload (17 bytes total), this is most
@@ -53,8 +53,8 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "ResumeDecodingPayload: remaining_payload="
<< state->remaining_payload();
- DCHECK_EQ(Http2FrameType::PING, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::PING, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
return HandleStatus(
state, state->ResumeDecodingStructureInPayload(&ping_fields_, db));
}
@@ -78,7 +78,7 @@
}
// Not done decoding the structure. Either we've got more payload to decode,
// or we've run out because the payload is too short.
- DCHECK(
+ QUICHE_DCHECK(
(status == DecodeStatus::kDecodeInProgress &&
state->remaining_payload() > 0) ||
(status == DecodeStatus::kDecodeError && state->remaining_payload() == 0))
diff --git a/http2/decoder/payload_decoders/priority_payload_decoder.cc b/http2/decoder/payload_decoders/priority_payload_decoder.cc
index 471bd84..e68cbce 100644
--- a/http2/decoder/payload_decoders/priority_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/priority_payload_decoder.cc
@@ -17,10 +17,10 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "PriorityPayloadDecoder::StartDecodingPayload: "
<< state->frame_header();
- DCHECK_EQ(Http2FrameType::PRIORITY, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
// PRIORITY frames have no flags.
- DCHECK_EQ(0, state->frame_header().flags);
+ QUICHE_DCHECK_EQ(0, state->frame_header().flags);
state->InitializeRemainders();
return HandleStatus(
state, state->StartDecodingStructureInPayload(&priority_fields_, db));
@@ -32,8 +32,8 @@
HTTP2_DVLOG(2) << "PriorityPayloadDecoder::ResumeDecodingPayload"
<< " remaining_payload=" << state->remaining_payload()
<< " db->Remaining=" << db->Remaining();
- DCHECK_EQ(Http2FrameType::PRIORITY, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
return HandleStatus(
state, state->ResumeDecodingStructureInPayload(&priority_fields_, db));
}
@@ -52,7 +52,7 @@
// Not done decoding the structure. Either we've got more payload to decode,
// or we've run out because the payload is too short, in which case
// OnFrameSizeError will have already been called.
- DCHECK(
+ QUICHE_DCHECK(
(status == DecodeStatus::kDecodeInProgress &&
state->remaining_payload() > 0) ||
(status == DecodeStatus::kDecodeError && state->remaining_payload() == 0))
diff --git a/http2/decoder/payload_decoders/priority_update_payload_decoder.cc b/http2/decoder/payload_decoders/priority_update_payload_decoder.cc
index ec52c20..d115c35 100644
--- a/http2/decoder/payload_decoders/priority_update_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/priority_update_payload_decoder.cc
@@ -41,9 +41,9 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "PriorityUpdatePayloadDecoder::StartDecodingPayload: "
<< state->frame_header();
- DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
- DCHECK_EQ(0, state->frame_header().flags);
+ QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(0, state->frame_header().flags);
state->InitializeRemainders();
payload_state_ = PayloadState::kStartDecodingFixedFields;
@@ -59,13 +59,13 @@
<< ", db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
- DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, frame_header.type);
- DCHECK_LE(db->Remaining(), frame_header.payload_length);
- DCHECK_NE(PayloadState::kHandleFixedFieldsStatus, payload_state_);
+ QUICHE_DCHECK_EQ(Http2FrameType::PRIORITY_UPDATE, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), frame_header.payload_length);
+ QUICHE_DCHECK_NE(PayloadState::kHandleFixedFieldsStatus, payload_state_);
// |status| has to be initialized to some value to avoid compiler error in
// case PayloadState::kHandleFixedFieldsStatus below, but value does not
- // matter, see DCHECK_NE above.
+ // matter, see QUICHE_DCHECK_NE above.
DecodeStatus status = DecodeStatus::kDecodeError;
size_t avail;
while (true) {
@@ -86,10 +86,10 @@
// Not done decoding the structure. Either we've got more payload
// to decode, or we've run out because the payload is too short,
// in which case OnFrameSizeError will have already been called.
- DCHECK((status == DecodeStatus::kDecodeInProgress &&
- state->remaining_payload() > 0) ||
- (status == DecodeStatus::kDecodeError &&
- state->remaining_payload() == 0))
+ QUICHE_DCHECK((status == DecodeStatus::kDecodeInProgress &&
+ state->remaining_payload() > 0) ||
+ (status == DecodeStatus::kDecodeError &&
+ state->remaining_payload() == 0))
<< "\n status=" << status
<< "; remaining_payload=" << state->remaining_payload();
payload_state_ = PayloadState::kResumeDecodingFixedFields;
diff --git a/http2/decoder/payload_decoders/push_promise_payload_decoder.cc b/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
index ba3112c..efb1520 100644
--- a/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
@@ -44,10 +44,10 @@
HTTP2_DVLOG(2) << "PushPromisePayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags &
- ~(Http2FrameFlag::END_HEADERS | Http2FrameFlag::PADDED));
+ QUICHE_DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::END_HEADERS |
+ Http2FrameFlag::PADDED));
if (!frame_header.IsPadded()) {
// If it turns out that PUSH_PROMISE frames without padding are sufficiently
@@ -70,9 +70,9 @@
<< " db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
- DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
- DCHECK_LE(state->remaining_payload(), frame_header.payload_length);
- DCHECK_LE(db->Remaining(), frame_header.payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
+ QUICHE_DCHECK_LE(state->remaining_payload(), frame_header.payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), frame_header.payload_length);
DecodeStatus status;
while (true) {
@@ -81,7 +81,8 @@
<< payload_state_;
switch (payload_state_) {
case PayloadState::kReadPadLength:
- DCHECK_EQ(state->remaining_payload(), frame_header.payload_length);
+ QUICHE_DCHECK_EQ(state->remaining_payload(),
+ frame_header.payload_length);
// ReadPadLength handles the OnPadLength callback, and updating the
// remaining_payload and remaining_padding fields. If the amount of
// padding is too large to fit in the frame's payload, ReadPadLength
@@ -109,11 +110,12 @@
HTTP2_FALLTHROUGH;
case PayloadState::kReadPayload:
- DCHECK_LT(state->remaining_payload(), frame_header.payload_length);
- DCHECK_LE(state->remaining_payload(),
- frame_header.payload_length -
- Http2PushPromiseFields::EncodedSize());
- DCHECK_LE(
+ QUICHE_DCHECK_LT(state->remaining_payload(),
+ frame_header.payload_length);
+ QUICHE_DCHECK_LE(state->remaining_payload(),
+ frame_header.payload_length -
+ Http2PushPromiseFields::EncodedSize());
+ QUICHE_DCHECK_LE(
state->remaining_payload(),
frame_header.payload_length -
Http2PushPromiseFields::EncodedSize() -
diff --git a/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc b/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
index d9d0fd2..b2afc40 100644
--- a/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
@@ -17,10 +17,10 @@
DecodeBuffer* db) {
HTTP2_DVLOG(2) << "RstStreamPayloadDecoder::StartDecodingPayload: "
<< state->frame_header();
- DCHECK_EQ(Http2FrameType::RST_STREAM, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::RST_STREAM, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
// RST_STREAM has no flags.
- DCHECK_EQ(0, state->frame_header().flags);
+ QUICHE_DCHECK_EQ(0, state->frame_header().flags);
state->InitializeRemainders();
return HandleStatus(
state, state->StartDecodingStructureInPayload(&rst_stream_fields_, db));
@@ -32,8 +32,8 @@
HTTP2_DVLOG(2) << "RstStreamPayloadDecoder::ResumeDecodingPayload"
<< " remaining_payload=" << state->remaining_payload()
<< " db->Remaining=" << db->Remaining();
- DCHECK_EQ(Http2FrameType::RST_STREAM, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::RST_STREAM, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
return HandleStatus(
state, state->ResumeDecodingStructureInPayload(&rst_stream_fields_, db));
}
@@ -54,7 +54,7 @@
// Not done decoding the structure. Either we've got more payload to decode,
// or we've run out because the payload is too short, in which case
// OnFrameSizeError will have already been called by the FrameDecoderState.
- DCHECK(
+ QUICHE_DCHECK(
(status == DecodeStatus::kDecodeInProgress &&
state->remaining_payload() > 0) ||
(status == DecodeStatus::kDecodeError && state->remaining_payload() == 0))
diff --git a/http2/decoder/payload_decoders/settings_payload_decoder.cc b/http2/decoder/payload_decoders/settings_payload_decoder.cc
index 5227bc4..a041792 100644
--- a/http2/decoder/payload_decoders/settings_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/settings_payload_decoder.cc
@@ -20,9 +20,9 @@
HTTP2_DVLOG(2) << "SettingsPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::SETTINGS, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
- DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::ACK));
+ QUICHE_DCHECK_EQ(Http2FrameType::SETTINGS, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(0, frame_header.flags & ~(Http2FrameFlag::ACK));
if (frame_header.IsAck()) {
if (total_length == 0) {
@@ -45,8 +45,8 @@
HTTP2_DVLOG(2) << "SettingsPayloadDecoder::ResumeDecodingPayload"
<< " remaining_payload=" << state->remaining_payload()
<< " db->Remaining=" << db->Remaining();
- DCHECK_EQ(Http2FrameType::SETTINGS, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::SETTINGS, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
DecodeStatus status =
state->ResumeDecodingStructureInPayload(&setting_fields_, db);
@@ -85,7 +85,7 @@
// Not done decoding the structure. Either we've got more payload to decode,
// or we've run out because the payload is too short, in which case
// OnFrameSizeError will have already been called.
- DCHECK(
+ QUICHE_DCHECK(
(status == DecodeStatus::kDecodeInProgress &&
state->remaining_payload() > 0) ||
(status == DecodeStatus::kDecodeError && state->remaining_payload() == 0))
diff --git a/http2/decoder/payload_decoders/settings_payload_decoder.h b/http2/decoder/payload_decoders/settings_payload_decoder.h
index 2d5e71d..7462888 100644
--- a/http2/decoder/payload_decoders/settings_payload_decoder.h
+++ b/http2/decoder/payload_decoders/settings_payload_decoder.h
@@ -41,7 +41,7 @@
DecodeBuffer* db);
// Decoding a single SETTING returned a status other than kDecodeDone; this
- // method just brings together the DCHECKs to reduce duplication.
+ // method just brings together the QUICHE_DCHECKs to reduce duplication.
DecodeStatus HandleNotDone(FrameDecoderState* state,
DecodeBuffer* db,
DecodeStatus status);
diff --git a/http2/decoder/payload_decoders/unknown_payload_decoder.cc b/http2/decoder/payload_decoders/unknown_payload_decoder.cc
index 5bbaa5d..a71ea78 100644
--- a/http2/decoder/payload_decoders/unknown_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/unknown_payload_decoder.cc
@@ -21,8 +21,8 @@
HTTP2_DVLOG(2) << "UnknownPayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK(!IsSupportedHttp2FrameType(frame_header.type)) << frame_header;
- DCHECK_LE(db->Remaining(), frame_header.payload_length);
+ QUICHE_DCHECK(!IsSupportedHttp2FrameType(frame_header.type)) << frame_header;
+ QUICHE_DCHECK_LE(db->Remaining(), frame_header.payload_length);
state->InitializeRemainders();
state->listener()->OnUnknownStart(frame_header);
@@ -35,10 +35,11 @@
HTTP2_DVLOG(2) << "UnknownPayloadDecoder::ResumeDecodingPayload "
<< "remaining_payload=" << state->remaining_payload()
<< "; db->Remaining=" << db->Remaining();
- DCHECK(!IsSupportedHttp2FrameType(state->frame_header().type))
+ QUICHE_DCHECK(!IsSupportedHttp2FrameType(state->frame_header().type))
<< state->frame_header();
- DCHECK_LE(state->remaining_payload(), state->frame_header().payload_length);
- DCHECK_LE(db->Remaining(), state->remaining_payload());
+ QUICHE_DCHECK_LE(state->remaining_payload(),
+ state->frame_header().payload_length);
+ QUICHE_DCHECK_LE(db->Remaining(), state->remaining_payload());
size_t avail = db->Remaining();
if (avail > 0) {
diff --git a/http2/decoder/payload_decoders/window_update_payload_decoder.cc b/http2/decoder/payload_decoders/window_update_payload_decoder.cc
index 8085f70..d088e51 100644
--- a/http2/decoder/payload_decoders/window_update_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/window_update_payload_decoder.cc
@@ -22,11 +22,11 @@
HTTP2_DVLOG(2) << "WindowUpdatePayloadDecoder::StartDecodingPayload: "
<< frame_header;
- DCHECK_EQ(Http2FrameType::WINDOW_UPDATE, frame_header.type);
- DCHECK_LE(db->Remaining(), total_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::WINDOW_UPDATE, frame_header.type);
+ QUICHE_DCHECK_LE(db->Remaining(), total_length);
// WINDOW_UPDATE frames have no flags.
- DCHECK_EQ(0, frame_header.flags);
+ QUICHE_DCHECK_EQ(0, frame_header.flags);
// Special case for when the payload is the correct size and entirely in
// the buffer.
@@ -48,8 +48,8 @@
HTTP2_DVLOG(2) << "ResumeDecodingPayload: remaining_payload="
<< state->remaining_payload()
<< "; db->Remaining=" << db->Remaining();
- DCHECK_EQ(Http2FrameType::WINDOW_UPDATE, state->frame_header().type);
- DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
+ QUICHE_DCHECK_EQ(Http2FrameType::WINDOW_UPDATE, state->frame_header().type);
+ QUICHE_DCHECK_LE(db->Remaining(), state->frame_header().payload_length);
return HandleStatus(state, state->ResumeDecodingStructureInPayload(
&window_update_fields_, db));
}
@@ -70,7 +70,7 @@
// Not done decoding the structure. Either we've got more payload to decode,
// or we've run out because the payload is too short, in which case
// OnFrameSizeError will have already been called.
- DCHECK(
+ QUICHE_DCHECK(
(status == DecodeStatus::kDecodeInProgress &&
state->remaining_payload() > 0) ||
(status == DecodeStatus::kDecodeError && state->remaining_payload() == 0))
diff --git a/http2/hpack/decoder/hpack_block_collector.cc b/http2/hpack/decoder/hpack_block_collector.cc
index f77100a..677f55a 100644
--- a/http2/hpack/decoder/hpack_block_collector.cc
+++ b/http2/hpack/decoder/hpack_block_collector.cc
@@ -95,7 +95,7 @@
void HpackBlockCollector::AppendToHpackBlockBuilder(
HpackBlockBuilder* hbb) const {
- CHECK(IsNotPending());
+ QUICHE_CHECK(IsNotPending());
for (const auto& entry : entries_) {
entry.AppendToHpackBlockBuilder(hbb);
}
diff --git a/http2/hpack/decoder/hpack_block_decoder.cc b/http2/hpack/decoder/hpack_block_decoder.cc
index c609f27..9c63f03 100644
--- a/http2/hpack/decoder/hpack_block_decoder.cc
+++ b/http2/hpack/decoder/hpack_block_decoder.cc
@@ -24,14 +24,14 @@
before_entry_ = true;
break;
case DecodeStatus::kDecodeInProgress:
- DCHECK_EQ(0u, db->Remaining());
+ QUICHE_DCHECK_EQ(0u, db->Remaining());
return DecodeStatus::kDecodeInProgress;
case DecodeStatus::kDecodeError:
HTTP2_CODE_COUNT_N(decompress_failure_3, 1, 23);
return DecodeStatus::kDecodeError;
}
}
- DCHECK(before_entry_);
+ QUICHE_DCHECK(before_entry_);
while (db->HasData()) {
HTTP2_DVLOG(2) << "HpackBlockDecoder::Decode start entry, db->Remaining="
<< db->Remaining();
@@ -40,16 +40,16 @@
case DecodeStatus::kDecodeDone:
continue;
case DecodeStatus::kDecodeInProgress:
- DCHECK_EQ(0u, db->Remaining());
+ QUICHE_DCHECK_EQ(0u, db->Remaining());
before_entry_ = false;
return DecodeStatus::kDecodeInProgress;
case DecodeStatus::kDecodeError:
HTTP2_CODE_COUNT_N(decompress_failure_3, 2, 23);
return DecodeStatus::kDecodeError;
}
- DCHECK(false);
+ QUICHE_DCHECK(false);
}
- DCHECK(before_entry_);
+ QUICHE_DCHECK(before_entry_);
return DecodeStatus::kDecodeDone;
}
diff --git a/http2/hpack/decoder/hpack_block_decoder.h b/http2/hpack/decoder/hpack_block_decoder.h
index 2f28c4e..3d956b1 100644
--- a/http2/hpack/decoder/hpack_block_decoder.h
+++ b/http2/hpack/decoder/hpack_block_decoder.h
@@ -26,7 +26,7 @@
public:
explicit HpackBlockDecoder(HpackEntryDecoderListener* listener)
: listener_(listener) {
- DCHECK_NE(listener_, nullptr);
+ QUICHE_DCHECK_NE(listener_, nullptr);
}
~HpackBlockDecoder() {}
diff --git a/http2/hpack/decoder/hpack_decoder.cc b/http2/hpack/decoder/hpack_decoder.cc
index d1552de..45d7a78 100644
--- a/http2/hpack/decoder/hpack_decoder.cc
+++ b/http2/hpack/decoder/hpack_decoder.cc
@@ -69,7 +69,8 @@
return false;
}
// Should be positioned between entries iff decoding is complete.
- DCHECK_EQ(block_decoder_.before_entry(), status == DecodeStatus::kDecodeDone)
+ QUICHE_DCHECK_EQ(block_decoder_.before_entry(),
+ status == DecodeStatus::kDecodeDone)
<< status;
if (!block_decoder_.before_entry()) {
entry_buffer_.BufferStringsIfUnbuffered();
diff --git a/http2/hpack/decoder/hpack_decoder_state.cc b/http2/hpack/decoder/hpack_decoder_state.cc
index 6e234af..528f1b6 100644
--- a/http2/hpack/decoder/hpack_decoder_state.cc
+++ b/http2/hpack/decoder/hpack_decoder_state.cc
@@ -43,7 +43,7 @@
uint32_t header_table_size) {
HTTP2_DVLOG(2) << "HpackDecoderState::ApplyHeaderTableSizeSetting("
<< header_table_size << ")";
- DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
+ QUICHE_DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
if (header_table_size < lowest_header_table_size_) {
lowest_header_table_size_ = header_table_size;
}
@@ -59,9 +59,9 @@
// This instance can't be reused after an error has been detected, as we must
// assume that the encoder and decoder compression states are no longer
// synchronized.
- DCHECK(error_ == HpackDecodingError::kOk)
+ QUICHE_DCHECK(error_ == HpackDecodingError::kOk)
<< HpackDecodingErrorToString(error_);
- DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
+ QUICHE_DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
allow_dynamic_table_size_update_ = true;
saw_dynamic_table_size_update_ = false;
// If the peer has acknowledged a HEADER_TABLE_SIZE smaller than that which
@@ -155,7 +155,7 @@
if (error_ != HpackDecodingError::kOk) {
return;
}
- DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
+ QUICHE_DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
if (!allow_dynamic_table_size_update_) {
// At most two dynamic table size updates allowed at the start, and not
// after a header.
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index 3d31026..2a21846 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -62,7 +62,7 @@
void HpackDecoderStringBuffer::Set(absl::string_view value, bool is_static) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::Set";
- DCHECK_EQ(state_, State::RESET);
+ QUICHE_DCHECK_EQ(state_, State::RESET);
value_ = value;
state_ = State::COMPLETE;
backing_ = is_static ? Backing::STATIC : Backing::UNBUFFERED;
@@ -73,7 +73,7 @@
void HpackDecoderStringBuffer::OnStart(bool huffman_encoded, size_t len) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnStart";
- DCHECK_EQ(state_, State::RESET);
+ QUICHE_DCHECK_EQ(state_, State::RESET);
remaining_len_ = len;
is_huffman_encoded_ = huffman_encoded;
@@ -107,12 +107,12 @@
bool HpackDecoderStringBuffer::OnData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnData state=" << state_
<< ", backing=" << backing_;
- DCHECK_EQ(state_, State::COLLECTING);
- DCHECK_LE(len, remaining_len_);
+ QUICHE_DCHECK_EQ(state_, State::COLLECTING);
+ QUICHE_DCHECK_LE(len, remaining_len_);
remaining_len_ -= len;
if (is_huffman_encoded_) {
- DCHECK_EQ(backing_, Backing::BUFFERED);
+ QUICHE_DCHECK_EQ(backing_, Backing::BUFFERED);
return decoder_.Decode(absl::string_view(data, len), &buffer_);
}
@@ -136,7 +136,7 @@
// This is not the first call to OnData for this string, so it should be
// buffered.
- DCHECK_EQ(backing_, Backing::BUFFERED);
+ QUICHE_DCHECK_EQ(backing_, Backing::BUFFERED);
// Append to the current contents of the buffer.
buffer_.append(data, len);
@@ -145,11 +145,11 @@
bool HpackDecoderStringBuffer::OnEnd() {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnEnd";
- DCHECK_EQ(state_, State::COLLECTING);
- DCHECK_EQ(0u, remaining_len_);
+ QUICHE_DCHECK_EQ(state_, State::COLLECTING);
+ QUICHE_DCHECK_EQ(0u, remaining_len_);
if (is_huffman_encoded_) {
- DCHECK_EQ(backing_, Backing::BUFFERED);
+ QUICHE_DCHECK_EQ(backing_, Backing::BUFFERED);
// Did the Huffman encoding of the string end properly?
if (!decoder_.InputProperlyTerminated()) {
return false; // No, it didn't.
@@ -189,7 +189,7 @@
absl::string_view HpackDecoderStringBuffer::str() const {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::str";
- DCHECK_EQ(state_, State::COMPLETE);
+ QUICHE_DCHECK_EQ(state_, State::COMPLETE);
return value_;
}
@@ -202,8 +202,8 @@
std::string HpackDecoderStringBuffer::ReleaseString() {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::ReleaseString";
- DCHECK_EQ(state_, State::COMPLETE);
- DCHECK_EQ(backing_, Backing::BUFFERED);
+ QUICHE_DCHECK_EQ(state_, State::COMPLETE);
+ QUICHE_DCHECK_EQ(backing_, Backing::BUFFERED);
if (state_ == State::COMPLETE) {
state_ = State::RESET;
if (backing_ == Backing::BUFFERED) {
diff --git a/http2/hpack/decoder/hpack_decoder_tables.cc b/http2/hpack/decoder/hpack_decoder_tables.cc
index fa87b83..1b2cc11 100644
--- a/http2/hpack/decoder/hpack_decoder_tables.cc
+++ b/http2/hpack/decoder/hpack_decoder_tables.cc
@@ -15,8 +15,8 @@
ptr->reserve(kFirstDynamicTableIndex);
ptr->emplace_back("", "");
-#define STATIC_TABLE_ENTRY(name, value, index) \
- DCHECK_EQ(ptr->size(), static_cast<size_t>(index)); \
+#define STATIC_TABLE_ENTRY(name, value, index) \
+ QUICHE_DCHECK_EQ(ptr->size(), static_cast<size_t>(index)); \
ptr->emplace_back(name, value)
#include "http2/hpack/hpack_static_table_entries.inc"
@@ -63,7 +63,7 @@
HTTP2_DVLOG(3) << "HpackDecoderDynamicTable::DynamicTableSizeUpdate "
<< size_limit;
EnsureSizeNoMoreThan(size_limit);
- DCHECK_LE(current_size_, size_limit);
+ QUICHE_DCHECK_LE(current_size_, size_limit);
size_limit_ = size_limit;
}
@@ -94,8 +94,8 @@
table_.push_front(entry);
current_size_ += entry_size;
HTTP2_DVLOG(2) << "InsertEntry: current_size_=" << current_size_;
- DCHECK_GE(current_size_, entry_size);
- DCHECK_LE(current_size_, size_limit_);
+ QUICHE_DCHECK_GE(current_size_, entry_size);
+ QUICHE_DCHECK_LE(current_size_, size_limit_);
}
const HpackStringPair* HpackDecoderDynamicTable::Lookup(size_t index) const {
@@ -118,19 +118,19 @@
while (current_size_ > limit) {
RemoveLastEntry();
}
- DCHECK_LE(current_size_, limit);
+ QUICHE_DCHECK_LE(current_size_, limit);
}
void HpackDecoderDynamicTable::RemoveLastEntry() {
- DCHECK(!table_.empty());
+ QUICHE_DCHECK(!table_.empty());
if (!table_.empty()) {
HTTP2_DVLOG(2) << "RemoveLastEntry current_size_=" << current_size_
<< ", last entry size=" << table_.back().size();
- DCHECK_GE(current_size_, table_.back().size());
+ QUICHE_DCHECK_GE(current_size_, table_.back().size());
current_size_ -= table_.back().size();
table_.pop_back();
// Empty IFF current_size_ == 0.
- DCHECK_EQ(table_.empty(), current_size_ == 0);
+ QUICHE_DCHECK_EQ(table_.empty(), current_size_ == 0);
}
}
diff --git a/http2/hpack/decoder/hpack_decoder_tables_test.cc b/http2/hpack/decoder/hpack_decoder_tables_test.cc
index 7978b7f..a3e4ee0 100644
--- a/http2/hpack/decoder/hpack_decoder_tables_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_tables_test.cc
@@ -38,8 +38,8 @@
std::vector<StaticEntry> MakeSpecStaticEntries() {
std::vector<StaticEntry> static_entries;
-#define STATIC_TABLE_ENTRY(name, value, index) \
- DCHECK_EQ(static_entries.size() + 1, static_cast<size_t>(index)); \
+#define STATIC_TABLE_ENTRY(name, value, index) \
+ QUICHE_DCHECK_EQ(static_entries.size() + 1, static_cast<size_t>(index)); \
static_entries.push_back({name, value, index});
#include "http2/hpack/hpack_static_table_entries.inc"
diff --git a/http2/hpack/decoder/hpack_entry_collector.cc b/http2/hpack/decoder/hpack_entry_collector.cc
index 97abea2..a228b6a 100644
--- a/http2/hpack/decoder/hpack_entry_collector.cc
+++ b/http2/hpack/decoder/hpack_entry_collector.cc
@@ -216,11 +216,11 @@
case HpackEntryType::kNeverIndexedLiteralHeader:
ASSERT_TRUE(value_.HasEnded()) << *this;
if (index_ != 0) {
- CHECK(name_.IsClear());
+ QUICHE_CHECK(name_.IsClear());
hbb->AppendNameIndexAndLiteralValue(header_type_, index_,
value_.huffman_encoded, value_.s);
} else {
- CHECK(name_.HasEnded()) << *this;
+ QUICHE_CHECK(name_.HasEnded()) << *this;
hbb->AppendLiteralNameAndValue(header_type_, name_.huffman_encoded,
name_.s, value_.huffman_encoded,
value_.s);
diff --git a/http2/hpack/decoder/hpack_entry_decoder.cc b/http2/hpack/decoder/hpack_entry_decoder.cc
index 3cafde8..4e4a4da 100644
--- a/http2/hpack/decoder/hpack_entry_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_decoder.cc
@@ -57,9 +57,9 @@
DecodeStatus HpackEntryDecoder::Start(DecodeBuffer* db,
HpackEntryDecoderListener* listener) {
- DCHECK(db != nullptr);
- DCHECK(listener != nullptr);
- DCHECK(db->HasData());
+ QUICHE_DCHECK(db != nullptr);
+ QUICHE_DCHECK(listener != nullptr);
+ QUICHE_DCHECK(db->HasData());
DecodeStatus status = entry_type_decoder_.Start(db);
switch (status) {
case DecodeStatus::kDecodeDone:
@@ -76,7 +76,7 @@
case DecodeStatus::kDecodeInProgress:
// Hit the end of the decode buffer before fully decoding
// the entry type and varint.
- DCHECK_EQ(0u, db->Remaining());
+ QUICHE_DCHECK_EQ(0u, db->Remaining());
state_ = EntryDecoderState::kResumeDecodingType;
return status;
case DecodeStatus::kDecodeError:
@@ -92,8 +92,8 @@
DecodeStatus HpackEntryDecoder::Resume(DecodeBuffer* db,
HpackEntryDecoderListener* listener) {
- DCHECK(db != nullptr);
- DCHECK(listener != nullptr);
+ QUICHE_DCHECK(db != nullptr);
+ QUICHE_DCHECK(listener != nullptr);
DecodeStatus status;
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.cc b/http2/hpack/decoder/hpack_entry_type_decoder.cc
index 1cfc23a..99a0770 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_type_decoder.cc
@@ -31,8 +31,8 @@
// full HTTP/2 decoder level, but preferably still higher) to determine if the
// alternatives that take less code/data space are preferable in that situation.
DecodeStatus HpackEntryTypeDecoder::Start(DecodeBuffer* db) {
- DCHECK(db != nullptr);
- DCHECK(db->HasData());
+ QUICHE_DCHECK(db != nullptr);
+ QUICHE_DCHECK(db->HasData());
// The high four bits (nibble) of first byte of the entry determine the type
// of the entry, and may also be the initial bits of the varint that
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder_test.cc b/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
index c02988a..8852064 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
@@ -24,7 +24,7 @@
class HpackEntryTypeDecoderTest : public RandomDecoderTest {
protected:
DecodeStatus StartDecoding(DecodeBuffer* b) override {
- CHECK_LT(0u, b->Remaining());
+ QUICHE_CHECK_LT(0u, b->Remaining());
return decoder_.Start(b);
}
diff --git a/http2/hpack/decoder/hpack_string_decoder.h b/http2/hpack/decoder/hpack_string_decoder.h
index 252ab04..b861d23 100644
--- a/http2/hpack/decoder/hpack_string_decoder.h
+++ b/http2/hpack/decoder/hpack_string_decoder.h
@@ -154,7 +154,7 @@
bool ResumeDecodingLength(DecodeBuffer* db,
Listener* cb,
DecodeStatus* status) {
- DCHECK_EQ(state_, kResumeDecodingLength);
+ QUICHE_DCHECK_EQ(state_, kResumeDecodingLength);
*status = length_decoder_.Resume(db);
if (*status == DecodeStatus::kDecodeDone) {
state_ = kDecodingString;
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
index e546e23..76d1f31 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -55,7 +55,7 @@
void HpackWholeEntryBuffer::OnNameStart(bool huffman_encoded, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameStart: huffman_encoded="
<< (huffman_encoded ? "true" : "false") << ", len=" << len;
- DCHECK_EQ(maybe_name_index_, 0u);
+ QUICHE_DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_) {
if (len > max_string_size_bytes_) {
HTTP2_DVLOG(1) << "Name length (" << len << ") is longer than permitted ("
@@ -72,7 +72,7 @@
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len
<< " data:\n"
<< Http2HexDump(absl::string_view(data, len));
- DCHECK_EQ(maybe_name_index_, 0u);
+ QUICHE_DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnData(data, len)) {
ReportError(HpackDecodingError::kNameHuffmanError, "");
HTTP2_CODE_COUNT_N(decompress_failure_3, 19, 23);
@@ -81,7 +81,7 @@
void HpackWholeEntryBuffer::OnNameEnd() {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameEnd";
- DCHECK_EQ(maybe_name_index_, 0u);
+ QUICHE_DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnEnd()) {
ReportError(HpackDecodingError::kNameHuffmanError, "");
HTTP2_CODE_COUNT_N(decompress_failure_3, 20, 23);
diff --git a/http2/hpack/huffman/hpack_huffman_decoder.cc b/http2/hpack/huffman/hpack_huffman_decoder.cc
index 868d4f0..2f486c6 100644
--- a/http2/hpack/huffman/hpack_huffman_decoder.cc
+++ b/http2/hpack/huffman/hpack_huffman_decoder.cc
@@ -379,7 +379,7 @@
}
void HuffmanBitBuffer::ConsumeBits(HuffmanAccumulatorBitCount code_length) {
- DCHECK_LE(code_length, count_);
+ QUICHE_DCHECK_LE(code_length, count_);
accumulator_ <<= code_length;
count_ -= code_length;
}
@@ -393,7 +393,7 @@
HuffmanAccumulator expected = ~(~HuffmanAccumulator() >> cnt);
// We expect all the bits below the high order |cnt| bits of accumulator_
// to be cleared as we perform left shift operations while decoding.
- DCHECK_EQ(accumulator_ & ~expected, 0u)
+ QUICHE_DCHECK_EQ(accumulator_ & ~expected, 0u)
<< "\n expected: " << HuffmanAccumulatorBitSet(expected) << "\n "
<< *this;
return accumulator_ == expected;
@@ -425,7 +425,7 @@
// code of 5, 6 or 7 bits.
uint8_t short_code =
bit_buffer_.value() >> (kHuffmanAccumulatorBitCount - 7);
- DCHECK_LT(short_code, 128);
+ QUICHE_DCHECK_LT(short_code, 128);
if (short_code < kShortCodeTableSize) {
ShortCodeInfo info = kShortCodeTable[short_code];
bit_buffer_.ConsumeBits(info.length);
@@ -449,8 +449,8 @@
PrefixInfo prefix_info = PrefixToInfo(code_prefix);
HTTP2_DVLOG(3) << "prefix_info: " << prefix_info;
- DCHECK_LE(kMinCodeBitCount, prefix_info.code_length);
- DCHECK_LE(prefix_info.code_length, kMaxCodeBitCount);
+ QUICHE_DCHECK_LE(kMinCodeBitCount, prefix_info.code_length);
+ QUICHE_DCHECK_LE(prefix_info.code_length, kMaxCodeBitCount);
if (prefix_info.code_length <= bit_buffer_.count()) {
// We have enough bits for one code.
@@ -471,7 +471,7 @@
// Append to it as many bytes as are available AND fit.
size_t byte_count = bit_buffer_.AppendBytes(input);
if (byte_count == 0) {
- DCHECK_EQ(input.size(), 0u);
+ QUICHE_DCHECK_EQ(input.size(), 0u);
return true;
}
input.remove_prefix(byte_count);
diff --git a/http2/hpack/huffman/hpack_huffman_encoder.cc b/http2/hpack/huffman/hpack_huffman_encoder.cc
index d568641..daf85bc 100644
--- a/http2/hpack/huffman/hpack_huffman_encoder.cc
+++ b/http2/hpack/huffman/hpack_huffman_encoder.cc
@@ -20,7 +20,7 @@
void HuffmanEncode(absl::string_view plain,
size_t encoded_size,
std::string* huffman) {
- DCHECK(huffman != nullptr);
+ QUICHE_DCHECK(huffman != nullptr);
huffman->reserve(huffman->size() + encoded_size);
uint64_t bit_buffer = 0; // High-bit is next bit to output. Not clear if that
// is more performant than having the low-bit be the
@@ -116,7 +116,7 @@
*(current + 4) |= code & 0xff;
}
- DCHECK_EQ(encoded_size, (bit_counter + 7) / 8);
+ QUICHE_DCHECK_EQ(encoded_size, (bit_counter + 7) / 8);
// EOF
if (bit_counter % 8 != 0) {
diff --git a/http2/hpack/tools/hpack_block_builder.h b/http2/hpack/tools/hpack_block_builder.h
index 31a6b53..079f823 100644
--- a/http2/hpack/tools/hpack_block_builder.h
+++ b/http2/hpack/tools/hpack_block_builder.h
@@ -12,8 +12,9 @@
// values that the decoder should reject. For now, this is only intended for
// use in tests, and thus has EXPECT* in the code. If desired to use it in an
// encoder, it will need optimization work, especially w.r.t memory mgmt, and
-// the EXPECT* will need to be removed or replaced with DCHECKs. And of course
-// the support for very large varints will not be needed in production code.
+// the EXPECT* will need to be removed or replaced with QUICHE_DCHECKs. And of
+// course the support for very large varints will not be needed in production
+// code.
#include <stddef.h>
diff --git a/http2/hpack/tools/hpack_example.cc b/http2/hpack/tools/hpack_example.cc
index 9832fdc..25f44c9 100644
--- a/http2/hpack/tools/hpack_example.cc
+++ b/http2/hpack/tools/hpack_example.cc
@@ -19,9 +19,9 @@
while (!example.empty()) {
const char c0 = example[0];
if (isxdigit(c0)) {
- CHECK_GT(example.size(), 1u) << "Truncated hex byte?";
+ QUICHE_CHECK_GT(example.size(), 1u) << "Truncated hex byte?";
const char c1 = example[1];
- CHECK(isxdigit(c1)) << "Found half a byte?";
+ QUICHE_CHECK(isxdigit(c1)) << "Found half a byte?";
*output += Http2HexDecode(example.substr(0, 2));
example.remove_prefix(2);
continue;
@@ -44,7 +44,7 @@
<< absl::StrCat(" (0x", Http2Hex(c0), ")")
<< "\nExample: " << example;
}
- CHECK_LT(0u, output->size()) << "Example is empty.";
+ QUICHE_CHECK_LT(0u, output->size()) << "Example is empty.";
}
} // namespace
diff --git a/http2/hpack/varint/hpack_varint_decoder.cc b/http2/hpack/varint/hpack_varint_decoder.cc
index 705976c..5ba0b74 100644
--- a/http2/hpack/varint/hpack_varint_decoder.cc
+++ b/http2/hpack/varint/hpack_varint_decoder.cc
@@ -12,8 +12,8 @@
DecodeStatus HpackVarintDecoder::Start(uint8_t prefix_value,
uint8_t prefix_length,
DecodeBuffer* db) {
- DCHECK_LE(3u, prefix_length);
- DCHECK_LE(prefix_length, 8u);
+ QUICHE_DCHECK_LE(3u, prefix_length);
+ QUICHE_DCHECK_LE(prefix_length, 8u);
// |prefix_mask| defines the sequence of low-order bits of the first byte
// that encode the prefix of the value. It is also the marker in those bits
@@ -34,8 +34,8 @@
DecodeStatus HpackVarintDecoder::StartExtended(uint8_t prefix_length,
DecodeBuffer* db) {
- DCHECK_LE(3u, prefix_length);
- DCHECK_LE(prefix_length, 8u);
+ QUICHE_DCHECK_LE(3u, prefix_length);
+ QUICHE_DCHECK_LE(prefix_length, 8u);
value_ = (1 << prefix_length) - 1;
offset_ = 0;
@@ -59,8 +59,8 @@
// Shifting a 7 bit value to the left by at most 56 places can never
// overflow on uint64_t.
- DCHECK_LE(offset_, 56);
- DCHECK_LE(summand, std::numeric_limits<uint64_t>::max() >> offset_);
+ QUICHE_DCHECK_LE(offset_, 56);
+ QUICHE_DCHECK_LE(summand, std::numeric_limits<uint64_t>::max() >> offset_);
summand <<= offset_;
@@ -68,7 +68,7 @@
// |value_| is at most (2^prefix_length - 1) + (2^49 - 1), and
// |summand| is at most 255 << 56 (which is smaller than 2^63),
// so adding them can never overflow on uint64_t.
- DCHECK_LE(value_, std::numeric_limits<uint64_t>::max() - summand);
+ QUICHE_DCHECK_LE(value_, std::numeric_limits<uint64_t>::max() - summand);
value_ += summand;
@@ -85,7 +85,7 @@
return DecodeStatus::kDecodeInProgress;
}
- DCHECK_EQ(kMaxOffset, offset_);
+ QUICHE_DCHECK_EQ(kMaxOffset, offset_);
uint8_t byte = db->DecodeUInt8();
// No more extension bytes are allowed after this.
diff --git a/http2/hpack/varint/hpack_varint_decoder.h b/http2/hpack/varint/hpack_varint_decoder.h
index 4d6fb0c..7de72ba 100644
--- a/http2/hpack/varint/hpack_varint_decoder.h
+++ b/http2/hpack/varint/hpack_varint_decoder.h
@@ -102,12 +102,12 @@
}
void CheckNotDone() const {
#ifndef NDEBUG
- DCHECK_NE(kHpackVarintDecoderOffsetDone, offset_);
+ QUICHE_DCHECK_NE(kHpackVarintDecoderOffsetDone, offset_);
#endif
}
void CheckDone() const {
#ifndef NDEBUG
- DCHECK_EQ(kHpackVarintDecoderOffsetDone, offset_);
+ QUICHE_DCHECK_EQ(kHpackVarintDecoderOffsetDone, offset_);
#endif
}
diff --git a/http2/hpack/varint/hpack_varint_decoder_test.cc b/http2/hpack/varint/hpack_varint_decoder_test.cc
index 742d277..3d73c5c 100644
--- a/http2/hpack/varint/hpack_varint_decoder_test.cc
+++ b/http2/hpack/varint/hpack_varint_decoder_test.cc
@@ -89,7 +89,7 @@
}
DecodeStatus StartDecoding(DecodeBuffer* b) override {
- CHECK_LT(0u, b->Remaining());
+ QUICHE_CHECK_LT(0u, b->Remaining());
uint8_t prefix = b->DecodeUInt8();
return decoder_.Start(prefix, prefix_length_, b);
}
diff --git a/http2/hpack/varint/hpack_varint_encoder.cc b/http2/hpack/varint/hpack_varint_encoder.cc
index 3e0e9eb..87f4981 100644
--- a/http2/hpack/varint/hpack_varint_encoder.cc
+++ b/http2/hpack/varint/hpack_varint_encoder.cc
@@ -15,14 +15,14 @@
uint8_t prefix_length,
uint64_t varint,
std::string* output) {
- DCHECK_LE(1u, prefix_length);
- DCHECK_LE(prefix_length, 8u);
+ QUICHE_DCHECK_LE(1u, prefix_length);
+ QUICHE_DCHECK_LE(prefix_length, 8u);
// prefix_mask defines the sequence of low-order bits of the first byte
// that encode the prefix of the value. It is also the marker in those bits
// of the first byte indicating that at least one extension byte is needed.
const uint8_t prefix_mask = (1 << prefix_length) - 1;
- DCHECK_EQ(0, high_bits & prefix_mask);
+ QUICHE_DCHECK_EQ(0, high_bits & prefix_mask);
if (varint < prefix_mask) {
// The integer fits into the prefix in its entirety.
diff --git a/http2/hpack/varint/hpack_varint_round_trip_test.cc b/http2/hpack/varint/hpack_varint_round_trip_test.cc
index 91abbba..7b73edb 100644
--- a/http2/hpack/varint/hpack_varint_round_trip_test.cc
+++ b/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -41,7 +41,7 @@
HpackVarintRoundTripTest() : prefix_length_(0) {}
DecodeStatus StartDecoding(DecodeBuffer* b) override {
- CHECK_LT(0u, b->Remaining());
+ QUICHE_CHECK_LT(0u, b->Remaining());
uint8_t prefix = b->DecodeUInt8();
return decoder_.Start(prefix, prefix_length_, b);
}
@@ -82,8 +82,8 @@
}
void EncodeNoRandom(uint64_t value, uint8_t prefix_length) {
- DCHECK_LE(3, prefix_length);
- DCHECK_LE(prefix_length, 8);
+ QUICHE_DCHECK_LE(3, prefix_length);
+ QUICHE_DCHECK_LE(prefix_length, 8);
prefix_length_ = prefix_length;
HpackBlockBuilder bb;
@@ -156,7 +156,7 @@
void EncodeAndDecodeValues(const std::set<uint64_t>& values,
uint8_t prefix_length,
size_t expected_bytes) {
- CHECK(!values.empty());
+ QUICHE_CHECK(!values.empty());
const uint64_t minimum = *values.begin();
const uint64_t maximum = *values.rbegin();
for (const uint64_t value : values) {
diff --git a/http2/http2_constants.cc b/http2/http2_constants.cc
index 1cc6b17..d333cf4 100644
--- a/http2/http2_constants.cc
+++ b/http2/http2_constants.cc
@@ -85,7 +85,7 @@
if (flags != 0) {
append_and_clear(Http2StringPrintf("0x%02x", flags), flags);
}
- DCHECK_EQ(0, flags);
+ QUICHE_DCHECK_EQ(0, flags);
return s;
}
std::string Http2FrameFlagsToString(uint8_t type, uint8_t flags) {
diff --git a/http2/http2_structures.h b/http2/http2_structures.h
index 79f739d..0fa4dbb 100644
--- a/http2/http2_structures.h
+++ b/http2/http2_structures.h
@@ -47,7 +47,7 @@
stream_id(stream_id),
type(type),
flags(static_cast<Http2FrameFlag>(flags)) {
- DCHECK_LT(payload_length, static_cast<uint32_t>(1 << 24))
+ QUICHE_DCHECK_LT(payload_length, static_cast<uint32_t>(1 << 24))
<< "Payload Length is only a 24 bit field\n"
<< ToString();
}
@@ -66,38 +66,41 @@
// Is the END_STREAM flag set?
bool IsEndStream() const {
- DCHECK(type == Http2FrameType::DATA || type == Http2FrameType::HEADERS)
+ QUICHE_DCHECK(type == Http2FrameType::DATA ||
+ type == Http2FrameType::HEADERS)
<< ToString();
return (flags & Http2FrameFlag::END_STREAM) != 0;
}
// Is the ACK flag set?
bool IsAck() const {
- DCHECK(type == Http2FrameType::SETTINGS || type == Http2FrameType::PING)
+ QUICHE_DCHECK(type == Http2FrameType::SETTINGS ||
+ type == Http2FrameType::PING)
<< ToString();
return (flags & Http2FrameFlag::ACK) != 0;
}
// Is the END_HEADERS flag set?
bool IsEndHeaders() const {
- DCHECK(type == Http2FrameType::HEADERS ||
- type == Http2FrameType::PUSH_PROMISE ||
- type == Http2FrameType::CONTINUATION)
+ QUICHE_DCHECK(type == Http2FrameType::HEADERS ||
+ type == Http2FrameType::PUSH_PROMISE ||
+ type == Http2FrameType::CONTINUATION)
<< ToString();
return (flags & Http2FrameFlag::END_HEADERS) != 0;
}
// Is the PADDED flag set?
bool IsPadded() const {
- DCHECK(type == Http2FrameType::DATA || type == Http2FrameType::HEADERS ||
- type == Http2FrameType::PUSH_PROMISE)
+ QUICHE_DCHECK(type == Http2FrameType::DATA ||
+ type == Http2FrameType::HEADERS ||
+ type == Http2FrameType::PUSH_PROMISE)
<< ToString();
return (flags & Http2FrameFlag::PADDED) != 0;
}
// Is the PRIORITY flag set?
bool HasPriority() const {
- DCHECK_EQ(type, Http2FrameType::HEADERS) << ToString();
+ QUICHE_DCHECK_EQ(type, Http2FrameType::HEADERS) << ToString();
return (flags & Http2FrameFlag::PRIORITY) != 0;
}
@@ -149,11 +152,11 @@
is_exclusive(is_exclusive) {
// Can't have the high-bit set in the stream id because we need to use
// that for the EXCLUSIVE flag bit.
- DCHECK_EQ(stream_dependency, stream_dependency & StreamIdMask())
+ QUICHE_DCHECK_EQ(stream_dependency, stream_dependency & StreamIdMask())
<< "Stream Dependency is only a 31-bit field.\n"
<< ToString();
- DCHECK_LE(1u, weight) << "Weight is too small.";
- DCHECK_LE(weight, 256u) << "Weight is too large.";
+ QUICHE_DCHECK_LE(1u, weight) << "Weight is too small.";
+ QUICHE_DCHECK_LE(weight, 256u) << "Weight is too large.";
}
static constexpr size_t EncodedSize() { return 5; }
diff --git a/http2/http2_structures_test.cc b/http2/http2_structures_test.cc
index 3525c40..ffd67b3 100644
--- a/http2/http2_structures_test.cc
+++ b/http2/http2_structures_test.cc
@@ -91,8 +91,8 @@
Http2Random random;
uint8_t frame_type = 0;
do {
- // Only the payload length is DCHECK'd in the constructor, so we need to
- // make sure it is a "uint24".
+ // Only the payload length is QUICHE_DCHECK'd in the constructor, so we need
+ // to make sure it is a "uint24".
uint32_t payload_length = random.Rand32() & 0xffffff;
Http2FrameType type = static_cast<Http2FrameType>(frame_type);
uint8_t flags = random.Rand8();
diff --git a/http2/platform/api/http2_logging.h b/http2/platform/api/http2_logging.h
index d73c49c..80ced05 100644
--- a/http2/platform/api/http2_logging.h
+++ b/http2/platform/api/http2_logging.h
@@ -1,24 +1,21 @@
#ifndef QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
#define QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
-#include "net/http2/platform/impl/http2_logging_impl.h"
+#include "common/platform/api/quiche_logging.h"
-#define HTTP2_LOG(severity) HTTP2_LOG_IMPL(severity)
+#define HTTP2_LOG(severity) QUICHE_LOG(severity)
-#define HTTP2_VLOG(verbose_level) HTTP2_VLOG_IMPL(verbose_level)
+#define HTTP2_VLOG(verbose_level) QUICHE_VLOG(verbose_level)
-#define HTTP2_DLOG(severity) HTTP2_DLOG_IMPL(severity)
+#define HTTP2_DLOG(severity) QUICHE_DLOG(severity)
-#define HTTP2_DLOG_IF(severity, condition) \
- HTTP2_DLOG_IF_IMPL(severity, condition)
+#define HTTP2_DLOG_IF(severity, condition) QUICHE_DLOG_IF(severity, condition)
-#define HTTP2_DVLOG(verbose_level) HTTP2_DVLOG_IMPL(verbose_level)
+#define HTTP2_DVLOG(verbose_level) QUICHE_DVLOG(verbose_level)
#define HTTP2_DVLOG_IF(verbose_level, condition) \
- HTTP2_DVLOG_IF_IMPL(verbose_level, condition)
+ QUICHE_DVLOG_IF(verbose_level, condition)
-#define HTTP2_DLOG_EVERY_N(severity, n) HTTP2_DLOG_EVERY_N_IMPL(severity, n)
-
-#define HTTP2_LOG_FIRST_N(severity, n) HTTP2_LOG_FIRST_N_IMPL(severity, n)
+#define HTTP2_LOG_FIRST_N(severity, n) QUICHE_LOG_FIRST_N(severity, n)
#endif // QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
diff --git a/http2/test_tools/frame_parts_collector.cc b/http2/test_tools/frame_parts_collector.cc
index 1be03e3..6f02eb6 100644
--- a/http2/test_tools/frame_parts_collector.cc
+++ b/http2/test_tools/frame_parts_collector.cc
@@ -26,7 +26,7 @@
if (n < size()) {
return collected_frames_.at(n).get();
}
- CHECK(n == size());
+ QUICHE_CHECK(n == size());
return current_frame();
}
diff --git a/http2/test_tools/http2_random.cc b/http2/test_tools/http2_random.cc
index ce1b93b..c9a071d 100644
--- a/http2/test_tools/http2_random.cc
+++ b/http2/test_tools/http2_random.cc
@@ -18,7 +18,7 @@
Http2Random::Http2Random(absl::string_view key) {
std::string decoded_key = Http2HexDecode(key);
- CHECK_EQ(sizeof(key_), decoded_key.size());
+ QUICHE_CHECK_EQ(sizeof(key_), decoded_key.size());
memcpy(key_, decoded_key.data(), sizeof(key_));
}
diff --git a/http2/tools/http2_frame_builder.h b/http2/tools/http2_frame_builder.h
index a40e46d..52f6350 100644
--- a/http2/tools/http2_frame_builder.h
+++ b/http2/tools/http2_frame_builder.h
@@ -11,7 +11,7 @@
// For now, this is only intended for use in tests, and thus has EXPECT* in the
// code. If desired to use it in an encoder, it will need optimization work,
// especially w.r.t memory mgmt, and the EXPECT* will need to be removed or
-// replaced with DCHECKs.
+// replaced with QUICHE_DCHECKs.
#include <stddef.h> // for size_t
diff --git a/http2/tools/random_decoder_test.cc b/http2/tools/random_decoder_test.cc
index 8230fe3..08f7a60 100644
--- a/http2/tools/random_decoder_test.cc
+++ b/http2/tools/random_decoder_test.cc
@@ -151,7 +151,7 @@
size_t remaining) -> size_t {
uint32_t r = random_.Rand32();
if (first && return_non_zero_on_first) {
- CHECK_LT(0u, remaining);
+ QUICHE_CHECK_LT(0u, remaining);
if (remaining == 1) {
return 1;
}