Make SPDY logging use QUICHE logging
Also replace (D)CHECK with QUICHE_(D)CHECK.
PiperOrigin-RevId: 355027342
Change-Id: I34991423c2679c0f045aba870509dfa57674f556
diff --git a/spdy/core/hpack/hpack_constants.cc b/spdy/core/hpack/hpack_constants.cc
index d65680f..231fd54 100644
--- a/spdy/core/hpack/hpack_constants.cc
+++ b/spdy/core/hpack/hpack_constants.cc
@@ -365,7 +365,7 @@
auto* table = new HpackStaticTable();
table->Initialize(HpackStaticTableVector().data(),
HpackStaticTableVector().size());
- CHECK(table->IsInitialized());
+ QUICHE_CHECK(table->IsInitialized());
return table;
}();
return *shared_static_table;
diff --git a/spdy/core/hpack/hpack_decoder_adapter.cc b/spdy/core/hpack/hpack_decoder_adapter.cc
index 3d26543..59ba669 100644
--- a/spdy/core/hpack/hpack_decoder_adapter.cc
+++ b/spdy/core/hpack/hpack_decoder_adapter.cc
@@ -35,7 +35,7 @@
void HpackDecoderAdapter::HandleControlFrameHeadersStart(
SpdyHeadersHandlerInterface* handler) {
SPDY_DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersStart";
- DCHECK(!header_block_started_);
+ QUICHE_DCHECK(!header_block_started_);
listener_adapter_.set_handler(handler);
}
@@ -60,7 +60,7 @@
// headers_data_length==0, in which case we need to avoid creating
// a DecodeBuffer, which would otherwise complain.
if (headers_data_length > 0) {
- DCHECK_NE(headers_data, nullptr);
+ QUICHE_DCHECK_NE(headers_data, nullptr);
if (headers_data_length > max_decode_buffer_size_bytes_) {
SPDY_DVLOG(1) << "max_decode_buffer_size_bytes_ < headers_data_length: "
<< max_decode_buffer_size_bytes_ << " < "
@@ -78,7 +78,7 @@
}
http2::DecodeBuffer db(headers_data, headers_data_length);
bool ok = hpack_decoder_.DecodeFragment(&db);
- DCHECK(!ok || db.Empty()) << "Remaining=" << db.Remaining();
+ QUICHE_DCHECK(!ok || db.Empty()) << "Remaining=" << db.Remaining();
if (!ok) {
error_ = hpack_decoder_.error();
detailed_error_ = hpack_decoder_.detailed_error();
diff --git a/spdy/core/hpack/hpack_header_table.cc b/spdy/core/hpack/hpack_header_table.cc
index 773de29..4dac492 100644
--- a/spdy/core/hpack/hpack_header_table.cc
+++ b/spdy/core/hpack/hpack_header_table.cc
@@ -114,12 +114,12 @@
}
void HpackHeaderTable::SetMaxSize(size_t max_size) {
- CHECK_LE(max_size, settings_size_bound_);
+ QUICHE_CHECK_LE(max_size, settings_size_bound_);
max_size_ = max_size;
if (size_ > max_size_) {
Evict(EvictionCountToReclaim(size_ - max_size_));
- CHECK_LE(size_, max_size_);
+ QUICHE_CHECK_LE(size_, max_size_);
}
}
@@ -160,12 +160,12 @@
void HpackHeaderTable::Evict(size_t count) {
for (size_t i = 0; i != count; ++i) {
- CHECK(!dynamic_entries_.empty());
+ QUICHE_CHECK(!dynamic_entries_.empty());
HpackEntry* entry = &dynamic_entries_.back();
size_ -= entry->Size();
auto it = dynamic_index_.find(entry);
- DCHECK(it != dynamic_index_.end());
+ QUICHE_DCHECK(it != dynamic_index_.end());
// Only remove an entry from the index if its insertion index matches;
// otherwise, the index refers to another entry with the same name and
// value.
@@ -173,7 +173,7 @@
dynamic_index_.erase(it);
}
auto name_it = dynamic_name_index_.find(entry->name());
- DCHECK(name_it != dynamic_name_index_.end());
+ QUICHE_DCHECK(name_it != dynamic_name_index_.end());
// Only remove an entry from the literal index if its insertion index
/// matches; otherwise, the index refers to another entry with the same
// name.
@@ -191,8 +191,8 @@
size_t entry_size = HpackEntry::Size(name, value);
if (entry_size > (max_size_ - size_)) {
// Entire table has been emptied, but there's still insufficient room.
- DCHECK(dynamic_entries_.empty());
- DCHECK_EQ(0u, size_);
+ QUICHE_DCHECK(dynamic_entries_.empty());
+ QUICHE_DCHECK_EQ(0u, size_);
return nullptr;
}
dynamic_entries_.push_front(HpackEntry(name, value,
@@ -206,10 +206,10 @@
SPDY_DVLOG(1) << "Found existing entry: "
<< (*index_result.first)->GetDebugString()
<< " replacing with: " << new_entry->GetDebugString();
- DCHECK_GT(new_entry->InsertionIndex(),
- (*index_result.first)->InsertionIndex());
+ QUICHE_DCHECK_GT(new_entry->InsertionIndex(),
+ (*index_result.first)->InsertionIndex());
dynamic_index_.erase(index_result.first);
- CHECK(dynamic_index_.insert(new_entry).second);
+ QUICHE_CHECK(dynamic_index_.insert(new_entry).second);
}
auto name_result =
@@ -220,12 +220,12 @@
SPDY_DVLOG(1) << "Found existing entry: "
<< name_result.first->second->GetDebugString()
<< " replacing with: " << new_entry->GetDebugString();
- DCHECK_GT(new_entry->InsertionIndex(),
- name_result.first->second->InsertionIndex());
+ QUICHE_DCHECK_GT(new_entry->InsertionIndex(),
+ name_result.first->second->InsertionIndex());
dynamic_name_index_.erase(name_result.first);
auto insert_result = dynamic_name_index_.insert(
std::make_pair(new_entry->name(), new_entry));
- CHECK(insert_result.second);
+ QUICHE_CHECK(insert_result.second);
}
size_ += entry_size;
diff --git a/spdy/core/hpack/hpack_output_stream.cc b/spdy/core/hpack/hpack_output_stream.cc
index 8a7debd..d2ec46c 100644
--- a/spdy/core/hpack/hpack_output_stream.cc
+++ b/spdy/core/hpack/hpack_output_stream.cc
@@ -16,13 +16,13 @@
HpackOutputStream::~HpackOutputStream() = default;
void HpackOutputStream::AppendBits(uint8_t bits, size_t bit_size) {
- DCHECK_GT(bit_size, 0u);
- DCHECK_LE(bit_size, 8u);
- DCHECK_EQ(bits >> bit_size, 0);
+ QUICHE_DCHECK_GT(bit_size, 0u);
+ QUICHE_DCHECK_LE(bit_size, 8u);
+ QUICHE_DCHECK_EQ(bits >> bit_size, 0);
size_t new_bit_offset = bit_offset_ + bit_size;
if (bit_offset_ == 0) {
// Buffer ends on a byte boundary.
- DCHECK_LE(bit_size, 8u);
+ QUICHE_DCHECK_LE(bit_size, 8u);
buffer_.append(1, bits << (8 - bit_size));
} else if (new_bit_offset <= 8) {
// Buffer does not end on a byte boundary but the given bits fit
@@ -42,7 +42,7 @@
}
void HpackOutputStream::AppendBytes(absl::string_view buffer) {
- DCHECK_EQ(bit_offset_, 0u);
+ QUICHE_DCHECK_EQ(bit_offset_, 0u);
buffer_.append(buffer.data(), buffer.size());
}
@@ -61,18 +61,18 @@
}
AppendBits(static_cast<uint8_t>(I), 8);
}
- DCHECK_EQ(bit_offset_, 0u);
+ QUICHE_DCHECK_EQ(bit_offset_, 0u);
}
std::string* HpackOutputStream::MutableString() {
- DCHECK_EQ(bit_offset_, 0u);
+ QUICHE_DCHECK_EQ(bit_offset_, 0u);
return &buffer_;
}
void HpackOutputStream::TakeString(std::string* output) {
// This must hold, since all public functions cause the buffer to
// end on a byte boundary.
- DCHECK_EQ(bit_offset_, 0u);
+ QUICHE_DCHECK_EQ(bit_offset_, 0u);
buffer_.swap(*output);
buffer_.clear();
bit_offset_ = 0;
diff --git a/spdy/core/hpack/hpack_static_table.cc b/spdy/core/hpack/hpack_static_table.cc
index bbe7aad..809bc82 100644
--- a/spdy/core/hpack/hpack_static_table.cc
+++ b/spdy/core/hpack/hpack_static_table.cc
@@ -18,7 +18,7 @@
void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table,
size_t static_entry_count) {
- CHECK(!IsInitialized());
+ QUICHE_CHECK(!IsInitialized());
int total_insertions = 0;
for (const HpackStaticEntry* it = static_entry_table;
@@ -29,7 +29,7 @@
true, // is_static
total_insertions));
HpackEntry* entry = &static_entries_.back();
- CHECK(static_index_.insert(entry).second);
+ QUICHE_CHECK(static_index_.insert(entry).second);
// Multiple static entries may have the same name, so inserts may fail.
static_name_index_.insert(std::make_pair(entry->name(), entry));
diff --git a/spdy/core/http2_frame_decoder_adapter.cc b/spdy/core/http2_frame_decoder_adapter.cc
index 376c3c1..c275422 100644
--- a/spdy/core/http2_frame_decoder_adapter.cc
+++ b/spdy/core/http2_frame_decoder_adapter.cc
@@ -79,7 +79,7 @@
header->payload_length = 0x1010dead;
// An unsupported frame type.
header->type = Http2FrameType(0x80);
- DCHECK(!IsSupportedHttp2FrameType(header->type));
+ QUICHE_DCHECK(!IsSupportedHttp2FrameType(header->type));
// Frame flag bits that aren't used by any supported frame type.
header->flags = Http2FrameFlag(0xd2);
// A stream id with the reserved high-bit (R in the RFC) set.
@@ -300,9 +300,9 @@
// We had some data, and weren't in an error state, so should have
// processed/consumed at least one byte of it, even if we then ended up
// in an error state.
- DCHECK(processed > 0) << "processed=" << processed
- << " spdy_state_=" << spdy_state_
- << " spdy_framer_error_=" << spdy_framer_error_;
+ QUICHE_DCHECK(processed > 0)
+ << "processed=" << processed << " spdy_state_=" << spdy_state_
+ << " spdy_framer_error_=" << spdy_framer_error_;
data += processed;
len -= processed;
@@ -433,15 +433,15 @@
void Http2DecoderAdapter::OnDataPayload(const char* data, size_t len) {
SPDY_DVLOG(1) << "OnDataPayload: len=" << len;
- DCHECK(has_frame_header_);
- DCHECK_EQ(frame_header_.type, Http2FrameType::DATA);
+ QUICHE_DCHECK(has_frame_header_);
+ QUICHE_DCHECK_EQ(frame_header_.type, Http2FrameType::DATA);
visitor()->OnStreamFrameData(frame_header().stream_id, data, len);
}
void Http2DecoderAdapter::OnDataEnd() {
SPDY_DVLOG(1) << "OnDataEnd";
- DCHECK(has_frame_header_);
- DCHECK_EQ(frame_header_.type, Http2FrameType::DATA);
+ QUICHE_DCHECK(has_frame_header_);
+ QUICHE_DCHECK_EQ(frame_header_.type, Http2FrameType::DATA);
if (frame_header().IsEndStream()) {
visitor()->OnStreamEnd(frame_header().stream_id);
}
@@ -473,10 +473,10 @@
void Http2DecoderAdapter::OnHeadersPriority(
const Http2PriorityFields& priority) {
SPDY_DVLOG(1) << "OnHeadersPriority: " << priority;
- DCHECK(has_frame_header_);
- DCHECK_EQ(frame_type(), Http2FrameType::HEADERS) << frame_header_;
- DCHECK(frame_header_.HasPriority());
- DCHECK(!on_headers_called_);
+ QUICHE_DCHECK(has_frame_header_);
+ QUICHE_DCHECK_EQ(frame_type(), Http2FrameType::HEADERS) << frame_header_;
+ QUICHE_DCHECK(frame_header_.HasPriority());
+ QUICHE_DCHECK(!on_headers_called_);
on_headers_called_ = true;
ReportReceiveCompressedFrame(frame_header_);
if (!visitor()) {
@@ -520,7 +520,7 @@
void Http2DecoderAdapter::OnContinuationStart(const Http2FrameHeader& header) {
SPDY_DVLOG(1) << "OnContinuationStart: " << header;
if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) {
- DCHECK(has_hpack_first_frame_header_);
+ QUICHE_DCHECK(has_hpack_first_frame_header_);
if (header.stream_id != hpack_first_frame_header_.stream_id) {
SetSpdyErrorAndNotify(SpdyFramerError::SPDY_UNEXPECTED_FRAME, "");
return;
@@ -540,7 +540,7 @@
void Http2DecoderAdapter::OnPadLength(size_t trailing_length) {
SPDY_DVLOG(1) << "OnPadLength: " << trailing_length;
opt_pad_length_ = trailing_length;
- DCHECK_LT(trailing_length, 256u);
+ QUICHE_DCHECK_LT(trailing_length, 256u);
if (frame_header_.type == Http2FrameType::DATA) {
visitor()->OnStreamPadLength(stream_id(), trailing_length);
}
@@ -777,7 +777,7 @@
<< "; missing_length: " << missing_length;
if (header.type == Http2FrameType::DATA) {
if (header.payload_length == 0) {
- DCHECK_EQ(1u, missing_length);
+ QUICHE_DCHECK_EQ(1u, missing_length);
SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_DATA_FRAME_FLAGS, "");
return;
}
@@ -812,7 +812,7 @@
// Decodes the input up to the next frame boundary (i.e. at most one frame),
// stopping early if an error is detected.
size_t Http2DecoderAdapter::ProcessInputFrame(const char* data, size_t len) {
- DCHECK_NE(spdy_state_, SpdyState::SPDY_ERROR);
+ QUICHE_DCHECK_NE(spdy_state_, SpdyState::SPDY_ERROR);
DecodeBuffer db(data, len);
DecodeStatus status = frame_decoder_->DecodeFrame(&db);
if (spdy_state_ != SpdyState::SPDY_ERROR) {
@@ -845,8 +845,8 @@
// detected an error condition), because otherwise we assume that the callback
// method has set spdy_framer_error_ appropriately.
void Http2DecoderAdapter::DetermineSpdyState(DecodeStatus status) {
- DCHECK_EQ(spdy_framer_error_, SPDY_NO_ERROR);
- DCHECK(!HasError()) << spdy_framer_error_;
+ QUICHE_DCHECK_EQ(spdy_framer_error_, SPDY_NO_ERROR);
+ QUICHE_DCHECK(!HasError()) << spdy_framer_error_;
switch (status) {
case DecodeStatus::kDecodeDone:
SPDY_DVLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeDone";
@@ -935,11 +935,11 @@
void Http2DecoderAdapter::SetSpdyErrorAndNotify(SpdyFramerError error,
std::string detailed_error) {
if (HasError()) {
- DCHECK_EQ(spdy_state_, SpdyState::SPDY_ERROR);
+ QUICHE_DCHECK_EQ(spdy_state_, SpdyState::SPDY_ERROR);
} else {
SPDY_VLOG(2) << "SetSpdyErrorAndNotify(" << SpdyFramerErrorToString(error)
<< ")";
- DCHECK_NE(error, SpdyFramerError::SPDY_NO_ERROR);
+ QUICHE_DCHECK_NE(error, SpdyFramerError::SPDY_NO_ERROR);
spdy_framer_error_ = error;
set_spdy_state(SpdyState::SPDY_ERROR);
frame_decoder_->set_listener(&no_op_listener_);
@@ -949,16 +949,16 @@
bool Http2DecoderAdapter::HasError() const {
if (spdy_state_ == SpdyState::SPDY_ERROR) {
- DCHECK_NE(spdy_framer_error(), SpdyFramerError::SPDY_NO_ERROR);
+ QUICHE_DCHECK_NE(spdy_framer_error(), SpdyFramerError::SPDY_NO_ERROR);
return true;
} else {
- DCHECK_EQ(spdy_framer_error(), SpdyFramerError::SPDY_NO_ERROR);
+ QUICHE_DCHECK_EQ(spdy_framer_error(), SpdyFramerError::SPDY_NO_ERROR);
return false;
}
}
const Http2FrameHeader& Http2DecoderAdapter::frame_header() const {
- DCHECK(has_frame_header_);
+ QUICHE_DCHECK(has_frame_header_);
return frame_header_;
}
@@ -971,7 +971,7 @@
}
size_t Http2DecoderAdapter::remaining_total_payload() const {
- DCHECK(has_frame_header_);
+ QUICHE_DCHECK(has_frame_header_);
size_t remaining = frame_decoder_->remaining_payload();
if (IsPaddable(frame_type()) && frame_header_.IsPadded()) {
remaining += frame_decoder_->remaining_padding();
@@ -1004,7 +1004,7 @@
SPDY_VLOG(2) << "HasError()";
return false;
}
- DCHECK(!has_frame_header_);
+ QUICHE_DCHECK(!has_frame_header_);
if (has_expected_frame_type_ && header.type != expected_frame_type_) {
SPDY_VLOG(1) << "Expected frame type " << expected_frame_type_ << ", not "
<< header.type;
@@ -1070,7 +1070,7 @@
void Http2DecoderAdapter::CommonStartHpackBlock() {
SPDY_DVLOG(1) << "CommonStartHpackBlock";
- DCHECK(!has_hpack_first_frame_header_);
+ QUICHE_DCHECK(!has_hpack_first_frame_header_);
if (!frame_header_.IsEndHeaders()) {
hpack_first_frame_header_ = frame_header_;
has_hpack_first_frame_header_ = true;
@@ -1093,7 +1093,7 @@
void Http2DecoderAdapter::MaybeAnnounceEmptyFirstHpackFragment() {
if (!on_hpack_fragment_called_) {
OnHpackFragment(nullptr, 0);
- DCHECK(on_hpack_fragment_called_);
+ QUICHE_DCHECK(on_hpack_fragment_called_);
}
}
@@ -1103,11 +1103,11 @@
SPDY_VLOG(1) << "HasError(), returning";
return;
}
- DCHECK(has_frame_header_);
+ QUICHE_DCHECK(has_frame_header_);
MaybeAnnounceEmptyFirstHpackFragment();
if (frame_header_.IsEndHeaders()) {
- DCHECK_EQ(has_hpack_first_frame_header_,
- frame_type() == Http2FrameType::CONTINUATION)
+ QUICHE_DCHECK_EQ(has_hpack_first_frame_header_,
+ frame_type() == Http2FrameType::CONTINUATION)
<< frame_header();
has_expected_frame_type_ = false;
auto* decoder = GetHpackDecoder();
@@ -1127,7 +1127,7 @@
has_hpack_first_frame_header_ = false;
CorruptFrameHeader(&hpack_first_frame_header_);
} else {
- DCHECK(has_hpack_first_frame_header_);
+ QUICHE_DCHECK(has_hpack_first_frame_header_);
has_expected_frame_type_ = true;
expected_frame_type_ = Http2FrameType::CONTINUATION;
}
diff --git a/spdy/core/http2_priority_write_scheduler.h b/spdy/core/http2_priority_write_scheduler.h
index 729dfce..2486453 100644
--- a/spdy/core/http2_priority_write_scheduler.h
+++ b/spdy/core/http2_priority_write_scheduler.h
@@ -253,7 +253,7 @@
child->parent = new_stream_info_ptr;
}
// Clear parent's old child data.
- DCHECK(parent->children.empty());
+ QUICHE_DCHECK(parent->children.empty());
parent->total_child_weights = 0;
}
// Add new stream to parent.
@@ -265,7 +265,7 @@
UpdatePrioritiesUnder(parent);
// Stream starts with ready == false, so no need to schedule it yet.
- DCHECK(!new_stream_info_ptr->ready);
+ QUICHE_DCHECK(!new_stream_info_ptr->ready);
}
template <typename StreamIdType>
@@ -630,7 +630,7 @@
template <typename StreamIdType>
void Http2PriorityWriteScheduler<StreamIdType>::Schedule(
StreamInfo* stream_info) {
- DCHECK(!stream_info->ready);
+ QUICHE_DCHECK(!stream_info->ready);
for (StreamInfo& s : scheduling_queue_) {
if (stream_info->SchedulesBefore(s)) {
scheduling_queue_.insert(&s, stream_info);
@@ -645,7 +645,7 @@
template <typename StreamIdType>
void Http2PriorityWriteScheduler<StreamIdType>::Unschedule(
StreamInfo* stream_info) {
- DCHECK(stream_info->ready);
+ QUICHE_DCHECK(stream_info->ready);
scheduling_queue_.erase(stream_info);
stream_info->ready = false;
}
@@ -782,7 +782,7 @@
}
// Validate the validation function; we should have visited each stream twice
// (except for the root)
- DCHECK(streams_visited == 2 * NumRegisteredStreams() - 1);
+ QUICHE_DCHECK(streams_visited == 2 * NumRegisteredStreams() - 1);
return true;
}
diff --git a/spdy/core/priority_write_scheduler.h b/spdy/core/priority_write_scheduler.h
index 642aa70..214b267b 100644
--- a/spdy/core/priority_write_scheduler.h
+++ b/spdy/core/priority_write_scheduler.h
@@ -81,7 +81,7 @@
if (stream_info.ready) {
bool erased =
Erase(&priority_infos_[stream_info.priority].ready_list, stream_info);
- DCHECK(erased);
+ QUICHE_DCHECK(erased);
}
stream_infos_.erase(it);
}
@@ -126,7 +126,7 @@
if (stream_info.ready) {
bool erased =
Erase(&priority_infos_[stream_info.priority].ready_list, stream_info);
- DCHECK(erased);
+ QUICHE_DCHECK(erased);
priority_infos_[new_priority].ready_list.push_back(&stream_info);
++num_ready_streams_;
}
@@ -179,7 +179,8 @@
ready_list.pop_front();
--num_ready_streams_;
- DCHECK(stream_infos_.find(info->stream_id) != stream_infos_.end());
+ QUICHE_DCHECK(stream_infos_.find(info->stream_id) !=
+ stream_infos_.end());
info->ready = false;
return std::make_tuple(info->stream_id,
StreamPrecedenceType(info->priority));
@@ -248,7 +249,7 @@
}
bool erased =
Erase(&priority_infos_[stream_info.priority].ready_list, stream_info);
- DCHECK(erased);
+ QUICHE_DCHECK(erased);
stream_info.ready = false;
}
diff --git a/spdy/core/spdy_alt_svc_wire_format.cc b/spdy/core/spdy_alt_svc_wire_format.cc
index d813f4d..4f6b4f3 100644
--- a/spdy/core/spdy_alt_svc_wire_format.cc
+++ b/spdy/core/spdy_alt_svc_wire_format.cc
@@ -85,7 +85,7 @@
return false;
}
// Parse alt-authority.
- DCHECK_EQ('=', *c);
+ QUICHE_DCHECK_EQ('=', *c);
++c;
if (c == value.end() || *c != '"') {
return false;
@@ -105,7 +105,7 @@
if (c == alt_authority_begin || c == value.end()) {
return false;
}
- DCHECK_EQ('"', *c);
+ QUICHE_DCHECK_EQ('"', *c);
std::string host;
uint16_t port;
if (!ParseAltAuthority(alt_authority_begin, c, &host, &port)) {
@@ -309,7 +309,7 @@
output->push_back(*c);
continue;
}
- DCHECK_EQ('%', *c);
+ QUICHE_DCHECK_EQ('%', *c);
++c;
if (c == end || !std::isxdigit(*c)) {
return false;
@@ -347,7 +347,7 @@
if (c == end) {
return false;
}
- DCHECK_EQ(']', *c);
+ QUICHE_DCHECK_EQ(']', *c);
host->push_back(*c);
++c;
} else {
@@ -368,7 +368,7 @@
if (c == end || *c != ':') {
return false;
}
- DCHECK_EQ(':', *c);
+ QUICHE_DCHECK_EQ(':', *c);
++c;
return ParsePositiveInteger16(c, end, port);
}
diff --git a/spdy/core/spdy_frame_builder.cc b/spdy/core/spdy_frame_builder.cc
index a3f1be1..5c93128 100644
--- a/spdy/core/spdy_frame_builder.cc
+++ b/spdy/core/spdy_frame_builder.cc
@@ -65,8 +65,8 @@
uint8_t flags,
SpdyStreamId stream_id) {
uint8_t raw_frame_type = SerializeFrameType(type);
- DCHECK(IsDefinedFrameType(raw_frame_type));
- DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
+ QUICHE_DCHECK(IsDefinedFrameType(raw_frame_type));
+ QUICHE_DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
bool success = true;
if (length_ > 0) {
SPDY_BUG << "SpdyFrameBuilder doesn't have a clean state when BeginNewFrame"
@@ -79,7 +79,7 @@
success &= WriteUInt8(raw_frame_type);
success &= WriteUInt8(flags);
success &= WriteUInt32(stream_id);
- DCHECK_EQ(kDataFrameMinimumSize, length_);
+ QUICHE_DCHECK_EQ(kDataFrameMinimumSize, length_);
return success;
}
@@ -88,8 +88,8 @@
SpdyStreamId stream_id,
size_t length) {
uint8_t raw_frame_type = SerializeFrameType(type);
- DCHECK(IsDefinedFrameType(raw_frame_type));
- DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
+ QUICHE_DCHECK(IsDefinedFrameType(raw_frame_type));
+ QUICHE_DCHECK_EQ(0u, stream_id & ~kStreamIdMask);
SPDY_BUG_IF(length > kHttp2DefaultFramePayloadLimit)
<< "Frame length " << length_ << " is longer than frame size limit.";
return BeginNewFrameInternal(raw_frame_type, flags, stream_id, length);
@@ -106,7 +106,7 @@
uint8_t flags,
SpdyStreamId stream_id,
size_t length) {
- DCHECK_EQ(length, length & kLengthMask);
+ QUICHE_DCHECK_EQ(length, length & kLengthMask);
bool success = true;
offset_ += length_;
@@ -116,7 +116,7 @@
success &= WriteUInt8(raw_frame_type);
success &= WriteUInt8(flags);
success &= WriteUInt32(stream_id);
- DCHECK_EQ(kDataFrameMinimumSize, length_);
+ QUICHE_DCHECK_EQ(kDataFrameMinimumSize, length_);
return success;
}
@@ -161,7 +161,7 @@
bool SpdyFrameBuilder::CanWrite(size_t length) const {
if (length > kLengthMask) {
- DCHECK(false);
+ QUICHE_DCHECK(false);
return false;
}
diff --git a/spdy/core/spdy_framer.cc b/spdy/core/spdy_framer.cc
index b70f796..22d3fff 100644
--- a/spdy/core/spdy_framer.cc
+++ b/spdy/core/spdy_framer.cc
@@ -105,7 +105,7 @@
bool ret = builder.BeginNewFrame(
SpdyFrameType::HEADERS, SerializeHeaderFrameFlags(headers, end_headers),
headers.stream_id(), frame_size - kFrameHeaderSize);
- DCHECK_EQ(kFrameHeaderSize, builder.length());
+ QUICHE_DCHECK_EQ(kFrameHeaderSize, builder.length());
if (ret && headers.padded()) {
ret &= builder.WriteUInt8(headers.padding_payload_len());
@@ -449,7 +449,7 @@
std::string padding(data_ir.padding_payload_len(), 0);
builder.WriteBytes(padding.data(), padding.length());
}
- DCHECK_EQ(size_with_padding, builder.length());
+ QUICHE_DCHECK_EQ(size_with_padding, builder.length());
return builder.take();
}
@@ -468,7 +468,7 @@
if (data_ir.padded()) {
builder.WriteUInt8(data_ir.padding_payload_len() & 0xff);
}
- DCHECK_EQ(frame_size, builder.length());
+ QUICHE_DCHECK_EQ(frame_size, builder.length());
return builder.take();
}
@@ -481,7 +481,7 @@
builder.WriteUInt32(rst_stream.error_code());
- DCHECK_EQ(expected_length, builder.length());
+ QUICHE_DCHECK_EQ(expected_length, builder.length());
return builder.take();
}
@@ -500,14 +500,14 @@
return builder.take();
}
- DCHECK_EQ(kSettingsFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kSettingsFrameMinimumSize, builder.length());
for (auto it = values->begin(); it != values->end(); ++it) {
int setting_id = it->first;
- DCHECK_GE(setting_id, 0);
+ QUICHE_DCHECK_GE(setting_id, 0);
builder.WriteUInt16(static_cast<SpdySettingsId>(setting_id));
builder.WriteUInt32(it->second);
}
- DCHECK_EQ(size, builder.length());
+ QUICHE_DCHECK_EQ(size, builder.length());
return builder.take();
}
@@ -519,7 +519,7 @@
}
builder.BeginNewFrame(SpdyFrameType::PING, flags, 0);
builder.WriteUInt64(ping.id());
- DCHECK_EQ(kPingFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kPingFrameSize, builder.length());
return builder.take();
}
@@ -545,7 +545,7 @@
goaway.description().size());
}
- DCHECK_EQ(expected_length, builder.length());
+ QUICHE_DCHECK_EQ(expected_length, builder.length());
return builder.take();
}
@@ -618,7 +618,7 @@
builder.BeginNewFrame(SpdyFrameType::HEADERS, flags, headers.stream_id(),
length_field);
- DCHECK_EQ(kHeadersFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kHeadersFrameMinimumSize, builder.length());
int padding_payload_len = 0;
if (headers.padded()) {
@@ -651,7 +651,7 @@
builder.BeginNewFrame(SpdyFrameType::WINDOW_UPDATE, kNoFlags,
window_update.stream_id());
builder.WriteUInt32(window_update.delta());
- DCHECK_EQ(kWindowUpdateFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kWindowUpdateFrameSize, builder.length());
return builder.take();
}
@@ -699,13 +699,13 @@
if (push_promise.padded()) {
builder.WriteUInt8(push_promise.padding_payload_len());
builder.WriteUInt32(push_promise.promised_stream_id());
- DCHECK_EQ(kPushPromiseFrameMinimumSize + kPadLengthFieldSize,
- builder.length());
+ QUICHE_DCHECK_EQ(kPushPromiseFrameMinimumSize + kPadLengthFieldSize,
+ builder.length());
padding_payload_len = push_promise.padding_payload_len();
} else {
builder.WriteUInt32(push_promise.promised_stream_id());
- DCHECK_EQ(kPushPromiseFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kPushPromiseFrameMinimumSize, builder.length());
}
WritePayloadWithContinuation(
@@ -731,7 +731,7 @@
uint8_t flags = continuation.end_headers() ? HEADERS_FLAG_END_HEADERS : 0;
builder.BeginNewFrame(SpdyFrameType::CONTINUATION, flags,
continuation.stream_id());
- DCHECK_EQ(kFrameHeaderSize, builder.length());
+ QUICHE_DCHECK_EQ(kFrameHeaderSize, builder.length());
builder.WriteBytes(encoding.data(), encoding.size());
return builder.take();
@@ -747,7 +747,7 @@
builder.WriteUInt16(altsvc_ir.origin().length());
builder.WriteBytes(altsvc_ir.origin().data(), altsvc_ir.origin().length());
builder.WriteBytes(value.data(), value.length());
- DCHECK_LT(kGetAltSvcFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_LT(kGetAltSvcFrameMinimumSize, builder.length());
return builder.take();
}
@@ -761,7 +761,7 @@
priority.parent_stream_id()));
// Per RFC 7540 section 6.3, serialized weight value is actual value - 1.
builder.WriteUInt8(priority.weight() - 1);
- DCHECK_EQ(kPriorityFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kPriorityFrameSize, builder.length());
return builder.take();
}
@@ -776,7 +776,7 @@
builder.WriteUInt32(priority_update.prioritized_stream_id());
builder.WriteBytes(priority_update.priority_field_value().data(),
priority_update.priority_field_value().size());
- DCHECK_EQ(total_size, builder.length());
+ QUICHE_DCHECK_EQ(total_size, builder.length());
return builder.take();
}
@@ -970,7 +970,7 @@
padding = std::string(data_ir.padding_payload_len(), 0);
ok = ok && builder.WriteBytes(padding.data(), padding.length());
}
- DCHECK_EQ(size_with_padding, builder.length());
+ QUICHE_DCHECK_EQ(size_with_padding, builder.length());
return ok;
}
@@ -992,7 +992,7 @@
if (data_ir.padded()) {
ok = ok && builder.WriteUInt8(data_ir.padding_payload_len() & 0xff);
}
- DCHECK_EQ(frame_size, builder.length());
+ QUICHE_DCHECK_EQ(frame_size, builder.length());
return ok;
}
@@ -1004,7 +1004,7 @@
rst_stream.stream_id());
ok = ok && builder.WriteUInt32(rst_stream.error_code());
- DCHECK_EQ(expected_length, builder.length());
+ QUICHE_DCHECK_EQ(expected_length, builder.length());
return ok;
}
@@ -1023,14 +1023,14 @@
return ok;
}
- DCHECK_EQ(kSettingsFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kSettingsFrameMinimumSize, builder.length());
for (auto it = values->begin(); it != values->end(); ++it) {
int setting_id = it->first;
- DCHECK_GE(setting_id, 0);
+ QUICHE_DCHECK_GE(setting_id, 0);
ok = ok && builder.WriteUInt16(static_cast<SpdySettingsId>(setting_id)) &&
builder.WriteUInt32(it->second);
}
- DCHECK_EQ(size, builder.length());
+ QUICHE_DCHECK_EQ(size, builder.length());
return ok;
}
@@ -1043,7 +1043,7 @@
}
bool ok = builder.BeginNewFrame(SpdyFrameType::PING, flags, 0);
ok = ok && builder.WriteUInt64(ping.id());
- DCHECK_EQ(kPingFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kPingFrameSize, builder.length());
return ok;
}
@@ -1068,7 +1068,7 @@
goaway.description().size());
}
- DCHECK_EQ(expected_length, builder.length());
+ QUICHE_DCHECK_EQ(expected_length, builder.length());
return ok;
}
@@ -1088,7 +1088,7 @@
SpdyFrameBuilder builder(size, output);
ok = ok && builder.BeginNewFrame(SpdyFrameType::HEADERS, flags,
headers.stream_id(), length_field);
- DCHECK_EQ(kHeadersFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kHeadersFrameMinimumSize, builder.length());
int padding_payload_len = 0;
if (headers.padded()) {
@@ -1123,7 +1123,7 @@
bool ok = builder.BeginNewFrame(SpdyFrameType::WINDOW_UPDATE, kNoFlags,
window_update.stream_id());
ok = ok && builder.WriteUInt32(window_update.delta());
- DCHECK_EQ(kWindowUpdateFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kWindowUpdateFrameSize, builder.length());
return ok;
}
@@ -1146,13 +1146,13 @@
if (push_promise.padded()) {
ok = ok && builder.WriteUInt8(push_promise.padding_payload_len()) &&
builder.WriteUInt32(push_promise.promised_stream_id());
- DCHECK_EQ(kPushPromiseFrameMinimumSize + kPadLengthFieldSize,
- builder.length());
+ QUICHE_DCHECK_EQ(kPushPromiseFrameMinimumSize + kPadLengthFieldSize,
+ builder.length());
padding_payload_len = push_promise.padding_payload_len();
} else {
ok = ok && builder.WriteUInt32(push_promise.promised_stream_id());
- DCHECK_EQ(kPushPromiseFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_EQ(kPushPromiseFrameMinimumSize, builder.length());
}
ok = ok && WritePayloadWithContinuation(
@@ -1179,7 +1179,7 @@
bool ok = builder.BeginNewFrame(SpdyFrameType::CONTINUATION, flags,
continuation.stream_id(),
frame_size - kFrameHeaderSize);
- DCHECK_EQ(kFrameHeaderSize, builder.length());
+ QUICHE_DCHECK_EQ(kFrameHeaderSize, builder.length());
ok = ok && builder.WriteBytes(encoding.data(), encoding.size());
return ok;
@@ -1197,7 +1197,7 @@
builder.WriteBytes(altsvc_ir.origin().data(),
altsvc_ir.origin().length()) &&
builder.WriteBytes(value.data(), value.length());
- DCHECK_LT(kGetAltSvcFrameMinimumSize, builder.length());
+ QUICHE_DCHECK_LT(kGetAltSvcFrameMinimumSize, builder.length());
return ok;
}
@@ -1211,7 +1211,7 @@
priority.exclusive(), priority.parent_stream_id())) &&
// Per RFC 7540 section 6.3, serialized weight value is actual value - 1.
builder.WriteUInt8(priority.weight() - 1);
- DCHECK_EQ(kPriorityFrameSize, builder.length());
+ QUICHE_DCHECK_EQ(kPriorityFrameSize, builder.length());
return ok;
}
@@ -1227,7 +1227,7 @@
ok = ok && builder.WriteUInt32(priority_update.prioritized_stream_id());
ok = ok && builder.WriteBytes(priority_update.priority_field_value().data(),
priority_update.priority_field_value().size());
- DCHECK_EQ(total_size, builder.length());
+ QUICHE_DCHECK_EQ(total_size, builder.length());
return ok;
}
diff --git a/spdy/core/spdy_framer_test.cc b/spdy/core/spdy_framer_test.cc
index 3da8dbc..d913a05 100644
--- a/spdy/core/spdy_framer_test.cc
+++ b/spdy/core/spdy_framer_test.cc
@@ -322,7 +322,7 @@
}
void OnHeaderFrameEnd(SpdyStreamId /*stream_id*/) override {
- CHECK(headers_handler_ != nullptr);
+ QUICHE_CHECK(headers_handler_ != nullptr);
headers_ = headers_handler_->decoded_block().Clone();
header_bytes_received_ = headers_handler_->uncompressed_header_bytes();
headers_handler_.reset();
@@ -3158,46 +3158,56 @@
// Send the frame header.
EXPECT_CALL(visitor,
OnDataFrameHeader(1, kPaddingLen + strlen(data_payload), false));
- CHECK_EQ(kDataFrameMinimumSize,
- deframer_.ProcessInput(frame.data(), kDataFrameMinimumSize));
- CHECK_EQ(deframer_.state(),
- Http2DecoderAdapter::SPDY_READ_DATA_FRAME_PADDING_LENGTH);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(kDataFrameMinimumSize,
+ deframer_.ProcessInput(frame.data(), kDataFrameMinimumSize));
+ QUICHE_CHECK_EQ(deframer_.state(),
+ Http2DecoderAdapter::SPDY_READ_DATA_FRAME_PADDING_LENGTH);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
bytes_consumed += kDataFrameMinimumSize;
// Send the padding length field.
EXPECT_CALL(visitor, OnStreamPadLength(1, kPaddingLen - 1));
- CHECK_EQ(1u, deframer_.ProcessInput(frame.data() + bytes_consumed, 1));
- CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_FORWARD_STREAM_FRAME);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(1u, deframer_.ProcessInput(frame.data() + bytes_consumed, 1));
+ QUICHE_CHECK_EQ(deframer_.state(),
+ Http2DecoderAdapter::SPDY_FORWARD_STREAM_FRAME);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
bytes_consumed += 1;
// Send the first two bytes of the data payload, i.e., "he".
EXPECT_CALL(visitor, OnStreamFrameData(1, _, 2));
- CHECK_EQ(2u, deframer_.ProcessInput(frame.data() + bytes_consumed, 2));
- CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_FORWARD_STREAM_FRAME);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(2u, deframer_.ProcessInput(frame.data() + bytes_consumed, 2));
+ QUICHE_CHECK_EQ(deframer_.state(),
+ Http2DecoderAdapter::SPDY_FORWARD_STREAM_FRAME);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
bytes_consumed += 2;
// Send the rest three bytes of the data payload, i.e., "llo".
EXPECT_CALL(visitor, OnStreamFrameData(1, _, 3));
- CHECK_EQ(3u, deframer_.ProcessInput(frame.data() + bytes_consumed, 3));
- CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_CONSUME_PADDING);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(3u, deframer_.ProcessInput(frame.data() + bytes_consumed, 3));
+ QUICHE_CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_CONSUME_PADDING);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
bytes_consumed += 3;
// Send the first 100 bytes of the padding payload.
EXPECT_CALL(visitor, OnStreamPadding(1, 100));
- CHECK_EQ(100u, deframer_.ProcessInput(frame.data() + bytes_consumed, 100));
- CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_CONSUME_PADDING);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(100u,
+ deframer_.ProcessInput(frame.data() + bytes_consumed, 100));
+ QUICHE_CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_CONSUME_PADDING);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
bytes_consumed += 100;
// Send rest of the padding payload.
EXPECT_CALL(visitor, OnStreamPadding(1, 18));
- CHECK_EQ(18u, deframer_.ProcessInput(frame.data() + bytes_consumed, 18));
- CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_READY_FOR_FRAME);
- CHECK_EQ(deframer_.spdy_framer_error(), Http2DecoderAdapter::SPDY_NO_ERROR);
+ QUICHE_CHECK_EQ(18u,
+ deframer_.ProcessInput(frame.data() + bytes_consumed, 18));
+ QUICHE_CHECK_EQ(deframer_.state(), Http2DecoderAdapter::SPDY_READY_FOR_FRAME);
+ QUICHE_CHECK_EQ(deframer_.spdy_framer_error(),
+ Http2DecoderAdapter::SPDY_NO_ERROR);
}
TEST_P(SpdyFramerTest, ReadWindowUpdate) {
diff --git a/spdy/core/spdy_header_block.h b/spdy/core/spdy_header_block.h
index 5400c5f..123f506 100644
--- a/spdy/core/spdy_header_block.h
+++ b/spdy/core/spdy_header_block.h
@@ -15,6 +15,7 @@
#include "absl/strings/string_view.h"
#include "common/platform/api/quiche_export.h"
+#include "common/platform/api/quiche_logging.h"
#include "spdy/core/spdy_header_storage.h"
#include "spdy/platform/api/spdy_containers.h"
#include "spdy/platform/api/spdy_macros.h"
@@ -126,7 +127,7 @@
// fragments.
const_reference operator*() const {
#if SPDY_HEADER_DEBUG
- CHECK(!dereference_forbidden_);
+ QUICHE_CHECK(!dereference_forbidden_);
#endif // SPDY_HEADER_DEBUG
return it_->second.as_pair();
}
diff --git a/spdy/core/spdy_header_storage.cc b/spdy/core/spdy_header_storage.cc
index 6595da1..207a3be 100644
--- a/spdy/core/spdy_header_storage.cc
+++ b/spdy/core/spdy_header_storage.cc
@@ -34,7 +34,7 @@
}
char* dst = arena_.Alloc(total_size);
size_t written = Join(dst, fragments, separator);
- DCHECK_EQ(written, total_size);
+ QUICHE_DCHECK_EQ(written, total_size);
return absl::string_view(dst, total_size);
}
diff --git a/spdy/core/spdy_intrusive_list.h b/spdy/core/spdy_intrusive_list.h
index 16917f9..2d9f749 100644
--- a/spdy/core/spdy_intrusive_list.h
+++ b/spdy/core/spdy_intrusive_list.h
@@ -81,7 +81,7 @@
// list<int*> a;
// a.push_back(new int);
// list<int*> b(a);
-// CHECK(a.front() == b.front());
+// QUICHE_CHECK(a.front() == b.front());
//
// Note that SpdyIntrusiveList::size() runs in O(N) time.
diff --git a/spdy/core/spdy_prefixed_buffer_reader.cc b/spdy/core/spdy_prefixed_buffer_reader.cc
index 7a9faac..0cb07cf 100644
--- a/spdy/core/spdy_prefixed_buffer_reader.cc
+++ b/spdy/core/spdy_prefixed_buffer_reader.cc
@@ -41,7 +41,7 @@
prefix_length_ = 0;
// Fallthrough to suffix read.
}
- DCHECK(suffix_length_ >= count);
+ QUICHE_DCHECK(suffix_length_ >= count);
// Read is satisfied by the suffix.
std::copy(suffix_, suffix_ + count, out);
suffix_ += count;
@@ -72,7 +72,7 @@
ReadN(count, out->storage_.get());
return true;
} else {
- DCHECK(suffix_length_ >= count);
+ QUICHE_DCHECK(suffix_length_ >= count);
// Read is fully satisfied by the suffix.
out->buffer_ = suffix_;
suffix_ += count;
diff --git a/spdy/core/spdy_protocol.cc b/spdy/core/spdy_protocol.cc
index b455dfb..2d627d8 100644
--- a/spdy/core/spdy_protocol.cc
+++ b/spdy/core/spdy_protocol.cc
@@ -273,7 +273,7 @@
}
size_t GetNumberRequiredContinuationFrames(size_t size) {
- DCHECK_GT(size, kHttp2MaxControlFrameSendSize);
+ QUICHE_DCHECK_GT(size, kHttp2MaxControlFrameSendSize);
size_t overflow = size - kHttp2MaxControlFrameSendSize;
int payload_size =
kHttp2MaxControlFrameSendSize - kContinuationFrameMinimumSize;
diff --git a/spdy/core/spdy_protocol.h b/spdy/core/spdy_protocol.h
index ae33330..8d5d3d8 100644
--- a/spdy/core/spdy_protocol.h
+++ b/spdy/core/spdy_protocol.h
@@ -537,8 +537,8 @@
int padding_payload_len() const { return padding_payload_len_; }
void set_padding_len(int padding_len) {
- DCHECK_GT(padding_len, 0);
- DCHECK_LE(padding_len, kPaddingSizePerFrame);
+ QUICHE_DCHECK_GT(padding_len, 0);
+ QUICHE_DCHECK_LE(padding_len, kPaddingSizePerFrame);
padded_ = true;
// The pad field takes one octet on the wire.
padding_payload_len_ = padding_len - 1;
@@ -678,7 +678,7 @@
SpdyStreamId last_good_stream_id() const { return last_good_stream_id_; }
void set_last_good_stream_id(SpdyStreamId last_good_stream_id) {
- DCHECK_EQ(0u, last_good_stream_id & ~kStreamIdMask);
+ QUICHE_DCHECK_EQ(0u, last_good_stream_id & ~kStreamIdMask);
last_good_stream_id_ = last_good_stream_id;
}
SpdyErrorCode error_code() const { return error_code_; }
@@ -728,8 +728,8 @@
bool padded() const { return padded_; }
int padding_payload_len() const { return padding_payload_len_; }
void set_padding_len(int padding_len) {
- DCHECK_GT(padding_len, 0);
- DCHECK_LE(padding_len, kPaddingSizePerFrame);
+ QUICHE_DCHECK_GT(padding_len, 0);
+ QUICHE_DCHECK_LE(padding_len, kPaddingSizePerFrame);
padded_ = true;
// The pad field takes one octet on the wire.
padding_payload_len_ = padding_len - 1;
@@ -755,8 +755,8 @@
int32_t delta() const { return delta_; }
void set_delta(int32_t delta) {
- DCHECK_LE(0, delta);
- DCHECK_LE(delta, kSpdyMaximumWindowSize);
+ QUICHE_DCHECK_LE(0, delta);
+ QUICHE_DCHECK_LE(delta, kSpdyMaximumWindowSize);
delta_ = delta;
}
@@ -795,8 +795,8 @@
bool padded() const { return padded_; }
int padding_payload_len() const { return padding_payload_len_; }
void set_padding_len(int padding_len) {
- DCHECK_GT(padding_len, 0);
- DCHECK_LE(padding_len, kPaddingSizePerFrame);
+ QUICHE_DCHECK_GT(padding_len, 0);
+ QUICHE_DCHECK_LE(padding_len, kPaddingSizePerFrame);
padded_ = true;
// The pad field takes one octet on the wire.
padding_payload_len_ = padding_len - 1;
diff --git a/spdy/core/spdy_simple_arena.cc b/spdy/core/spdy_simple_arena.cc
index 3f81c2e..15c8fea 100644
--- a/spdy/core/spdy_simple_arena.cc
+++ b/spdy/core/spdy_simple_arena.cc
@@ -21,18 +21,18 @@
char* SpdySimpleArena::Alloc(size_t size) {
Reserve(size);
Block& b = blocks_.back();
- DCHECK_GE(b.size, b.used + size);
+ QUICHE_DCHECK_GE(b.size, b.used + size);
char* out = b.data.get() + b.used;
b.used += size;
return out;
}
char* SpdySimpleArena::Realloc(char* original, size_t oldsize, size_t newsize) {
- DCHECK(!blocks_.empty());
+ QUICHE_DCHECK(!blocks_.empty());
Block& last = blocks_.back();
if (last.data.get() <= original && original < last.data.get() + last.size) {
// (original, oldsize) is in the last Block.
- DCHECK_GE(last.data.get() + last.used, original + oldsize);
+ QUICHE_DCHECK_GE(last.data.get() + last.used, original + oldsize);
if (original + oldsize == last.data.get() + last.used) {
// (original, oldsize) was the most recent allocation,
if (original + newsize < last.data.get() + last.size) {
diff --git a/spdy/core/spdy_test_utils.cc b/spdy/core/spdy_test_utils.cc
index b57f481..482d8e2 100644
--- a/spdy/core/spdy_test_utils.cc
+++ b/spdy/core/spdy_test_utils.cc
@@ -93,7 +93,7 @@
}
void SetFrameLength(SpdySerializedFrame* frame, size_t length) {
- CHECK_GT(1u << 14, length);
+ QUICHE_CHECK_GT(1u << 14, length);
{
int32_t wire_length = quiche::QuicheEndian::HostToNet32(length);
memcpy(frame->data(), reinterpret_cast<char*>(&wire_length) + 1, 3);