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))