gfe-relnote: (n/a) Platformize logging for http2. Refactor only, no behavior change.
Note on merge: http2/platform/impl/http2_logging_impl.h also needs to be merged to Chromium.
PiperOrigin-RevId: 237381363
Change-Id: I98a69eaeca7ac1353054120681e18e99a73c63c4
diff --git a/http2/decoder/decode_buffer.h b/http2/decoder/decode_buffer.h
index 3b213c2..24f252e 100644
--- a/http2/decoder/decode_buffer.h
+++ b/http2/decoder/decode_buffer.h
@@ -17,8 +17,8 @@
#include <algorithm>
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
namespace http2 {
diff --git a/http2/decoder/decode_buffer_test.cc b/http2/decoder/decode_buffer_test.cc
index e8e3d3b..73c9ec6 100644
--- a/http2/decoder/decode_buffer_test.cc
+++ b/http2/decoder/decode_buffer_test.cc
@@ -6,8 +6,8 @@
#include <functional>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
namespace http2 {
diff --git a/http2/decoder/decode_http2_structures.cc b/http2/decoder/decode_http2_structures.cc
index 71f6cce..f106ab0 100644
--- a/http2/decoder/decode_http2_structures.cc
+++ b/http2/decoder/decode_http2_structures.cc
@@ -6,9 +6,9 @@
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
diff --git a/http2/decoder/decode_http2_structures_test.cc b/http2/decoder/decode_http2_structures_test.cc
index 43bd7e8..91b3ef7 100644
--- a/http2/decoder/decode_http2_structures_test.cc
+++ b/http2/decoder/decode_http2_structures_test.cc
@@ -9,12 +9,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
diff --git a/http2/decoder/decode_status.cc b/http2/decoder/decode_status.cc
index 6a913f0..3d31907 100644
--- a/http2/decoder/decode_status.cc
+++ b/http2/decoder/decode_status.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
diff --git a/http2/decoder/frame_decoder_state.cc b/http2/decoder/frame_decoder_state.cc
index 946a6ee..5487997 100644
--- a/http2/decoder/frame_decoder_state.cc
+++ b/http2/decoder/frame_decoder_state.cc
@@ -8,8 +8,8 @@
DecodeStatus FrameDecoderState::ReadPadLength(DecodeBuffer* db,
bool report_pad_length) {
- DVLOG(2) << "ReadPadLength db->Remaining=" << db->Remaining()
- << "; payload_length=" << frame_header().payload_length;
+ HTTP2_DVLOG(2) << "ReadPadLength db->Remaining=" << db->Remaining()
+ << "; payload_length=" << frame_header().payload_length;
DCHECK(IsPaddable());
DCHECK(frame_header().IsPadded());
@@ -51,9 +51,9 @@
}
bool FrameDecoderState::SkipPadding(DecodeBuffer* db) {
- DVLOG(2) << "SkipPadding remaining_padding_=" << remaining_padding_
- << ", db->Remaining=" << db->Remaining()
- << ", header: " << frame_header();
+ 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_GE(remaining_padding_, 0u);
@@ -70,10 +70,10 @@
}
DecodeStatus FrameDecoderState::ReportFrameSizeError() {
- DVLOG(2) << "FrameDecoderState::ReportFrameSizeError: "
- << " remaining_payload_=" << remaining_payload_
- << "; remaining_padding_=" << remaining_padding_
- << ", header: " << frame_header();
+ HTTP2_DVLOG(2) << "FrameDecoderState::ReportFrameSizeError: "
+ << " remaining_payload_=" << remaining_payload_
+ << "; remaining_padding_=" << remaining_padding_
+ << ", header: " << frame_header();
listener()->OnFrameSizeError(frame_header());
return DecodeStatus::kDecodeError;
}
diff --git a/http2/decoder/frame_decoder_state.h b/http2/decoder/frame_decoder_state.h
index 1581752..b44d29b 100644
--- a/http2/decoder/frame_decoder_state.h
+++ b/http2/decoder/frame_decoder_state.h
@@ -16,7 +16,6 @@
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
@@ -24,6 +23,7 @@
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace test {
@@ -60,15 +60,16 @@
// remaining payload.
template <class S>
DecodeStatus StartDecodingStructureInPayload(S* out, DecodeBuffer* db) {
- DVLOG(2) << __func__ << "\n\tdb->Remaining=" << db->Remaining()
- << "\n\tremaining_payload_=" << remaining_payload_
- << "\n\tneed=" << S::EncodedSize();
+ HTTP2_DVLOG(2) << __func__ << "\n\tdb->Remaining=" << db->Remaining()
+ << "\n\tremaining_payload_=" << remaining_payload_
+ << "\n\tneed=" << S::EncodedSize();
DecodeStatus status =
structure_decoder_.Start(out, db, &remaining_payload_);
if (status != DecodeStatus::kDecodeError) {
return status;
}
- DVLOG(2) << "StartDecodingStructureInPayload: detected frame size error";
+ HTTP2_DVLOG(2)
+ << "StartDecodingStructureInPayload: detected frame size error";
return ReportFrameSizeError();
}
@@ -77,14 +78,15 @@
// the payload. Returns values are as for StartDecodingStructureInPayload.
template <class S>
DecodeStatus ResumeDecodingStructureInPayload(S* out, DecodeBuffer* db) {
- DVLOG(2) << __func__ << "\n\tdb->Remaining=" << db->Remaining()
- << "\n\tremaining_payload_=" << remaining_payload_;
+ HTTP2_DVLOG(2) << __func__ << "\n\tdb->Remaining=" << db->Remaining()
+ << "\n\tremaining_payload_=" << remaining_payload_;
if (structure_decoder_.Resume(out, db, &remaining_payload_)) {
return DecodeStatus::kDecodeDone;
} else if (remaining_payload_ > 0) {
return DecodeStatus::kDecodeInProgress;
} else {
- DVLOG(2) << "ResumeDecodingStructureInPayload: detected frame size error";
+ HTTP2_DVLOG(2)
+ << "ResumeDecodingStructureInPayload: detected frame size error";
return ReportFrameSizeError();
}
}
diff --git a/http2/decoder/frame_decoder_state_test_util.cc b/http2/decoder/frame_decoder_state_test_util.cc
index 7c13ef0..0bfe1f7 100644
--- a/http2/decoder/frame_decoder_state_test_util.cc
+++ b/http2/decoder/frame_decoder_state_test_util.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/http2/decoder/frame_decoder_state_test_util.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test_util.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
@@ -16,7 +16,7 @@
// static
void FrameDecoderStatePeer::Randomize(FrameDecoderState* p, Http2Random* rng) {
- VLOG(1) << "FrameDecoderStatePeer::Randomize";
+ HTTP2_VLOG(1) << "FrameDecoderStatePeer::Randomize";
::http2::test::Randomize(&p->frame_header_, rng);
p->remaining_payload_ = rng->Rand32();
p->remaining_padding_ = rng->Rand32();
@@ -26,7 +26,7 @@
// static
void FrameDecoderStatePeer::set_frame_header(const Http2FrameHeader& header,
FrameDecoderState* p) {
- VLOG(1) << "FrameDecoderStatePeer::set_frame_header " << header;
+ HTTP2_VLOG(1) << "FrameDecoderStatePeer::set_frame_header " << header;
p->frame_header_ = header;
}
diff --git a/http2/decoder/http2_frame_decoder.cc b/http2/decoder/http2_frame_decoder.cc
index 314dfbf..9fb290d 100644
--- a/http2/decoder/http2_frame_decoder.cc
+++ b/http2/decoder/http2_frame_decoder.cc
@@ -48,7 +48,7 @@
}
DecodeStatus Http2FrameDecoder::DecodeFrame(DecodeBuffer* db) {
- DVLOG(2) << "Http2FrameDecoder::DecodeFrame state=" << state_;
+ HTTP2_DVLOG(2) << "Http2FrameDecoder::DecodeFrame state=" << state_;
switch (state_) {
case State::kStartDecodingHeader:
if (frame_decoder_state_.StartDecodingFrameHeader(db)) {
@@ -88,17 +88,17 @@
// TODO(jamessynge): Remove OnFrameHeader once done with supporting
// SpdyFramer's exact states.
if (!listener()->OnFrameHeader(header)) {
- DVLOG(2) << "OnFrameHeader rejected the frame, will discard; header: "
- << header;
+ HTTP2_DVLOG(2) << "OnFrameHeader rejected the frame, will discard; header: "
+ << header;
state_ = State::kDiscardPayload;
frame_decoder_state_.InitializeRemainders();
return DecodeStatus::kDecodeError;
}
if (header.payload_length > maximum_payload_size_) {
- DVLOG(2) << "Payload length is greater than allowed: "
- << header.payload_length << " > " << maximum_payload_size_
- << "\n header: " << header;
+ HTTP2_DVLOG(2) << "Payload length is greater than allowed: "
+ << header.payload_length << " > " << maximum_payload_size_
+ << "\n header: " << header;
state_ = State::kDiscardPayload;
frame_decoder_state_.InitializeRemainders();
listener()->OnFrameSizeError(header);
@@ -412,13 +412,15 @@
}
DecodeStatus Http2FrameDecoder::DiscardPayload(DecodeBuffer* db) {
- DVLOG(2) << "remaining_payload=" << frame_decoder_state_.remaining_payload_
- << "; remaining_padding=" << frame_decoder_state_.remaining_padding_;
+ HTTP2_DVLOG(2) << "remaining_payload="
+ << frame_decoder_state_.remaining_payload_
+ << "; remaining_padding="
+ << frame_decoder_state_.remaining_padding_;
frame_decoder_state_.remaining_payload_ +=
frame_decoder_state_.remaining_padding_;
frame_decoder_state_.remaining_padding_ = 0;
const size_t avail = frame_decoder_state_.AvailablePayload(db);
- DVLOG(2) << "avail=" << avail;
+ HTTP2_DVLOG(2) << "avail=" << avail;
if (avail > 0) {
frame_decoder_state_.ConsumePayload(avail);
db->AdvanceCursor(avail);
diff --git a/http2/decoder/http2_frame_decoder.h b/http2/decoder/http2_frame_decoder.h
index 6257bbe..dea40b7 100644
--- a/http2/decoder/http2_frame_decoder.h
+++ b/http2/decoder/http2_frame_decoder.h
@@ -21,7 +21,6 @@
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/decoder/frame_decoder_state.h"
@@ -40,6 +39,7 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace test {
diff --git a/http2/decoder/http2_frame_decoder_listener_test_util.cc b/http2/decoder/http2_frame_decoder_listener_test_util.cc
index bc8cf1d..c1cee8b 100644
--- a/http2/decoder/http2_frame_decoder_listener_test_util.cc
+++ b/http2/decoder/http2_frame_decoder_listener_test_util.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.h"
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -203,7 +203,7 @@
bool LoggingHttp2FrameDecoderListener::OnFrameHeader(
const Http2FrameHeader& header) {
- VLOG(1) << "OnFrameHeader: " << header;
+ HTTP2_VLOG(1) << "OnFrameHeader: " << header;
if (wrapped_ != nullptr) {
return wrapped_->OnFrameHeader(header);
}
@@ -212,7 +212,7 @@
void LoggingHttp2FrameDecoderListener::OnDataStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnDataStart: " << header;
+ HTTP2_VLOG(1) << "OnDataStart: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnDataStart(header);
}
@@ -220,14 +220,14 @@
void LoggingHttp2FrameDecoderListener::OnDataPayload(const char* data,
size_t len) {
- VLOG(1) << "OnDataPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnDataPayload: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnDataPayload(data, len);
}
}
void LoggingHttp2FrameDecoderListener::OnDataEnd() {
- VLOG(1) << "OnDataEnd";
+ HTTP2_VLOG(1) << "OnDataEnd";
if (wrapped_ != nullptr) {
wrapped_->OnDataEnd();
}
@@ -235,7 +235,7 @@
void LoggingHttp2FrameDecoderListener::OnHeadersStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnHeadersStart: " << header;
+ HTTP2_VLOG(1) << "OnHeadersStart: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnHeadersStart(header);
}
@@ -243,7 +243,7 @@
void LoggingHttp2FrameDecoderListener::OnHeadersPriority(
const Http2PriorityFields& priority) {
- VLOG(1) << "OnHeadersPriority: " << priority;
+ HTTP2_VLOG(1) << "OnHeadersPriority: " << priority;
if (wrapped_ != nullptr) {
wrapped_->OnHeadersPriority(priority);
}
@@ -251,14 +251,14 @@
void LoggingHttp2FrameDecoderListener::OnHpackFragment(const char* data,
size_t len) {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnHpackFragment(data, len);
}
}
void LoggingHttp2FrameDecoderListener::OnHeadersEnd() {
- VLOG(1) << "OnHeadersEnd";
+ HTTP2_VLOG(1) << "OnHeadersEnd";
if (wrapped_ != nullptr) {
wrapped_->OnHeadersEnd();
}
@@ -267,7 +267,7 @@
void LoggingHttp2FrameDecoderListener::OnPriorityFrame(
const Http2FrameHeader& header,
const Http2PriorityFields& priority) {
- VLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority;
+ HTTP2_VLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority;
if (wrapped_ != nullptr) {
wrapped_->OnPriorityFrame(header, priority);
}
@@ -275,21 +275,21 @@
void LoggingHttp2FrameDecoderListener::OnContinuationStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnContinuationStart: " << header;
+ HTTP2_VLOG(1) << "OnContinuationStart: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnContinuationStart(header);
}
}
void LoggingHttp2FrameDecoderListener::OnContinuationEnd() {
- VLOG(1) << "OnContinuationEnd";
+ HTTP2_VLOG(1) << "OnContinuationEnd";
if (wrapped_ != nullptr) {
wrapped_->OnContinuationEnd();
}
}
void LoggingHttp2FrameDecoderListener::OnPadLength(size_t trailing_length) {
- VLOG(1) << "OnPadLength: trailing_length=" << trailing_length;
+ HTTP2_VLOG(1) << "OnPadLength: trailing_length=" << trailing_length;
if (wrapped_ != nullptr) {
wrapped_->OnPadLength(trailing_length);
}
@@ -297,7 +297,7 @@
void LoggingHttp2FrameDecoderListener::OnPadding(const char* padding,
size_t skipped_length) {
- VLOG(1) << "OnPadding: skipped_length=" << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: skipped_length=" << skipped_length;
if (wrapped_ != nullptr) {
wrapped_->OnPadding(padding, skipped_length);
}
@@ -306,7 +306,7 @@
void LoggingHttp2FrameDecoderListener::OnRstStream(
const Http2FrameHeader& header,
Http2ErrorCode error_code) {
- VLOG(1) << "OnRstStream: " << header << "; code=" << error_code;
+ HTTP2_VLOG(1) << "OnRstStream: " << header << "; code=" << error_code;
if (wrapped_ != nullptr) {
wrapped_->OnRstStream(header, error_code);
}
@@ -314,7 +314,7 @@
void LoggingHttp2FrameDecoderListener::OnSettingsStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsStart: " << header;
+ HTTP2_VLOG(1) << "OnSettingsStart: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnSettingsStart(header);
}
@@ -322,14 +322,14 @@
void LoggingHttp2FrameDecoderListener::OnSetting(
const Http2SettingFields& setting_fields) {
- VLOG(1) << "OnSetting: " << setting_fields;
+ HTTP2_VLOG(1) << "OnSetting: " << setting_fields;
if (wrapped_ != nullptr) {
wrapped_->OnSetting(setting_fields);
}
}
void LoggingHttp2FrameDecoderListener::OnSettingsEnd() {
- VLOG(1) << "OnSettingsEnd";
+ HTTP2_VLOG(1) << "OnSettingsEnd";
if (wrapped_ != nullptr) {
wrapped_->OnSettingsEnd();
}
@@ -337,7 +337,7 @@
void LoggingHttp2FrameDecoderListener::OnSettingsAck(
const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsAck: " << header;
+ HTTP2_VLOG(1) << "OnSettingsAck: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnSettingsAck(header);
}
@@ -347,15 +347,15 @@
const Http2FrameHeader& header,
const Http2PushPromiseFields& promise,
size_t total_padding_length) {
- VLOG(1) << "OnPushPromiseStart: " << header << "; promise: " << promise
- << "; total_padding_length: " << total_padding_length;
+ HTTP2_VLOG(1) << "OnPushPromiseStart: " << header << "; promise: " << promise
+ << "; total_padding_length: " << total_padding_length;
if (wrapped_ != nullptr) {
wrapped_->OnPushPromiseStart(header, promise, total_padding_length);
}
}
void LoggingHttp2FrameDecoderListener::OnPushPromiseEnd() {
- VLOG(1) << "OnPushPromiseEnd";
+ HTTP2_VLOG(1) << "OnPushPromiseEnd";
if (wrapped_ != nullptr) {
wrapped_->OnPushPromiseEnd();
}
@@ -363,7 +363,7 @@
void LoggingHttp2FrameDecoderListener::OnPing(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPing: " << header << "; ping: " << ping;
+ HTTP2_VLOG(1) << "OnPing: " << header << "; ping: " << ping;
if (wrapped_ != nullptr) {
wrapped_->OnPing(header, ping);
}
@@ -371,7 +371,7 @@
void LoggingHttp2FrameDecoderListener::OnPingAck(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPingAck: " << header << "; ping: " << ping;
+ HTTP2_VLOG(1) << "OnPingAck: " << header << "; ping: " << ping;
if (wrapped_ != nullptr) {
wrapped_->OnPingAck(header, ping);
}
@@ -380,7 +380,7 @@
void LoggingHttp2FrameDecoderListener::OnGoAwayStart(
const Http2FrameHeader& header,
const Http2GoAwayFields& goaway) {
- VLOG(1) << "OnGoAwayStart: " << header << "; goaway: " << goaway;
+ HTTP2_VLOG(1) << "OnGoAwayStart: " << header << "; goaway: " << goaway;
if (wrapped_ != nullptr) {
wrapped_->OnGoAwayStart(header, goaway);
}
@@ -388,14 +388,14 @@
void LoggingHttp2FrameDecoderListener::OnGoAwayOpaqueData(const char* data,
size_t len) {
- VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
+ HTTP2_VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnGoAwayOpaqueData(data, len);
}
}
void LoggingHttp2FrameDecoderListener::OnGoAwayEnd() {
- VLOG(1) << "OnGoAwayEnd";
+ HTTP2_VLOG(1) << "OnGoAwayEnd";
if (wrapped_ != nullptr) {
wrapped_->OnGoAwayEnd();
}
@@ -404,7 +404,7 @@
void LoggingHttp2FrameDecoderListener::OnWindowUpdate(
const Http2FrameHeader& header,
uint32_t increment) {
- VLOG(1) << "OnWindowUpdate: " << header << "; increment=" << increment;
+ HTTP2_VLOG(1) << "OnWindowUpdate: " << header << "; increment=" << increment;
if (wrapped_ != nullptr) {
wrapped_->OnWindowUpdate(header, increment);
}
@@ -414,8 +414,9 @@
const Http2FrameHeader& header,
size_t origin_length,
size_t value_length) {
- VLOG(1) << "OnAltSvcStart: " << header << "; origin_length: " << origin_length
- << "; value_length: " << value_length;
+ HTTP2_VLOG(1) << "OnAltSvcStart: " << header
+ << "; origin_length: " << origin_length
+ << "; value_length: " << value_length;
if (wrapped_ != nullptr) {
wrapped_->OnAltSvcStart(header, origin_length, value_length);
}
@@ -423,7 +424,7 @@
void LoggingHttp2FrameDecoderListener::OnAltSvcOriginData(const char* data,
size_t len) {
- VLOG(1) << "OnAltSvcOriginData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcOriginData: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnAltSvcOriginData(data, len);
}
@@ -431,14 +432,14 @@
void LoggingHttp2FrameDecoderListener::OnAltSvcValueData(const char* data,
size_t len) {
- VLOG(1) << "OnAltSvcValueData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcValueData: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnAltSvcValueData(data, len);
}
}
void LoggingHttp2FrameDecoderListener::OnAltSvcEnd() {
- VLOG(1) << "OnAltSvcEnd";
+ HTTP2_VLOG(1) << "OnAltSvcEnd";
if (wrapped_ != nullptr) {
wrapped_->OnAltSvcEnd();
}
@@ -446,7 +447,7 @@
void LoggingHttp2FrameDecoderListener::OnUnknownStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnUnknownStart: " << header;
+ HTTP2_VLOG(1) << "OnUnknownStart: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnUnknownStart(header);
}
@@ -454,14 +455,14 @@
void LoggingHttp2FrameDecoderListener::OnUnknownPayload(const char* data,
size_t len) {
- VLOG(1) << "OnUnknownPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnUnknownPayload: len=" << len;
if (wrapped_ != nullptr) {
wrapped_->OnUnknownPayload(data, len);
}
}
void LoggingHttp2FrameDecoderListener::OnUnknownEnd() {
- VLOG(1) << "OnUnknownEnd";
+ HTTP2_VLOG(1) << "OnUnknownEnd";
if (wrapped_ != nullptr) {
wrapped_->OnUnknownEnd();
}
@@ -470,8 +471,8 @@
void LoggingHttp2FrameDecoderListener::OnPaddingTooLong(
const Http2FrameHeader& header,
size_t missing_length) {
- VLOG(1) << "OnPaddingTooLong: " << header
- << "; missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << "; missing_length: " << missing_length;
if (wrapped_ != nullptr) {
wrapped_->OnPaddingTooLong(header, missing_length);
}
@@ -479,7 +480,7 @@
void LoggingHttp2FrameDecoderListener::OnFrameSizeError(
const Http2FrameHeader& header) {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
if (wrapped_ != nullptr) {
wrapped_->OnFrameSizeError(header);
}
diff --git a/http2/decoder/http2_frame_decoder_listener_test_util.h b/http2/decoder/http2_frame_decoder_listener_test_util.h
index d6e84ef..36a25ba 100644
--- a/http2/decoder/http2_frame_decoder_listener_test_util.h
+++ b/http2/decoder/http2_frame_decoder_listener_test_util.h
@@ -75,8 +75,8 @@
void EnsureNotAbstract() { FailingHttp2FrameDecoderListener instance; }
};
-// VLOG's all the calls it receives, and forwards those calls to an optional
-// listener.
+// HTTP2_VLOG's all the calls it receives, and forwards those calls to an
+// optional listener.
class LoggingHttp2FrameDecoderListener : public Http2FrameDecoderListener {
public:
LoggingHttp2FrameDecoderListener();
diff --git a/http2/decoder/http2_frame_decoder_test.cc b/http2/decoder/http2_frame_decoder_test.cc
index 172bd62..50e75ed 100644
--- a/http2/decoder/http2_frame_decoder_test.cc
+++ b/http2/decoder/http2_frame_decoder_test.cc
@@ -8,9 +8,9 @@
#include <vector>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_reconstruct_object.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
@@ -44,7 +44,7 @@
}
DecodeStatus StartDecoding(DecodeBuffer* db) override {
- DVLOG(2) << "StartDecoding, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "StartDecoding, db->Remaining=" << db->Remaining();
collector_.Reset();
PrepareDecoder();
@@ -61,7 +61,7 @@
}
DecodeStatus ResumeDecoding(DecodeBuffer* db) override {
- DVLOG(2) << "ResumeDecoding, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "ResumeDecoding, db->Remaining=" << db->Remaining();
DecodeStatus status = decoder_.DecodeFrame(db);
if (status != DecodeStatus::kDecodeInProgress) {
// Keep track of this so that a concrete test can verify that both fast
diff --git a/http2/decoder/http2_structure_decoder.cc b/http2/decoder/http2_structure_decoder.cc
index e4f2c1a..f30a91b 100644
--- a/http2/decoder/http2_structure_decoder.cc
+++ b/http2/decoder/http2_structure_decoder.cc
@@ -33,23 +33,24 @@
DecodeStatus Http2StructureDecoder::IncompleteStart(DecodeBuffer* db,
uint32_t* remaining_payload,
uint32_t target_size) {
- DVLOG(1) << "IncompleteStart@" << this
- << ": *remaining_payload=" << *remaining_payload
- << "; target_size=" << target_size
- << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "IncompleteStart@" << this
+ << ": *remaining_payload=" << *remaining_payload
+ << "; target_size=" << target_size
+ << "; db->Remaining=" << db->Remaining();
*remaining_payload -=
IncompleteStart(db, std::min(target_size, *remaining_payload));
if (*remaining_payload > 0 && db->Empty()) {
return DecodeStatus::kDecodeInProgress;
}
- DVLOG(1) << "IncompleteStart: kDecodeError";
+ HTTP2_DVLOG(1) << "IncompleteStart: kDecodeError";
return DecodeStatus::kDecodeError;
}
bool Http2StructureDecoder::ResumeFillingBuffer(DecodeBuffer* db,
uint32_t target_size) {
- DVLOG(2) << "ResumeFillingBuffer@" << this << ": target_size=" << target_size
- << "; offset_=" << offset_ << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "ResumeFillingBuffer@" << this
+ << ": target_size=" << target_size << "; offset_=" << offset_
+ << "; db->Remaining=" << db->Remaining();
if (target_size < offset_) {
HTTP2_BUG << "Already filled buffer_! target_size=" << target_size
<< " offset_=" << offset_;
@@ -57,7 +58,7 @@
}
const uint32_t needed = target_size - offset_;
const uint32_t num_to_copy = db->MinLengthRemaining(needed);
- DVLOG(2) << "ResumeFillingBuffer num_to_copy=" << num_to_copy;
+ HTTP2_DVLOG(2) << "ResumeFillingBuffer num_to_copy=" << num_to_copy;
memcpy(&buffer_[offset_], db->cursor(), num_to_copy);
db->AdvanceCursor(num_to_copy);
offset_ += num_to_copy;
@@ -67,10 +68,10 @@
bool Http2StructureDecoder::ResumeFillingBuffer(DecodeBuffer* db,
uint32_t* remaining_payload,
uint32_t target_size) {
- DVLOG(2) << "ResumeFillingBuffer@" << this << ": target_size=" << target_size
- << "; offset_=" << offset_
- << "; *remaining_payload=" << *remaining_payload
- << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "ResumeFillingBuffer@" << this
+ << ": target_size=" << target_size << "; offset_=" << offset_
+ << "; *remaining_payload=" << *remaining_payload
+ << "; db->Remaining=" << db->Remaining();
if (target_size < offset_) {
HTTP2_BUG << "Already filled buffer_! target_size=" << target_size
<< " offset_=" << offset_;
@@ -79,7 +80,7 @@
const uint32_t needed = target_size - offset_;
const uint32_t num_to_copy =
db->MinLengthRemaining(std::min(needed, *remaining_payload));
- DVLOG(2) << "ResumeFillingBuffer num_to_copy=" << num_to_copy;
+ HTTP2_DVLOG(2) << "ResumeFillingBuffer num_to_copy=" << num_to_copy;
memcpy(&buffer_[offset_], db->cursor(), num_to_copy);
db->AdvanceCursor(num_to_copy);
offset_ += num_to_copy;
diff --git a/http2/decoder/http2_structure_decoder.h b/http2/decoder/http2_structure_decoder.h
index 46c88b8..8ef5f78 100644
--- a/http2/decoder/http2_structure_decoder.h
+++ b/http2/decoder/http2_structure_decoder.h
@@ -15,12 +15,12 @@
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_http2_structures.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace test {
@@ -44,8 +44,9 @@
template <class S>
bool Start(S* out, DecodeBuffer* db) {
static_assert(S::EncodedSize() <= sizeof buffer_, "buffer_ is too small");
- DVLOG(2) << __func__ << "@" << this << ": db->Remaining=" << db->Remaining()
- << "; EncodedSize=" << S::EncodedSize();
+ HTTP2_DVLOG(2) << __func__ << "@" << this
+ << ": db->Remaining=" << db->Remaining()
+ << "; EncodedSize=" << S::EncodedSize();
if (db->Remaining() >= S::EncodedSize()) {
DoDecode(out, db);
return true;
@@ -56,12 +57,12 @@
template <class S>
bool Resume(S* out, DecodeBuffer* db) {
- DVLOG(2) << __func__ << "@" << this << ": offset_=" << offset_
- << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << __func__ << "@" << this << ": offset_=" << offset_
+ << "; db->Remaining=" << db->Remaining();
if (ResumeFillingBuffer(db, S::EncodedSize())) {
// We have the whole thing now.
- DVLOG(2) << __func__ << "@" << this << " offset_=" << offset_
- << " Ready to decode from buffer_.";
+ HTTP2_DVLOG(2) << __func__ << "@" << this << " offset_=" << offset_
+ << " Ready to decode from buffer_.";
DecodeBuffer buffer_db(buffer_, S::EncodedSize());
DoDecode(out, &buffer_db);
return true;
@@ -77,10 +78,10 @@
template <class S>
DecodeStatus Start(S* out, DecodeBuffer* db, uint32_t* remaining_payload) {
static_assert(S::EncodedSize() <= sizeof buffer_, "buffer_ is too small");
- DVLOG(2) << __func__ << "@" << this
- << ": *remaining_payload=" << *remaining_payload
- << "; db->Remaining=" << db->Remaining()
- << "; EncodedSize=" << S::EncodedSize();
+ HTTP2_DVLOG(2) << __func__ << "@" << this
+ << ": *remaining_payload=" << *remaining_payload
+ << "; db->Remaining=" << db->Remaining()
+ << "; EncodedSize=" << S::EncodedSize();
if (db->MinLengthRemaining(*remaining_payload) >= S::EncodedSize()) {
DoDecode(out, db);
*remaining_payload -= S::EncodedSize();
@@ -91,14 +92,14 @@
template <class S>
bool Resume(S* out, DecodeBuffer* db, uint32_t* remaining_payload) {
- DVLOG(3) << __func__ << "@" << this << ": offset_=" << offset_
- << "; *remaining_payload=" << *remaining_payload
- << "; db->Remaining=" << db->Remaining()
- << "; EncodedSize=" << S::EncodedSize();
+ HTTP2_DVLOG(3) << __func__ << "@" << this << ": offset_=" << offset_
+ << "; *remaining_payload=" << *remaining_payload
+ << "; db->Remaining=" << db->Remaining()
+ << "; EncodedSize=" << S::EncodedSize();
if (ResumeFillingBuffer(db, remaining_payload, S::EncodedSize())) {
// We have the whole thing now.
- DVLOG(2) << __func__ << "@" << this << ": offset_=" << offset_
- << "; Ready to decode from buffer_.";
+ HTTP2_DVLOG(2) << __func__ << "@" << this << ": offset_=" << offset_
+ << "; Ready to decode from buffer_.";
DecodeBuffer buffer_db(buffer_, S::EncodedSize());
DoDecode(out, &buffer_db);
return true;
diff --git a/http2/decoder/http2_structure_decoder_test.cc b/http2/decoder/http2_structure_decoder_test.cc
index 8d8da7b..7b9afc5 100644
--- a/http2/decoder/http2_structure_decoder_test.cc
+++ b/http2/decoder/http2_structure_decoder_test.cc
@@ -22,12 +22,12 @@
#include <cstdint>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_reconstruct_object.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
@@ -137,8 +137,8 @@
VERIFY_EQ(0u, incomplete_resume_count_);
}
if (expected != nullptr) {
- DVLOG(1) << "DecodeLeadingStructure expected: " << *expected;
- DVLOG(1) << "DecodeLeadingStructure actual: " << structure_;
+ HTTP2_DVLOG(1) << "DecodeLeadingStructure expected: " << *expected;
+ HTTP2_DVLOG(1) << "DecodeLeadingStructure actual: " << structure_;
VERIFY_EQ(*expected, structure_);
}
return AssertionSuccess();
diff --git a/http2/decoder/payload_decoders/altsvc_payload_decoder.cc b/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
index 4e4d860..b6dde85 100644
--- a/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
@@ -6,13 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -39,8 +38,8 @@
DecodeStatus AltSvcPayloadDecoder::StartDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "AltSvcPayloadDecoder::StartDecodingPayload: "
- << state->frame_header();
+ 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);
@@ -55,7 +54,8 @@
FrameDecoderState* state,
DecodeBuffer* db) {
const Http2FrameHeader& frame_header = state->frame_header();
- DVLOG(2) << "AltSvcPayloadDecoder::ResumeDecodingPayload: " << 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());
@@ -65,8 +65,9 @@
// see DCHECK_NE above.
DecodeStatus status = DecodeStatus::kDecodeError;
while (true) {
- DVLOG(2) << "AltSvcPayloadDecoder::ResumeDecodingPayload payload_state_="
- << payload_state_;
+ HTTP2_DVLOG(2)
+ << "AltSvcPayloadDecoder::ResumeDecodingPayload payload_state_="
+ << payload_state_;
switch (payload_state_) {
case PayloadState::kStartDecodingStruct:
status = state->StartDecodingStructureInPayload(&altsvc_fields_, db);
@@ -108,9 +109,9 @@
DecodeStatus AltSvcPayloadDecoder::DecodeStrings(FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "AltSvcPayloadDecoder::DecodeStrings remaining_payload="
- << state->remaining_payload()
- << ", db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "AltSvcPayloadDecoder::DecodeStrings remaining_payload="
+ << state->remaining_payload()
+ << ", db->Remaining=" << db->Remaining();
// Note that we don't explicitly keep track of exactly how far through the
// origin; instead we compute it from how much is left of the original
// payload length and the decoded total length of the origin.
diff --git a/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc b/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
index 0221328..6a4bee5 100644
--- a/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -39,29 +39,29 @@
void OnAltSvcStart(const Http2FrameHeader& header,
size_t origin_length,
size_t value_length) override {
- VLOG(1) << "OnAltSvcStart header: " << header
- << "; origin_length=" << origin_length
- << "; value_length=" << value_length;
+ HTTP2_VLOG(1) << "OnAltSvcStart header: " << header
+ << "; origin_length=" << origin_length
+ << "; value_length=" << value_length;
StartFrame(header)->OnAltSvcStart(header, origin_length, value_length);
}
void OnAltSvcOriginData(const char* data, size_t len) override {
- VLOG(1) << "OnAltSvcOriginData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcOriginData: len=" << len;
CurrentFrame()->OnAltSvcOriginData(data, len);
}
void OnAltSvcValueData(const char* data, size_t len) override {
- VLOG(1) << "OnAltSvcValueData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcValueData: len=" << len;
CurrentFrame()->OnAltSvcValueData(data, len);
}
void OnAltSvcEnd() override {
- VLOG(1) << "OnAltSvcEnd";
+ HTTP2_VLOG(1) << "OnAltSvcEnd";
EndFrame()->OnAltSvcEnd();
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -88,15 +88,17 @@
AltSvcPayloadLengthTests()
: origin_length_(::testing::get<0>(GetParam())),
value_length_(::testing::get<1>(GetParam())) {
- VLOG(1) << "################ origin_length_=" << origin_length_
- << " value_length_=" << value_length_ << " ################";
+ HTTP2_VLOG(1) << "################ origin_length_=" << origin_length_
+ << " value_length_=" << value_length_
+ << " ################";
}
const uint16_t origin_length_;
const uint32_t value_length_;
};
-INSTANTIATE_TEST_SUITE_P(VariousOriginAndValueLengths, AltSvcPayloadLengthTests,
+INSTANTIATE_TEST_SUITE_P(VariousOriginAndValueLengths,
+ AltSvcPayloadLengthTests,
::testing::Combine(::testing::Values(0, 1, 3, 65535),
::testing::Values(0, 1, 3, 65537)));
diff --git a/http2/decoder/payload_decoders/continuation_payload_decoder.cc b/http2/decoder/payload_decoders/continuation_payload_decoder.cc
index aa9c817..37109f2 100644
--- a/http2/decoder/payload_decoders/continuation_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/continuation_payload_decoder.cc
@@ -6,11 +6,11 @@
#include <stddef.h>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -20,8 +20,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "ContinuationPayloadDecoder::StartDecodingPayload: "
- << frame_header;
+ 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));
@@ -34,9 +34,9 @@
DecodeStatus ContinuationPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "ContinuationPayloadDecoder::ResumeDecodingPayload"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ 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());
diff --git a/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc b/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
index 6e81828..35479a1 100644
--- a/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
@@ -8,12 +8,12 @@
#include <type_traits>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -39,17 +39,17 @@
struct Listener : public FramePartsCollector {
void OnContinuationStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnContinuationStart: " << header;
+ HTTP2_VLOG(1) << "OnContinuationStart: " << header;
StartFrame(header)->OnContinuationStart(header);
}
void OnHpackFragment(const char* data, size_t len) override {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
CurrentFrame()->OnHpackFragment(data, len);
}
void OnContinuationEnd() override {
- VLOG(1) << "OnContinuationEnd";
+ HTTP2_VLOG(1) << "OnContinuationEnd";
EndFrame()->OnContinuationEnd();
}
};
@@ -61,13 +61,15 @@
public ::testing::WithParamInterface<uint32_t> {
protected:
ContinuationPayloadDecoderTest() : length_(GetParam()) {
- VLOG(1) << "################ length_=" << length_ << " ################";
+ HTTP2_VLOG(1) << "################ length_=" << length_
+ << " ################";
}
const uint32_t length_;
};
-INSTANTIATE_TEST_SUITE_P(VariousLengths, ContinuationPayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousLengths,
+ ContinuationPayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 4, 5, 6));
TEST_P(ContinuationPayloadDecoderTest, ValidLength) {
diff --git a/http2/decoder/payload_decoders/data_payload_decoder.cc b/http2/decoder/payload_decoders/data_payload_decoder.cc
index b6b8041..fb483a8 100644
--- a/http2/decoder/payload_decoders/data_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/data_payload_decoder.cc
@@ -6,13 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -39,7 +38,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "DataPayloadDecoder::StartDecodingPayload: " << frame_header;
+ 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 &
@@ -49,11 +49,11 @@
// the decode buffer. TO BE SEEN if that is true. It certainly requires that
// the transport buffers be large (e.g. >> 16KB typically).
// TODO(jamessynge) Add counters.
- DVLOG(2) << "StartDecodingPayload total_length=" << total_length;
+ HTTP2_DVLOG(2) << "StartDecodingPayload total_length=" << total_length;
if (!frame_header.IsPadded()) {
- DVLOG(2) << "StartDecodingPayload !IsPadded";
+ HTTP2_DVLOG(2) << "StartDecodingPayload !IsPadded";
if (db->Remaining() == total_length) {
- DVLOG(2) << "StartDecodingPayload all present";
+ HTTP2_DVLOG(2) << "StartDecodingPayload all present";
// Note that we don't cache the listener field so that the callee can
// replace it if the frame is bad.
// If this case is common enough, consider combining the 3 callbacks
@@ -77,8 +77,8 @@
DecodeStatus DataPayloadDecoder::ResumeDecodingPayload(FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "DataPayloadDecoder::ResumeDecodingPayload payload_state_="
- << payload_state_;
+ 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(),
diff --git a/http2/decoder/payload_decoders/data_payload_decoder_test.cc b/http2/decoder/payload_decoders/data_payload_decoder_test.cc
index 0622f17..1cae714 100644
--- a/http2/decoder/payload_decoders/data_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/data_payload_decoder_test.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
@@ -43,34 +43,34 @@
struct Listener : public FramePartsCollector {
void OnDataStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnDataStart: " << header;
+ HTTP2_VLOG(1) << "OnDataStart: " << header;
StartFrame(header)->OnDataStart(header);
}
void OnDataPayload(const char* data, size_t len) override {
- VLOG(1) << "OnDataPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnDataPayload: len=" << len;
CurrentFrame()->OnDataPayload(data, len);
}
void OnDataEnd() override {
- VLOG(1) << "OnDataEnd";
+ HTTP2_VLOG(1) << "OnDataEnd";
EndFrame()->OnDataEnd();
}
void OnPadLength(size_t pad_length) override {
- VLOG(1) << "OnPadLength: " << pad_length;
+ HTTP2_VLOG(1) << "OnPadLength: " << pad_length;
CurrentFrame()->OnPadLength(pad_length);
}
void OnPadding(const char* padding, size_t skipped_length) override {
- VLOG(1) << "OnPadding: " << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: " << skipped_length;
CurrentFrame()->OnPadding(padding, skipped_length);
}
void OnPaddingTooLong(const Http2FrameHeader& header,
size_t missing_length) override {
- VLOG(1) << "OnPaddingTooLong: " << header
- << " missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << " missing_length: " << missing_length;
EndFrame()->OnPaddingTooLong(header, missing_length);
}
};
@@ -98,7 +98,8 @@
}
};
-INSTANTIATE_TEST_SUITE_P(VariousPadLengths, DataPayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousPadLengths,
+ DataPayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 4, 254, 255, 256));
TEST_P(DataPayloadDecoderTest, VariousDataPayloadSizes) {
diff --git a/http2/decoder/payload_decoders/goaway_payload_decoder.cc b/http2/decoder/payload_decoders/goaway_payload_decoder.cc
index cf7b673..d1402ae 100644
--- a/http2/decoder/payload_decoders/goaway_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/goaway_payload_decoder.cc
@@ -6,13 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -39,8 +38,8 @@
DecodeStatus GoAwayPayloadDecoder::StartDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "GoAwayPayloadDecoder::StartDecodingPayload: "
- << state->frame_header();
+ 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);
@@ -53,9 +52,9 @@
DecodeStatus GoAwayPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "GoAwayPayloadDecoder::ResumeDecodingPayload: remaining_payload="
- << state->remaining_payload()
- << ", db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2)
+ << "GoAwayPayloadDecoder::ResumeDecodingPayload: remaining_payload="
+ << state->remaining_payload() << ", db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
DCHECK_EQ(Http2FrameType::GOAWAY, frame_header.type);
@@ -68,8 +67,9 @@
DecodeStatus status = DecodeStatus::kDecodeError;
size_t avail;
while (true) {
- DVLOG(2) << "GoAwayPayloadDecoder::ResumeDecodingPayload payload_state_="
- << payload_state_;
+ HTTP2_DVLOG(2)
+ << "GoAwayPayloadDecoder::ResumeDecodingPayload payload_state_="
+ << payload_state_;
switch (payload_state_) {
case PayloadState::kStartDecodingFixedFields:
status = state->StartDecodingStructureInPayload(&goaway_fields_, db);
diff --git a/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc b/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
index c90cdcc..5ea533a 100644
--- a/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -36,22 +36,23 @@
struct Listener : public FramePartsCollector {
void OnGoAwayStart(const Http2FrameHeader& header,
const Http2GoAwayFields& goaway) override {
- VLOG(1) << "OnGoAwayStart header: " << header << "; goaway: " << goaway;
+ HTTP2_VLOG(1) << "OnGoAwayStart header: " << header
+ << "; goaway: " << goaway;
StartFrame(header)->OnGoAwayStart(header, goaway);
}
void OnGoAwayOpaqueData(const char* data, size_t len) override {
- VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
+ HTTP2_VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
CurrentFrame()->OnGoAwayOpaqueData(data, len);
}
void OnGoAwayEnd() override {
- VLOG(1) << "OnGoAwayEnd";
+ HTTP2_VLOG(1) << "OnGoAwayEnd";
EndFrame()->OnGoAwayEnd();
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -77,13 +78,15 @@
public ::testing::WithParamInterface<uint32_t> {
protected:
GoAwayOpaqueDataLengthTests() : length_(GetParam()) {
- VLOG(1) << "################ length_=" << length_ << " ################";
+ HTTP2_VLOG(1) << "################ length_=" << length_
+ << " ################";
}
const uint32_t length_;
};
-INSTANTIATE_TEST_SUITE_P(VariousLengths, GoAwayOpaqueDataLengthTests,
+INSTANTIATE_TEST_SUITE_P(VariousLengths,
+ GoAwayOpaqueDataLengthTests,
::testing::Values(0, 1, 2, 3, 4, 5, 6));
TEST_P(GoAwayOpaqueDataLengthTests, ValidLength) {
diff --git a/http2/decoder/payload_decoders/headers_payload_decoder.cc b/http2/decoder/payload_decoders/headers_payload_decoder.cc
index ecaf0fa..d177eb6 100644
--- a/http2/decoder/payload_decoders/headers_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/headers_payload_decoder.cc
@@ -6,13 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -44,7 +43,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "HeadersPayloadDecoder::StartDecodingPayload: " << frame_header;
+ HTTP2_DVLOG(2) << "HeadersPayloadDecoder::StartDecodingPayload: "
+ << frame_header;
DCHECK_EQ(Http2FrameType::HEADERS, frame_header.type);
DCHECK_LE(db->Remaining(), total_length);
@@ -67,9 +67,9 @@
// set then we can decode faster.
const auto payload_flags = Http2FrameFlag::PADDED | Http2FrameFlag::PRIORITY;
if (!frame_header.HasAnyFlags(payload_flags)) {
- DVLOG(2) << "StartDecodingPayload !IsPadded && !HasPriority";
+ HTTP2_DVLOG(2) << "StartDecodingPayload !IsPadded && !HasPriority";
if (db->Remaining() == total_length) {
- DVLOG(2) << "StartDecodingPayload all present";
+ HTTP2_DVLOG(2) << "StartDecodingPayload all present";
// Note that we don't cache the listener field so that the callee can
// replace it if the frame is bad.
// If this case is common enough, consider combining the 3 callbacks
@@ -97,9 +97,9 @@
DecodeStatus HeadersPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "HeadersPayloadDecoder::ResumeDecodingPayload "
- << "remaining_payload=" << state->remaining_payload()
- << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "HeadersPayloadDecoder::ResumeDecodingPayload "
+ << "remaining_payload=" << state->remaining_payload()
+ << "; db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
@@ -110,8 +110,9 @@
DecodeStatus status;
size_t avail;
while (true) {
- DVLOG(2) << "HeadersPayloadDecoder::ResumeDecodingPayload payload_state_="
- << payload_state_;
+ HTTP2_DVLOG(2)
+ << "HeadersPayloadDecoder::ResumeDecodingPayload payload_state_="
+ << payload_state_;
switch (payload_state_) {
case PayloadState::kReadPadLength:
// ReadPadLength handles the OnPadLength callback, and updating the
diff --git a/http2/decoder/payload_decoders/headers_payload_decoder_test.cc b/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
index cb58b8e..a7a90bf 100644
--- a/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -47,44 +47,44 @@
// via the public methods of FramePartsCollector.
struct Listener : public FramePartsCollector {
void OnHeadersStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnHeadersStart: " << header;
+ HTTP2_VLOG(1) << "OnHeadersStart: " << header;
StartFrame(header)->OnHeadersStart(header);
}
void OnHeadersPriority(const Http2PriorityFields& priority) override {
- VLOG(1) << "OnHeadersPriority: " << priority;
+ HTTP2_VLOG(1) << "OnHeadersPriority: " << priority;
CurrentFrame()->OnHeadersPriority(priority);
}
void OnHpackFragment(const char* data, size_t len) override {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
CurrentFrame()->OnHpackFragment(data, len);
}
void OnHeadersEnd() override {
- VLOG(1) << "OnHeadersEnd";
+ HTTP2_VLOG(1) << "OnHeadersEnd";
EndFrame()->OnHeadersEnd();
}
void OnPadLength(size_t pad_length) override {
- VLOG(1) << "OnPadLength: " << pad_length;
+ HTTP2_VLOG(1) << "OnPadLength: " << pad_length;
CurrentFrame()->OnPadLength(pad_length);
}
void OnPadding(const char* padding, size_t skipped_length) override {
- VLOG(1) << "OnPadding: " << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: " << skipped_length;
CurrentFrame()->OnPadding(padding, skipped_length);
}
void OnPaddingTooLong(const Http2FrameHeader& header,
size_t missing_length) override {
- VLOG(1) << "OnPaddingTooLong: " << header
- << "; missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << "; missing_length: " << missing_length;
FrameError(header)->OnPaddingTooLong(header, missing_length);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -94,14 +94,16 @@
HeadersPayloadDecoderPeer,
Listener> {};
-INSTANTIATE_TEST_SUITE_P(VariousPadLengths, HeadersPayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousPadLengths,
+ HeadersPayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 4, 254, 255, 256));
// Decode various sizes of (fake) HPACK payload, both with and without the
// PRIORITY flag set.
TEST_P(HeadersPayloadDecoderTest, VariousHpackPayloadSizes) {
for (size_t hpack_size : {0, 1, 2, 3, 255, 256, 1024}) {
- LOG(INFO) << "########### hpack_size = " << hpack_size << " ###########";
+ HTTP2_LOG(INFO) << "########### hpack_size = " << hpack_size
+ << " ###########";
Http2PriorityFields priority(RandStreamId(), 1 + Random().Rand8(),
Random().OneIn(2));
diff --git a/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc b/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
index 88e1b98..ba6d04a 100644
--- a/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
+++ b/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
@@ -19,7 +19,7 @@
}
DecodeStatus PayloadDecoderBaseTest::StartDecoding(DecodeBuffer* db) {
- DVLOG(2) << "StartDecoding, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "StartDecoding, db->Remaining=" << db->Remaining();
// Make sure sub-class has set frame_header_ so that we can inject it
// into the payload decoder below.
if (!frame_header_is_set_) {
@@ -63,7 +63,7 @@
}
DecodeStatus PayloadDecoderBaseTest::ResumeDecoding(DecodeBuffer* db) {
- DVLOG(2) << "ResumeDecoding, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "ResumeDecoding, db->Remaining=" << db->Remaining();
DecodeStatus status = ResumeDecodingPayload(db);
if (status != DecodeStatus::kDecodeInProgress) {
// Keep track of this so that a concrete test can verify that both fast
diff --git a/http2/decoder/payload_decoders/payload_decoder_base_test_util.h b/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
index 8297e70..66dd88a 100644
--- a/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
+++ b/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
@@ -9,7 +9,6 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
@@ -18,6 +17,7 @@
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_constants_test_util.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_reconstruct_object.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
@@ -55,7 +55,7 @@
void set_frame_header(const Http2FrameHeader& header) {
EXPECT_EQ(0, InvalidFlagMaskForFrameType(header.type) & header.flags);
if (!frame_header_is_set_ || frame_header_ != header) {
- VLOG(2) << "set_frame_header: " << frame_header_;
+ HTTP2_VLOG(2) << "set_frame_header: " << frame_header_;
}
frame_header_ = header;
frame_header_is_set_ = true;
@@ -174,13 +174,14 @@
// Start decoding the payload.
DecodeStatus StartDecodingPayload(DecodeBuffer* db) override {
- DVLOG(2) << "StartDecodingPayload, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "StartDecodingPayload, db->Remaining=" << db->Remaining();
return payload_decoder_.StartDecodingPayload(mutable_state(), db);
}
// Resume decoding the payload.
DecodeStatus ResumeDecodingPayload(DecodeBuffer* db) override {
- DVLOG(2) << "ResumeDecodingPayload, db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "ResumeDecodingPayload, db->Remaining="
+ << db->Remaining();
return payload_decoder_.ResumeDecodingPayload(mutable_state(), db);
}
@@ -220,8 +221,8 @@
validator = [header, validator, this](
const DecodeBuffer& input,
DecodeStatus status) -> ::testing::AssertionResult {
- DVLOG(2) << "VerifyDetectsFrameSizeError validator; status=" << status
- << "; input.Remaining=" << input.Remaining();
+ HTTP2_DVLOG(2) << "VerifyDetectsFrameSizeError validator; status="
+ << status << "; input.Remaining=" << input.Remaining();
VERIFY_EQ(DecodeStatus::kDecodeError, status);
VERIFY_FALSE(listener_.IsInProgress());
VERIFY_EQ(1u, listener_.size());
@@ -277,7 +278,7 @@
if (approve_size != nullptr && !approve_size(real_payload_size)) {
continue;
}
- VLOG(1) << "real_payload_size=" << real_payload_size;
+ HTTP2_VLOG(1) << "real_payload_size=" << real_payload_size;
uint8_t flags = required_flags | RandFlags();
Http2FrameBuilder fb;
if (total_pad_length > 0) {
@@ -343,7 +344,7 @@
typedef typename Base::Validator Validator;
AbstractPaddablePayloadDecoderTest() : total_pad_length_(GetParam()) {
- LOG(INFO) << "total_pad_length_ = " << total_pad_length_;
+ HTTP2_LOG(INFO) << "total_pad_length_ = " << total_pad_length_;
}
// Note that total_pad_length_ includes the size of the Pad Length field,
@@ -422,12 +423,12 @@
if (IsPadded()) {
fb.AppendUInt8(pad_length());
fb.AppendZeroes(pad_length());
- VLOG(1) << "fb.size=" << fb.size();
+ HTTP2_VLOG(1) << "fb.size=" << fb.size();
// Pick a random length for the payload that is shorter than neccesary.
payload_length = Random().Uniform(fb.size());
}
- VLOG(1) << "payload_length=" << payload_length;
+ HTTP2_VLOG(1) << "payload_length=" << payload_length;
Http2String payload = fb.buffer().substr(0, payload_length);
// The missing length is the amount we cut off the end, unless
@@ -435,7 +436,7 @@
// byte, the Pad Length field, is missing.
size_t missing_length =
payload_length == 0 ? 1 : fb.size() - payload_length;
- VLOG(1) << "missing_length=" << missing_length;
+ HTTP2_VLOG(1) << "missing_length=" << missing_length;
const Http2FrameHeader header(payload_length, DecoderPeer::FrameType(),
flags, RandStreamId());
diff --git a/http2/decoder/payload_decoders/ping_payload_decoder.cc b/http2/decoder/payload_decoders/ping_payload_decoder.cc
index 8d98046..1363d4f 100644
--- a/http2/decoder/payload_decoders/ping_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/ping_payload_decoder.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace {
@@ -18,7 +18,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "PingPayloadDecoder::StartDecodingPayload: " << frame_header;
+ 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));
@@ -50,8 +51,8 @@
DecodeStatus PingPayloadDecoder::ResumeDecodingPayload(FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "ResumeDecodingPayload: remaining_payload="
- << state->remaining_payload();
+ 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);
return HandleStatus(
@@ -60,8 +61,8 @@
DecodeStatus PingPayloadDecoder::HandleStatus(FrameDecoderState* state,
DecodeStatus status) {
- DVLOG(2) << "HandleStatus: status=" << status
- << "; remaining_payload=" << state->remaining_payload();
+ HTTP2_DVLOG(2) << "HandleStatus: status=" << status
+ << "; remaining_payload=" << state->remaining_payload();
if (status == DecodeStatus::kDecodeDone) {
if (state->remaining_payload() == 0) {
const Http2FrameHeader& frame_header = state->frame_header();
diff --git a/http2/decoder/payload_decoders/ping_payload_decoder_test.cc b/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
index 34833b2..932149f 100644
--- a/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -35,18 +35,18 @@
struct Listener : public FramePartsCollector {
void OnPing(const Http2FrameHeader& header,
const Http2PingFields& ping) override {
- VLOG(1) << "OnPing: " << header << "; " << ping;
+ HTTP2_VLOG(1) << "OnPing: " << header << "; " << ping;
StartAndEndFrame(header)->OnPing(header, ping);
}
void OnPingAck(const Http2FrameHeader& header,
const Http2PingFields& ping) override {
- VLOG(1) << "OnPingAck: " << header << "; " << ping;
+ HTTP2_VLOG(1) << "OnPingAck: " << header << "; " << ping;
StartAndEndFrame(header)->OnPingAck(header, ping);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
diff --git a/http2/decoder/payload_decoders/priority_payload_decoder.cc b/http2/decoder/payload_decoders/priority_payload_decoder.cc
index 7be1c95..0c5face 100644
--- a/http2/decoder/payload_decoders/priority_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/priority_payload_decoder.cc
@@ -4,19 +4,19 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
DecodeStatus PriorityPayloadDecoder::StartDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "PriorityPayloadDecoder::StartDecodingPayload: "
- << state->frame_header();
+ 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);
// PRIORITY frames have no flags.
@@ -29,9 +29,9 @@
DecodeStatus PriorityPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "PriorityPayloadDecoder::ResumeDecodingPayload"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ 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);
return HandleStatus(
diff --git a/http2/decoder/payload_decoders/priority_payload_decoder_test.cc b/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
index 4e44eba..3b0ac15 100644
--- a/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -37,12 +37,12 @@
struct Listener : public FramePartsCollector {
void OnPriorityFrame(const Http2FrameHeader& header,
const Http2PriorityFields& priority_fields) override {
- VLOG(1) << "OnPriority: " << header << "; " << priority_fields;
+ HTTP2_VLOG(1) << "OnPriority: " << header << "; " << priority_fields;
StartAndEndFrame(header)->OnPriorityFrame(header, priority_fields);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
diff --git a/http2/decoder/payload_decoders/push_promise_payload_decoder.cc b/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
index cec1c07..8b043b6 100644
--- a/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
@@ -6,13 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -42,8 +41,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "PushPromisePayloadDecoder::StartDecodingPayload: "
- << frame_header;
+ HTTP2_DVLOG(2) << "PushPromisePayloadDecoder::StartDecodingPayload: "
+ << frame_header;
DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
DCHECK_LE(db->Remaining(), total_length);
@@ -66,9 +65,9 @@
DecodeStatus PushPromisePayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "UnknownPayloadDecoder::ResumeDecodingPayload"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "UnknownPayloadDecoder::ResumeDecodingPayload"
+ << " remaining_payload=" << state->remaining_payload()
+ << " db->Remaining=" << db->Remaining();
const Http2FrameHeader& frame_header = state->frame_header();
DCHECK_EQ(Http2FrameType::PUSH_PROMISE, frame_header.type);
@@ -77,7 +76,7 @@
DecodeStatus status;
while (true) {
- DVLOG(2)
+ HTTP2_DVLOG(2)
<< "PushPromisePayloadDecoder::ResumeDecodingPayload payload_state_="
<< payload_state_;
switch (payload_state_) {
diff --git a/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc b/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
index 94220f7..64dd935 100644
--- a/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -46,38 +46,38 @@
void OnPushPromiseStart(const Http2FrameHeader& header,
const Http2PushPromiseFields& promise,
size_t total_padding_length) override {
- VLOG(1) << "OnPushPromiseStart header: " << header
- << " promise: " << promise
- << " total_padding_length: " << total_padding_length;
+ HTTP2_VLOG(1) << "OnPushPromiseStart header: " << header
+ << " promise: " << promise
+ << " total_padding_length: " << total_padding_length;
EXPECT_EQ(Http2FrameType::PUSH_PROMISE, header.type);
StartFrame(header)->OnPushPromiseStart(header, promise,
total_padding_length);
}
void OnHpackFragment(const char* data, size_t len) override {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
CurrentFrame()->OnHpackFragment(data, len);
}
void OnPushPromiseEnd() override {
- VLOG(1) << "OnPushPromiseEnd";
+ HTTP2_VLOG(1) << "OnPushPromiseEnd";
EndFrame()->OnPushPromiseEnd();
}
void OnPadding(const char* padding, size_t skipped_length) override {
- VLOG(1) << "OnPadding: " << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: " << skipped_length;
CurrentFrame()->OnPadding(padding, skipped_length);
}
void OnPaddingTooLong(const Http2FrameHeader& header,
size_t missing_length) override {
- VLOG(1) << "OnPaddingTooLong: " << header
- << "; missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << "; missing_length: " << missing_length;
FrameError(header)->OnPaddingTooLong(header, missing_length);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -87,14 +87,16 @@
PushPromisePayloadDecoderPeer,
Listener> {};
-INSTANTIATE_TEST_SUITE_P(VariousPadLengths, PushPromisePayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousPadLengths,
+ PushPromisePayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 4, 254, 255, 256));
// Payload contains the required Http2PushPromiseFields, followed by some
// (fake) HPACK payload.
TEST_P(PushPromisePayloadDecoderTest, VariousHpackPayloadSizes) {
for (size_t hpack_size : {0, 1, 2, 3, 255, 256, 1024}) {
- LOG(INFO) << "########### hpack_size = " << hpack_size << " ###########";
+ HTTP2_LOG(INFO) << "########### hpack_size = " << hpack_size
+ << " ###########";
Reset();
Http2String hpack_payload = Random().RandString(hpack_size);
Http2PushPromiseFields push_promise{RandStreamId()};
diff --git a/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc b/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
index c39a16a..720209d 100644
--- a/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/rst_stream_payload_decoder.cc
@@ -4,19 +4,19 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
DecodeStatus RstStreamPayloadDecoder::StartDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "RstStreamPayloadDecoder::StartDecodingPayload: "
- << state->frame_header();
+ 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);
// RST_STREAM has no flags.
@@ -29,9 +29,9 @@
DecodeStatus RstStreamPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "RstStreamPayloadDecoder::ResumeDecodingPayload"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ 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);
return HandleStatus(
@@ -40,8 +40,8 @@
DecodeStatus RstStreamPayloadDecoder::HandleStatus(FrameDecoderState* state,
DecodeStatus status) {
- DVLOG(2) << "HandleStatus: status=" << status
- << "; remaining_payload=" << state->remaining_payload();
+ HTTP2_DVLOG(2) << "HandleStatus: status=" << status
+ << "; remaining_payload=" << state->remaining_payload();
if (status == DecodeStatus::kDecodeDone) {
if (state->remaining_payload() == 0) {
state->listener()->OnRstStream(state->frame_header(),
diff --git a/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc b/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
index 08f6621..6e00e80 100644
--- a/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
@@ -6,13 +6,13 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_constants_test_util.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -38,12 +38,12 @@
struct Listener : public FramePartsCollector {
void OnRstStream(const Http2FrameHeader& header,
Http2ErrorCode error_code) override {
- VLOG(1) << "OnRstStream: " << header << "; error_code=" << error_code;
+ HTTP2_VLOG(1) << "OnRstStream: " << header << "; error_code=" << error_code;
StartAndEndFrame(header)->OnRstStream(header, error_code);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
diff --git a/http2/decoder/payload_decoders/settings_payload_decoder.cc b/http2/decoder/payload_decoders/settings_payload_decoder.cc
index bf29c4d..fb7d26a 100644
--- a/http2/decoder/payload_decoders/settings_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/settings_payload_decoder.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -18,7 +18,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "SettingsPayloadDecoder::StartDecodingPayload: " << frame_header;
+ 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));
@@ -41,9 +42,9 @@
DecodeStatus SettingsPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "SettingsPayloadDecoder::ResumeDecodingPayload"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ 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);
@@ -59,9 +60,9 @@
DecodeStatus SettingsPayloadDecoder::StartDecodingSettings(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "SettingsPayloadDecoder::StartDecodingSettings"
- << " remaining_payload=" << state->remaining_payload()
- << " db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "SettingsPayloadDecoder::StartDecodingSettings"
+ << " remaining_payload=" << state->remaining_payload()
+ << " db->Remaining=" << db->Remaining();
while (state->remaining_payload() > 0) {
DecodeStatus status =
state->StartDecodingStructureInPayload(&setting_fields_, db);
@@ -71,9 +72,9 @@
}
return HandleNotDone(state, db, status);
}
- DVLOG(2) << "LEAVING SettingsPayloadDecoder::StartDecodingSettings"
- << "\n\tdb->Remaining=" << db->Remaining()
- << "\n\t remaining_payload=" << state->remaining_payload();
+ HTTP2_DVLOG(2) << "LEAVING SettingsPayloadDecoder::StartDecodingSettings"
+ << "\n\tdb->Remaining=" << db->Remaining()
+ << "\n\t remaining_payload=" << state->remaining_payload();
state->listener()->OnSettingsEnd();
return DecodeStatus::kDecodeDone;
}
diff --git a/http2/decoder/payload_decoders/settings_payload_decoder_test.cc b/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
index 3429779..d3f116b 100644
--- a/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
@@ -8,13 +8,13 @@
#include <vector>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_constants_test_util.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -41,29 +41,29 @@
struct Listener : public FramePartsCollector {
void OnSettingsStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnSettingsStart: " << header;
+ HTTP2_VLOG(1) << "OnSettingsStart: " << header;
EXPECT_EQ(Http2FrameType::SETTINGS, header.type) << header;
EXPECT_EQ(Http2FrameFlag(), header.flags) << header;
StartFrame(header)->OnSettingsStart(header);
}
void OnSetting(const Http2SettingFields& setting_fields) override {
- VLOG(1) << "Http2SettingFields: setting_fields=" << setting_fields;
+ HTTP2_VLOG(1) << "Http2SettingFields: setting_fields=" << setting_fields;
CurrentFrame()->OnSetting(setting_fields);
}
void OnSettingsEnd() override {
- VLOG(1) << "OnSettingsEnd";
+ HTTP2_VLOG(1) << "OnSettingsEnd";
EndFrame()->OnSettingsEnd();
}
void OnSettingsAck(const Http2FrameHeader& header) override {
- VLOG(1) << "OnSettingsAck: " << header;
+ HTTP2_VLOG(1) << "OnSettingsAck: " << header;
StartAndEndFrame(header)->OnSettingsAck(header);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
diff --git a/http2/decoder/payload_decoders/unknown_payload_decoder.cc b/http2/decoder/payload_decoders/unknown_payload_decoder.cc
index 10eaf24..574fd61 100644
--- a/http2/decoder/payload_decoders/unknown_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/unknown_payload_decoder.cc
@@ -6,11 +6,11 @@
#include <stddef.h>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -19,7 +19,8 @@
DecodeBuffer* db) {
const Http2FrameHeader& frame_header = state->frame_header();
- DVLOG(2) << "UnknownPayloadDecoder::StartDecodingPayload: " << frame_header;
+ HTTP2_DVLOG(2) << "UnknownPayloadDecoder::StartDecodingPayload: "
+ << frame_header;
DCHECK(!IsSupportedHttp2FrameType(frame_header.type)) << frame_header;
DCHECK_LE(db->Remaining(), frame_header.payload_length);
@@ -31,9 +32,9 @@
DecodeStatus UnknownPayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "UnknownPayloadDecoder::ResumeDecodingPayload "
- << "remaining_payload=" << state->remaining_payload()
- << "; db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "UnknownPayloadDecoder::ResumeDecodingPayload "
+ << "remaining_payload=" << state->remaining_payload()
+ << "; db->Remaining=" << db->Remaining();
DCHECK(!IsSupportedHttp2FrameType(state->frame_header().type))
<< state->frame_header();
DCHECK_LE(state->remaining_payload(), state->frame_header().payload_length);
diff --git a/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc b/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
index f9d203a..018bd82 100644
--- a/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
@@ -8,12 +8,12 @@
#include <type_traits>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -41,17 +41,17 @@
struct Listener : public FramePartsCollector {
void OnUnknownStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnUnknownStart: " << header;
+ HTTP2_VLOG(1) << "OnUnknownStart: " << header;
StartFrame(header)->OnUnknownStart(header);
}
void OnUnknownPayload(const char* data, size_t len) override {
- VLOG(1) << "OnUnknownPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnUnknownPayload: len=" << len;
CurrentFrame()->OnUnknownPayload(data, len);
}
void OnUnknownEnd() override {
- VLOG(1) << "OnUnknownEnd";
+ HTTP2_VLOG(1) << "OnUnknownEnd";
EndFrame()->OnUnknownEnd();
}
};
@@ -66,7 +66,8 @@
public ::testing::WithParamInterface<uint32_t> {
protected:
UnknownPayloadDecoderTest() : length_(GetParam()) {
- VLOG(1) << "################ length_=" << length_ << " ################";
+ HTTP2_VLOG(1) << "################ length_=" << length_
+ << " ################";
// Each test case will choose a random frame type that isn't supported.
do {
@@ -77,7 +78,8 @@
const uint32_t length_;
};
-INSTANTIATE_TEST_SUITE_P(VariousLengths, UnknownPayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousLengths,
+ UnknownPayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 255, 256));
TEST_P(UnknownPayloadDecoderTest, ValidLength) {
diff --git a/http2/decoder/payload_decoders/window_update_payload_decoder.cc b/http2/decoder/payload_decoders/window_update_payload_decoder.cc
index c0bb028..3f83339 100644
--- a/http2/decoder/payload_decoders/window_update_payload_decoder.cc
+++ b/http2/decoder/payload_decoders/window_update_payload_decoder.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_http2_structures.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -19,8 +19,8 @@
const Http2FrameHeader& frame_header = state->frame_header();
const uint32_t total_length = frame_header.payload_length;
- DVLOG(2) << "WindowUpdatePayloadDecoder::StartDecodingPayload: "
- << frame_header;
+ HTTP2_DVLOG(2) << "WindowUpdatePayloadDecoder::StartDecodingPayload: "
+ << frame_header;
DCHECK_EQ(Http2FrameType::WINDOW_UPDATE, frame_header.type);
DCHECK_LE(db->Remaining(), total_length);
@@ -45,9 +45,9 @@
DecodeStatus WindowUpdatePayloadDecoder::ResumeDecodingPayload(
FrameDecoderState* state,
DecodeBuffer* db) {
- DVLOG(2) << "ResumeDecodingPayload: remaining_payload="
- << state->remaining_payload()
- << "; db->Remaining=" << db->Remaining();
+ 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);
return HandleStatus(state, state->ResumeDecodingStructureInPayload(
@@ -56,8 +56,8 @@
DecodeStatus WindowUpdatePayloadDecoder::HandleStatus(FrameDecoderState* state,
DecodeStatus status) {
- DVLOG(2) << "HandleStatus: status=" << status
- << "; remaining_payload=" << state->remaining_payload();
+ HTTP2_DVLOG(2) << "HandleStatus: status=" << status
+ << "; remaining_payload=" << state->remaining_payload();
if (status == DecodeStatus::kDecodeDone) {
if (state->remaining_payload() == 0) {
state->listener()->OnWindowUpdate(
diff --git a/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc b/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
index 77a2b90..66d7d7e 100644
--- a/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -37,14 +37,14 @@
struct Listener : public FramePartsCollector {
void OnWindowUpdate(const Http2FrameHeader& header,
uint32_t window_size_increment) override {
- VLOG(1) << "OnWindowUpdate: " << header
- << "; window_size_increment=" << window_size_increment;
+ HTTP2_VLOG(1) << "OnWindowUpdate: " << header
+ << "; window_size_increment=" << window_size_increment;
EXPECT_EQ(Http2FrameType::WINDOW_UPDATE, header.type);
StartAndEndFrame(header)->OnWindowUpdate(header, window_size_increment);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -57,7 +57,7 @@
Http2WindowUpdateFields RandWindowUpdateFields() {
Http2WindowUpdateFields fields;
test::Randomize(&fields, RandomPtr());
- VLOG(3) << "RandWindowUpdateFields: " << fields;
+ HTTP2_VLOG(3) << "RandWindowUpdateFields: " << fields;
return fields;
}
};
diff --git a/http2/hpack/decoder/hpack_block_collector.cc b/http2/hpack/decoder/hpack_block_collector.cc
index 5b2c6b7..1137be5 100644
--- a/http2/hpack/decoder/hpack_block_collector.cc
+++ b/http2/hpack/decoder/hpack_block_collector.cc
@@ -7,7 +7,7 @@
#include <algorithm>
#include <memory>
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
using ::testing::AssertionResult;
@@ -55,7 +55,7 @@
void HpackBlockCollector::PushPendingEntry() {
EXPECT_TRUE(pending_entry_.IsComplete());
- DVLOG(2) << "PushPendingEntry: " << pending_entry_;
+ HTTP2_DVLOG(2) << "PushPendingEntry: " << pending_entry_;
entries_.push_back(pending_entry_);
EXPECT_TRUE(entries_.back().IsComplete());
pending_entry_.Clear();
diff --git a/http2/hpack/decoder/hpack_block_decoder.cc b/http2/hpack/decoder/hpack_block_decoder.cc
index c6882d2..656f8e9 100644
--- a/http2/hpack/decoder/hpack_block_decoder.cc
+++ b/http2/hpack/decoder/hpack_block_decoder.cc
@@ -6,15 +6,15 @@
#include <cstdint>
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
namespace http2 {
DecodeStatus HpackBlockDecoder::Decode(DecodeBuffer* db) {
if (!before_entry_) {
- DVLOG(2) << "HpackBlockDecoder::Decode resume entry, db->Remaining="
- << db->Remaining();
+ HTTP2_DVLOG(2) << "HpackBlockDecoder::Decode resume entry, db->Remaining="
+ << db->Remaining();
DecodeStatus status = entry_decoder_.Resume(db, listener_);
switch (status) {
case DecodeStatus::kDecodeDone:
@@ -29,8 +29,8 @@
}
DCHECK(before_entry_);
while (db->HasData()) {
- DVLOG(2) << "HpackBlockDecoder::Decode start entry, db->Remaining="
- << db->Remaining();
+ HTTP2_DVLOG(2) << "HpackBlockDecoder::Decode start entry, db->Remaining="
+ << db->Remaining();
DecodeStatus status = entry_decoder_.Start(db, listener_);
switch (status) {
case DecodeStatus::kDecodeDone:
diff --git a/http2/hpack/decoder/hpack_block_decoder.h b/http2/hpack/decoder/hpack_block_decoder.h
index e8b23e1..a17664f 100644
--- a/http2/hpack/decoder/hpack_block_decoder.h
+++ b/http2/hpack/decoder/hpack_block_decoder.h
@@ -10,12 +10,12 @@
// or dynamic table support, so table indices remain indices at this level.
// Reports the entries to an HpackEntryDecoderListener.
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -35,7 +35,7 @@
// to be called from an implementation of Http2FrameDecoderListener's
// OnHeadersStart or OnPushPromiseStart methods.
void Reset() {
- DVLOG(2) << "HpackBlockDecoder::Reset";
+ HTTP2_DVLOG(2) << "HpackBlockDecoder::Reset";
before_entry_ = true;
}
diff --git a/http2/hpack/decoder/hpack_decoder.cc b/http2/hpack/decoder/hpack_decoder.cc
index d6897cb..f2f8584 100644
--- a/http2/hpack/decoder/hpack_decoder.cc
+++ b/http2/hpack/decoder/hpack_decoder.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
@@ -33,8 +33,8 @@
}
bool HpackDecoder::StartDecodingBlock() {
- DVLOG(3) << "HpackDecoder::StartDecodingBlock, error_detected="
- << (error_detected() ? "true" : "false");
+ HTTP2_DVLOG(3) << "HpackDecoder::StartDecodingBlock, error_detected="
+ << (error_detected() ? "true" : "false");
if (error_detected()) {
return false;
}
@@ -47,9 +47,9 @@
}
bool HpackDecoder::DecodeFragment(DecodeBuffer* db) {
- DVLOG(3) << "HpackDecoder::DecodeFragment, error_detected="
- << (error_detected() ? "true" : "false")
- << ", size=" << db->Remaining();
+ HTTP2_DVLOG(3) << "HpackDecoder::DecodeFragment, error_detected="
+ << (error_detected() ? "true" : "false")
+ << ", size=" << db->Remaining();
if (error_detected()) {
return false;
}
@@ -74,8 +74,8 @@
}
bool HpackDecoder::EndDecodingBlock() {
- DVLOG(3) << "HpackDecoder::EndDecodingBlock, error_detected="
- << (error_detected() ? "true" : "false");
+ HTTP2_DVLOG(3) << "HpackDecoder::EndDecodingBlock, error_detected="
+ << (error_detected() ? "true" : "false");
if (error_detected()) {
return false;
}
@@ -95,10 +95,10 @@
bool HpackDecoder::error_detected() {
if (!error_detected_) {
if (entry_buffer_.error_detected()) {
- DVLOG(2) << "HpackDecoder::error_detected in entry_buffer_";
+ HTTP2_DVLOG(2) << "HpackDecoder::error_detected in entry_buffer_";
error_detected_ = true;
} else if (decoder_state_.error_detected()) {
- DVLOG(2) << "HpackDecoder::error_detected in decoder_state_";
+ HTTP2_DVLOG(2) << "HpackDecoder::error_detected in decoder_state_";
error_detected_ = true;
}
}
@@ -110,9 +110,9 @@
}
void HpackDecoder::ReportError(Http2StringPiece error_message) {
- DVLOG(3) << "HpackDecoder::ReportError is new="
- << (!error_detected_ ? "true" : "false")
- << ", error_message: " << error_message;
+ HTTP2_DVLOG(3) << "HpackDecoder::ReportError is new="
+ << (!error_detected_ ? "true" : "false")
+ << ", error_message: " << error_message;
if (!error_detected_) {
error_detected_ = true;
decoder_state_.listener()->OnHeaderErrorDetected(error_message);
diff --git a/http2/hpack/decoder/hpack_decoder_state.cc b/http2/hpack/decoder/hpack_decoder_state.cc
index 2ddf421..921d48c 100644
--- a/http2/hpack/decoder/hpack_decoder_state.cc
+++ b/http2/hpack/decoder/hpack_decoder_state.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -41,21 +41,21 @@
void HpackDecoderState::ApplyHeaderTableSizeSetting(
uint32_t header_table_size) {
- DVLOG(2) << "HpackDecoderState::ApplyHeaderTableSizeSetting("
- << header_table_size << ")";
+ HTTP2_DVLOG(2) << "HpackDecoderState::ApplyHeaderTableSizeSetting("
+ << header_table_size << ")";
DCHECK_LE(lowest_header_table_size_, final_header_table_size_);
if (header_table_size < lowest_header_table_size_) {
lowest_header_table_size_ = header_table_size;
}
final_header_table_size_ = header_table_size;
- DVLOG(2) << "low water mark: " << lowest_header_table_size_;
- DVLOG(2) << "final limit: " << final_header_table_size_;
+ HTTP2_DVLOG(2) << "low water mark: " << lowest_header_table_size_;
+ HTTP2_DVLOG(2) << "final limit: " << final_header_table_size_;
}
// Called to notify this object that we're starting to decode an HPACK block
// (e.g. a HEADERS or PUSH_PROMISE frame's header has been decoded).
void HpackDecoderState::OnHeaderBlockStart() {
- DVLOG(2) << "HpackDecoderState::OnHeaderBlockStart";
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnHeaderBlockStart";
// This instance can't be reused after an error has been detected, as we must
// assume that the encoder and decoder compression states are no longer
// synchronized.
@@ -72,14 +72,14 @@
(lowest_header_table_size_ <
decoder_tables_.current_header_table_size() ||
final_header_table_size_ < decoder_tables_.header_table_size_limit());
- DVLOG(2) << "HpackDecoderState::OnHeaderListStart "
- << "require_dynamic_table_size_update_="
- << require_dynamic_table_size_update_;
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnHeaderListStart "
+ << "require_dynamic_table_size_update_="
+ << require_dynamic_table_size_update_;
listener_->OnHeaderListStart();
}
void HpackDecoderState::OnIndexedHeader(size_t index) {
- DVLOG(2) << "HpackDecoderState::OnIndexedHeader: " << index;
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnIndexedHeader: " << index;
if (error_detected_) {
return;
}
@@ -101,8 +101,9 @@
HpackEntryType entry_type,
size_t name_index,
HpackDecoderStringBuffer* value_buffer) {
- DVLOG(2) << "HpackDecoderState::OnNameIndexAndLiteralValue " << entry_type
- << ", " << name_index << ", " << value_buffer->str();
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnNameIndexAndLiteralValue "
+ << entry_type << ", " << name_index << ", "
+ << value_buffer->str();
if (error_detected_) {
return;
}
@@ -127,8 +128,8 @@
HpackEntryType entry_type,
HpackDecoderStringBuffer* name_buffer,
HpackDecoderStringBuffer* value_buffer) {
- DVLOG(2) << "HpackDecoderState::OnLiteralNameAndValue " << entry_type << ", "
- << name_buffer->str() << ", " << value_buffer->str();
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnLiteralNameAndValue " << entry_type
+ << ", " << name_buffer->str() << ", " << value_buffer->str();
if (error_detected_) {
return;
}
@@ -146,11 +147,11 @@
}
void HpackDecoderState::OnDynamicTableSizeUpdate(size_t size_limit) {
- DVLOG(2) << "HpackDecoderState::OnDynamicTableSizeUpdate " << size_limit
- << ", required="
- << (require_dynamic_table_size_update_ ? "true" : "false")
- << ", allowed="
- << (allow_dynamic_table_size_update_ ? "true" : "false");
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnDynamicTableSizeUpdate " << size_limit
+ << ", required="
+ << (require_dynamic_table_size_update_ ? "true" : "false")
+ << ", allowed="
+ << (allow_dynamic_table_size_update_ ? "true" : "false");
if (error_detected_) {
return;
}
@@ -185,14 +186,14 @@
}
void HpackDecoderState::OnHpackDecodeError(Http2StringPiece error_message) {
- DVLOG(2) << "HpackDecoderState::OnHpackDecodeError " << error_message;
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnHpackDecodeError " << error_message;
if (!error_detected_) {
ReportError(error_message);
}
}
void HpackDecoderState::OnHeaderBlockEnd() {
- DVLOG(2) << "HpackDecoderState::OnHeaderBlockEnd";
+ HTTP2_DVLOG(2) << "HpackDecoderState::OnHeaderBlockEnd";
if (error_detected_) {
return;
}
@@ -206,9 +207,9 @@
}
void HpackDecoderState::ReportError(Http2StringPiece error_message) {
- DVLOG(2) << "HpackDecoderState::ReportError is new="
- << (!error_detected_ ? "true" : "false")
- << ", error_message: " << error_message;
+ HTTP2_DVLOG(2) << "HpackDecoderState::ReportError is new="
+ << (!error_detected_ ? "true" : "false")
+ << ", error_message: " << error_message;
if (!error_detected_) {
listener_->OnHeaderErrorDetected(error_message);
error_detected_ = true;
diff --git a/http2/hpack/decoder/hpack_decoder_state_test.cc b/http2/hpack/decoder/hpack_decoder_state_test.cc
index 115827e..cbc4224 100644
--- a/http2/hpack/decoder/hpack_decoder_state_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_state_test.cc
@@ -9,12 +9,12 @@
#include <utility>
#include <vector>
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index b20c37a..76431a6 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -6,9 +6,9 @@
#include <utility>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -57,12 +57,12 @@
HpackDecoderStringBuffer::~HpackDecoderStringBuffer() = default;
void HpackDecoderStringBuffer::Reset() {
- DVLOG(3) << "HpackDecoderStringBuffer::Reset";
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::Reset";
state_ = State::RESET;
}
void HpackDecoderStringBuffer::Set(Http2StringPiece value, bool is_static) {
- DVLOG(2) << "HpackDecoderStringBuffer::Set";
+ HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::Set";
DCHECK_EQ(state_, State::RESET);
value_ = value;
state_ = State::COMPLETE;
@@ -73,7 +73,7 @@
}
void HpackDecoderStringBuffer::OnStart(bool huffman_encoded, size_t len) {
- DVLOG(2) << "HpackDecoderStringBuffer::OnStart";
+ HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnStart";
DCHECK_EQ(state_, State::RESET);
remaining_len_ = len;
@@ -106,8 +106,8 @@
}
bool HpackDecoderStringBuffer::OnData(const char* data, size_t len) {
- DVLOG(2) << "HpackDecoderStringBuffer::OnData state=" << state_
- << ", backing=" << backing_;
+ HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnData state=" << state_
+ << ", backing=" << backing_;
DCHECK_EQ(state_, State::COLLECTING);
DCHECK_LE(len, remaining_len_);
remaining_len_ -= len;
@@ -145,7 +145,7 @@
}
bool HpackDecoderStringBuffer::OnEnd() {
- DVLOG(2) << "HpackDecoderStringBuffer::OnEnd";
+ HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::OnEnd";
DCHECK_EQ(state_, State::COLLECTING);
DCHECK_EQ(0u, remaining_len_);
@@ -164,11 +164,12 @@
}
void HpackDecoderStringBuffer::BufferStringIfUnbuffered() {
- DVLOG(3) << "HpackDecoderStringBuffer::BufferStringIfUnbuffered state="
- << state_ << ", backing=" << backing_;
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::BufferStringIfUnbuffered state="
+ << state_ << ", backing=" << backing_;
if (state_ != State::RESET && backing_ == Backing::UNBUFFERED) {
- DVLOG(2) << "HpackDecoderStringBuffer buffering Http2String of length "
- << value_.size();
+ HTTP2_DVLOG(2)
+ << "HpackDecoderStringBuffer buffering Http2String of length "
+ << value_.size();
buffer_.assign(value_.data(), value_.size());
if (state_ == State::COMPLETE) {
value_ = buffer_;
@@ -178,23 +179,23 @@
}
bool HpackDecoderStringBuffer::IsBuffered() const {
- DVLOG(3) << "HpackDecoderStringBuffer::IsBuffered";
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::IsBuffered";
return state_ != State::RESET && backing_ == Backing::BUFFERED;
}
size_t HpackDecoderStringBuffer::BufferedLength() const {
- DVLOG(3) << "HpackDecoderStringBuffer::BufferedLength";
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::BufferedLength";
return IsBuffered() ? buffer_.size() : 0;
}
Http2StringPiece HpackDecoderStringBuffer::str() const {
- DVLOG(3) << "HpackDecoderStringBuffer::str";
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::str";
DCHECK_EQ(state_, State::COMPLETE);
return value_;
}
Http2String HpackDecoderStringBuffer::ReleaseString() {
- DVLOG(3) << "HpackDecoderStringBuffer::ReleaseString";
+ HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::ReleaseString";
DCHECK_EQ(state_, State::COMPLETE);
DCHECK_EQ(backing_, Backing::BUFFERED);
if (state_ == State::COMPLETE) {
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
index 009b894..11b0d97 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -8,9 +8,9 @@
#include <initializer_list>
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
@@ -31,10 +31,10 @@
State state() const { return buf_.state_for_testing(); }
Backing backing() const { return buf_.backing_for_testing(); }
- // We want to know that LOG(x) << buf_ will work in production should that
- // be needed, so we test that it outputs the expected values.
+ // We want to know that HTTP2_LOG(x) << buf_ will work in production should
+ // that be needed, so we test that it outputs the expected values.
AssertionResult VerifyLogHasSubstrs(std::initializer_list<Http2String> strs) {
- VLOG(1) << buf_;
+ HTTP2_VLOG(1) << buf_;
std::ostringstream ss;
buf_.OutputDebugStringTo(ss);
Http2String dbg_str(ss.str());
@@ -54,7 +54,7 @@
EXPECT_TRUE(VerifyLogHasSubstrs({"state=RESET"}));
buf_.Set(data, /*is_static*/ true);
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(state(), State::COMPLETE);
EXPECT_EQ(backing(), Backing::STATIC);
EXPECT_EQ(data, buf_.str());
@@ -75,13 +75,13 @@
TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
Http2StringPiece data("some text.");
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ false, data.size());
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::RESET);
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_TRUE(buf_.OnData(data.data(), data.size()));
EXPECT_EQ(state(), State::COLLECTING);
@@ -101,7 +101,7 @@
// Now force it to buffer the string, after which it will still have the same
// string value, but the backing store will be different.
buf_.BufferStringIfUnbuffered();
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(buf_.BufferedLength(), data.size());
EXPECT_EQ(data, buf_.str());
@@ -126,7 +126,7 @@
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(buf_.BufferedLength(), part1.size());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_TRUE(buf_.OnData(part2.data(), part2.size()));
EXPECT_EQ(state(), State::COLLECTING);
@@ -137,7 +137,7 @@
EXPECT_EQ(state(), State::COMPLETE);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(buf_.BufferedLength(), data.size());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
Http2StringPiece buffered = buf_.str();
EXPECT_EQ(data, buffered);
@@ -188,31 +188,31 @@
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(0u, buf_.BufferedLength());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_TRUE(buf_.OnData(part1.data(), part1.size()));
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_GT(buf_.BufferedLength(), 0u);
EXPECT_LT(buf_.BufferedLength(), decoded.size());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_TRUE(buf_.OnData(part2.data(), part2.size()));
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(buf_.BufferedLength(), decoded.size());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
EXPECT_TRUE(buf_.OnEnd());
EXPECT_EQ(state(), State::COMPLETE);
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_EQ(buf_.BufferedLength(), decoded.size());
EXPECT_EQ(decoded, buf_.str());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
buf_.Reset();
EXPECT_EQ(state(), State::RESET);
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
}
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnData) {
@@ -226,7 +226,7 @@
EXPECT_EQ(state(), State::COLLECTING);
EXPECT_EQ(backing(), Backing::BUFFERED);
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
}
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnEnd) {
@@ -241,7 +241,7 @@
EXPECT_EQ(backing(), Backing::BUFFERED);
EXPECT_FALSE(buf_.OnEnd());
- LOG(INFO) << buf_;
+ HTTP2_LOG(INFO) << buf_;
}
// TODO(jamessynge): Add tests for ReleaseString().
diff --git a/http2/hpack/decoder/hpack_decoder_tables.cc b/http2/hpack/decoder/hpack_decoder_tables.cc
index c88648f..09a18a8 100644
--- a/http2/hpack/decoder/hpack_decoder_tables.cc
+++ b/http2/hpack/decoder/hpack_decoder_tables.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace {
@@ -60,7 +60,8 @@
HpackDecoderDynamicTable::~HpackDecoderDynamicTable() = default;
void HpackDecoderDynamicTable::DynamicTableSizeUpdate(size_t size_limit) {
- DVLOG(3) << "HpackDecoderDynamicTable::DynamicTableSizeUpdate " << size_limit;
+ HTTP2_DVLOG(3) << "HpackDecoderDynamicTable::DynamicTableSizeUpdate "
+ << size_limit;
EnsureSizeNoMoreThan(size_limit);
DCHECK_LE(current_size_, size_limit);
size_limit_ = size_limit;
@@ -72,12 +73,12 @@
const HpackString& value) {
HpackDecoderTableEntry entry(name, value);
size_t entry_size = entry.size();
- DVLOG(2) << "InsertEntry of size=" << entry_size << "\n name: " << name
- << "\n value: " << value;
+ HTTP2_DVLOG(2) << "InsertEntry of size=" << entry_size
+ << "\n name: " << name << "\n value: " << value;
if (entry_size > size_limit_) {
- DVLOG(2) << "InsertEntry: entry larger than table, removing "
- << table_.size() << " entries, of total size " << current_size_
- << " bytes.";
+ HTTP2_DVLOG(2) << "InsertEntry: entry larger than table, removing "
+ << table_.size() << " entries, of total size "
+ << current_size_ << " bytes.";
table_.clear();
current_size_ = 0;
return false; // Not inserted because too large.
@@ -85,14 +86,14 @@
++insert_count_;
if (debug_listener_ != nullptr) {
entry.time_added = debug_listener_->OnEntryInserted(entry, insert_count_);
- DVLOG(2) << "OnEntryInserted returned time_added=" << entry.time_added
- << " for insert_count_=" << insert_count_;
+ HTTP2_DVLOG(2) << "OnEntryInserted returned time_added=" << entry.time_added
+ << " for insert_count_=" << insert_count_;
}
size_t insert_limit = size_limit_ - entry_size;
EnsureSizeNoMoreThan(insert_limit);
table_.push_front(entry);
current_size_ += entry_size;
- DVLOG(2) << "InsertEntry: current_size_=" << current_size_;
+ HTTP2_DVLOG(2) << "InsertEntry: current_size_=" << current_size_;
DCHECK_GE(current_size_, entry_size);
DCHECK_LE(current_size_, size_limit_);
return true;
@@ -112,8 +113,8 @@
}
void HpackDecoderDynamicTable::EnsureSizeNoMoreThan(size_t limit) {
- DVLOG(2) << "EnsureSizeNoMoreThan limit=" << limit
- << ", current_size_=" << current_size_;
+ HTTP2_DVLOG(2) << "EnsureSizeNoMoreThan limit=" << limit
+ << ", current_size_=" << current_size_;
// Not the most efficient choice, but any easy way to start.
while (current_size_ > limit) {
RemoveLastEntry();
@@ -124,8 +125,8 @@
void HpackDecoderDynamicTable::RemoveLastEntry() {
DCHECK(!table_.empty());
if (!table_.empty()) {
- DVLOG(2) << "RemoveLastEntry current_size_=" << current_size_
- << ", last entry size=" << table_.back().size();
+ HTTP2_DVLOG(2) << "RemoveLastEntry current_size_=" << current_size_
+ << ", last entry size=" << table_.back().size();
DCHECK_GE(current_size_, table_.back().size());
current_size_ -= table_.back().size();
table_.pop_back();
diff --git a/http2/hpack/decoder/hpack_decoder_tables_test.cc b/http2/hpack/decoder/hpack_decoder_tables_test.cc
index a54fa5f..592ce56 100644
--- a/http2/hpack/decoder/hpack_decoder_tables_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_tables_test.cc
@@ -8,10 +8,10 @@
#include <tuple>
#include <vector>
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
diff --git a/http2/hpack/decoder/hpack_decoder_test.cc b/http2/hpack/decoder/hpack_decoder_test.cc
index 83a0ede..bf2cee5 100644
--- a/http2/hpack/decoder/hpack_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_test.cc
@@ -10,7 +10,6 @@
#include <utility>
#include <vector>
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
@@ -22,6 +21,7 @@
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_example.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -130,7 +130,7 @@
}
AssertionResult DecodeBlock(Http2StringPiece block) {
- VLOG(1) << "HpackDecoderTest::DecodeBlock";
+ HTTP2_VLOG(1) << "HpackDecoderTest::DecodeBlock";
VERIFY_FALSE(decoder_.error_detected());
VERIFY_TRUE(error_messages_.empty());
diff --git a/http2/hpack/decoder/hpack_entry_collector.cc b/http2/hpack/decoder/hpack_entry_collector.cc
index 9d17465..327075d 100644
--- a/http2/hpack/decoder/hpack_entry_collector.cc
+++ b/http2/hpack/decoder/hpack_entry_collector.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h"
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
diff --git a/http2/hpack/decoder/hpack_entry_decoder.cc b/http2/hpack/decoder/hpack_entry_decoder.cc
index 96b9f06..5e1bd8c 100644
--- a/http2/hpack/decoder/hpack_entry_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_decoder.cc
@@ -8,9 +8,8 @@
#include <cstdint>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
namespace http2 {
@@ -98,7 +97,8 @@
switch (state_) {
case EntryDecoderState::kResumeDecodingType:
// entry_type_decoder_ returned kDecodeInProgress when last called.
- DVLOG(1) << "kResumeDecodingType: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kResumeDecodingType: db->Remaining="
+ << db->Remaining();
status = entry_type_decoder_.Resume(db);
if (status != DecodeStatus::kDecodeDone) {
return status;
@@ -109,7 +109,7 @@
case EntryDecoderState::kDecodedType:
// entry_type_decoder_ returned kDecodeDone, now need to decide how
// to proceed.
- DVLOG(1) << "kDecodedType: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kDecodedType: db->Remaining=" << db->Remaining();
if (DispatchOnType(listener)) {
// All done.
return DecodeStatus::kDecodeDone;
@@ -117,7 +117,8 @@
continue;
case EntryDecoderState::kStartDecodingName:
- DVLOG(1) << "kStartDecodingName: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kStartDecodingName: db->Remaining="
+ << db->Remaining();
{
NameDecoderListener ncb(listener);
status = string_decoder_.Start(db, &ncb);
@@ -134,7 +135,8 @@
HTTP2_FALLTHROUGH;
case EntryDecoderState::kStartDecodingValue:
- DVLOG(1) << "kStartDecodingValue: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kStartDecodingValue: db->Remaining="
+ << db->Remaining();
{
ValueDecoderListener vcb(listener);
status = string_decoder_.Start(db, &vcb);
@@ -153,7 +155,8 @@
case EntryDecoderState::kResumeDecodingName:
// The literal name was split across decode buffers.
- DVLOG(1) << "kResumeDecodingName: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kResumeDecodingName: db->Remaining="
+ << db->Remaining();
{
NameDecoderListener ncb(listener);
status = string_decoder_.Resume(db, &ncb);
@@ -171,7 +174,8 @@
case EntryDecoderState::kResumeDecodingValue:
// The literal value was split across decode buffers.
- DVLOG(1) << "kResumeDecodingValue: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(1) << "kResumeDecodingValue: db->Remaining="
+ << db->Remaining();
{
ValueDecoderListener vcb(listener);
status = string_decoder_.Resume(db, &vcb);
diff --git a/http2/hpack/decoder/hpack_entry_decoder.h b/http2/hpack/decoder/hpack_entry_decoder.h
index fe59d96..5858c1e 100644
--- a/http2/hpack/decoder/hpack_entry_decoder.h
+++ b/http2/hpack/decoder/hpack_entry_decoder.h
@@ -10,7 +10,6 @@
// must provide a non-empty decode buffer. Continue with calls to Resume() if
// Start, and any subsequent calls to Resume, returns kDecodeInProgress.
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
@@ -18,6 +17,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
diff --git a/http2/hpack/decoder/hpack_entry_decoder_listener.cc b/http2/hpack/decoder/hpack_entry_decoder_listener.cc
index b783b15..a0571c4 100644
--- a/http2/hpack/decoder/hpack_entry_decoder_listener.cc
+++ b/http2/hpack/decoder/hpack_entry_decoder_listener.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
void HpackEntryDecoderVLoggingListener::OnIndexedHeader(size_t index) {
- VLOG(1) << "OnIndexedHeader, index=" << index;
+ HTTP2_VLOG(1) << "OnIndexedHeader, index=" << index;
if (wrapped_) {
wrapped_->OnIndexedHeader(index);
}
@@ -18,8 +18,8 @@
void HpackEntryDecoderVLoggingListener::OnStartLiteralHeader(
HpackEntryType entry_type,
size_t maybe_name_index) {
- VLOG(1) << "OnStartLiteralHeader: entry_type=" << entry_type
- << ", maybe_name_index=" << maybe_name_index;
+ HTTP2_VLOG(1) << "OnStartLiteralHeader: entry_type=" << entry_type
+ << ", maybe_name_index=" << maybe_name_index;
if (wrapped_) {
wrapped_->OnStartLiteralHeader(entry_type, maybe_name_index);
}
@@ -27,7 +27,7 @@
void HpackEntryDecoderVLoggingListener::OnNameStart(bool huffman_encoded,
size_t len) {
- VLOG(1) << "OnNameStart: H=" << huffman_encoded << ", len=" << len;
+ HTTP2_VLOG(1) << "OnNameStart: H=" << huffman_encoded << ", len=" << len;
if (wrapped_) {
wrapped_->OnNameStart(huffman_encoded, len);
}
@@ -35,14 +35,14 @@
void HpackEntryDecoderVLoggingListener::OnNameData(const char* data,
size_t len) {
- VLOG(1) << "OnNameData: len=" << len;
+ HTTP2_VLOG(1) << "OnNameData: len=" << len;
if (wrapped_) {
wrapped_->OnNameData(data, len);
}
}
void HpackEntryDecoderVLoggingListener::OnNameEnd() {
- VLOG(1) << "OnNameEnd";
+ HTTP2_VLOG(1) << "OnNameEnd";
if (wrapped_) {
wrapped_->OnNameEnd();
}
@@ -50,7 +50,7 @@
void HpackEntryDecoderVLoggingListener::OnValueStart(bool huffman_encoded,
size_t len) {
- VLOG(1) << "OnValueStart: H=" << huffman_encoded << ", len=" << len;
+ HTTP2_VLOG(1) << "OnValueStart: H=" << huffman_encoded << ", len=" << len;
if (wrapped_) {
wrapped_->OnValueStart(huffman_encoded, len);
}
@@ -58,21 +58,21 @@
void HpackEntryDecoderVLoggingListener::OnValueData(const char* data,
size_t len) {
- VLOG(1) << "OnValueData: len=" << len;
+ HTTP2_VLOG(1) << "OnValueData: len=" << len;
if (wrapped_) {
wrapped_->OnValueData(data, len);
}
}
void HpackEntryDecoderVLoggingListener::OnValueEnd() {
- VLOG(1) << "OnValueEnd";
+ HTTP2_VLOG(1) << "OnValueEnd";
if (wrapped_) {
wrapped_->OnValueEnd();
}
}
void HpackEntryDecoderVLoggingListener::OnDynamicTableSizeUpdate(size_t size) {
- VLOG(1) << "OnDynamicTableSizeUpdate: size=" << size;
+ HTTP2_VLOG(1) << "OnDynamicTableSizeUpdate: size=" << size;
if (wrapped_) {
wrapped_->OnDynamicTableSizeUpdate(size);
}
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.cc b/http2/hpack/decoder/hpack_entry_type_decoder.cc
index 121e3d0..7519f5a 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_type_decoder.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
namespace http2 {
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.h b/http2/hpack/decoder/hpack_entry_type_decoder.h
index 79898be..092a844 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder.h
+++ b/http2/hpack/decoder/hpack_entry_type_decoder.h
@@ -12,12 +12,12 @@
#include <cstdint>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder_test.cc b/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
index afff7cc..60248f3 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
@@ -6,9 +6,9 @@
#include <vector>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
diff --git a/http2/hpack/decoder/hpack_string_decoder.h b/http2/hpack/decoder/hpack_string_decoder.h
index 2128728..e30b36d 100644
--- a/http2/hpack/decoder/hpack_string_decoder.h
+++ b/http2/hpack/decoder/hpack_string_decoder.h
@@ -14,12 +14,11 @@
#include <algorithm>
#include <cstdint>
-#include "base/logging.h"
-#include "base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
@@ -82,7 +81,8 @@
while (true) {
switch (state_) {
case kStartDecodingLength:
- DVLOG(2) << "kStartDecodingLength: db->Remaining=" << db->Remaining();
+ HTTP2_DVLOG(2) << "kStartDecodingLength: db->Remaining="
+ << db->Remaining();
if (!StartDecodingLength(db, cb, &status)) {
// The length is split across decode buffers.
return status;
@@ -99,13 +99,13 @@
HTTP2_FALLTHROUGH;
case kDecodingString:
- DVLOG(2) << "kDecodingString: db->Remaining=" << db->Remaining()
- << " remaining_=" << remaining_;
+ HTTP2_DVLOG(2) << "kDecodingString: db->Remaining=" << db->Remaining()
+ << " remaining_=" << remaining_;
return DecodeString(db, cb);
case kResumeDecodingLength:
- DVLOG(2) << "kResumeDecodingLength: db->Remaining="
- << db->Remaining();
+ HTTP2_DVLOG(2) << "kResumeDecodingLength: db->Remaining="
+ << db->Remaining();
if (!ResumeDecodingLength(db, cb, &status)) {
return status;
}
diff --git a/http2/hpack/decoder/hpack_string_decoder_listener.cc b/http2/hpack/decoder/hpack_string_decoder_listener.cc
index e0fbc65..7a132e4 100644
--- a/http2/hpack/decoder/hpack_string_decoder_listener.cc
+++ b/http2/hpack/decoder/hpack_string_decoder_listener.cc
@@ -4,14 +4,14 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.h"
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace test {
void HpackStringDecoderVLoggingListener::OnStringStart(bool huffman_encoded,
size_t len) {
- VLOG(1) << "OnStringStart: H=" << huffman_encoded << ", len=" << len;
+ HTTP2_VLOG(1) << "OnStringStart: H=" << huffman_encoded << ", len=" << len;
if (wrapped_) {
wrapped_->OnStringStart(huffman_encoded, len);
}
@@ -19,14 +19,14 @@
void HpackStringDecoderVLoggingListener::OnStringData(const char* data,
size_t len) {
- VLOG(1) << "OnStringData: len=" << len;
+ HTTP2_VLOG(1) << "OnStringData: len=" << len;
if (wrapped_) {
return wrapped_->OnStringData(data, len);
}
}
void HpackStringDecoderVLoggingListener::OnStringEnd() {
- VLOG(1) << "OnStringEnd";
+ HTTP2_VLOG(1) << "OnStringEnd";
if (wrapped_) {
return wrapped_->OnStringEnd();
}
diff --git a/http2/hpack/decoder/hpack_string_decoder_test.cc b/http2/hpack/decoder/hpack_string_decoder_test.cc
index 349b649..5346999 100644
--- a/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -38,13 +38,13 @@
DecodeStatus ResumeDecoding(DecodeBuffer* b) override {
// Provides coverage of DebugString and StateToString.
// Not validating output.
- VLOG(1) << decoder_.DebugString();
- VLOG(2) << collector_;
+ HTTP2_VLOG(1) << decoder_.DebugString();
+ HTTP2_VLOG(2) << collector_;
return decoder_.Resume(b, &listener_);
}
AssertionResult Collected(Http2StringPiece s, bool huffman_encoded) {
- VLOG(1) << collector_;
+ HTTP2_VLOG(1) << collector_;
return collector_.Collected(s, huffman_encoded);
}
@@ -64,9 +64,9 @@
VERIFY_NE(collector_,
HpackStringCollector(expected_str, expected_huffman));
}
- VLOG(2) << collector_.ToString();
+ HTTP2_VLOG(2) << collector_.ToString();
collector_.Clear();
- VLOG(2) << collector_;
+ HTTP2_VLOG(2) << collector_;
return result;
};
}
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
index b3e29b1..dea6698 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
@@ -37,26 +37,26 @@
}
void HpackWholeEntryBuffer::OnIndexedHeader(size_t index) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnIndexedHeader: index=" << index;
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnIndexedHeader: index=" << index;
listener_->OnIndexedHeader(index);
}
void HpackWholeEntryBuffer::OnStartLiteralHeader(HpackEntryType entry_type,
size_t maybe_name_index) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnStartLiteralHeader: entry_type="
- << entry_type << ", maybe_name_index=" << maybe_name_index;
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnStartLiteralHeader: entry_type="
+ << entry_type << ", maybe_name_index=" << maybe_name_index;
entry_type_ = entry_type;
maybe_name_index_ = maybe_name_index;
}
void HpackWholeEntryBuffer::OnNameStart(bool huffman_encoded, size_t len) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnNameStart: huffman_encoded="
- << (huffman_encoded ? "true" : "false") << ", len=" << len;
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameStart: huffman_encoded="
+ << (huffman_encoded ? "true" : "false") << ", len=" << len;
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_) {
if (len > max_string_size_bytes_) {
- DVLOG(1) << "Name length (" << len << ") is longer than permitted ("
- << max_string_size_bytes_ << ")";
+ HTTP2_DVLOG(1) << "Name length (" << len << ") is longer than permitted ("
+ << max_string_size_bytes_ << ")";
ReportError("HPACK entry name size is too long.");
return;
}
@@ -65,8 +65,9 @@
}
void HpackWholeEntryBuffer::OnNameData(const char* data, size_t len) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len << " data:\n"
- << Http2HexDump(Http2StringPiece(data, len));
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len
+ << " data:\n"
+ << Http2HexDump(Http2StringPiece(data, len));
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnData(data, len)) {
ReportError("Error decoding HPACK entry name.");
@@ -74,7 +75,7 @@
}
void HpackWholeEntryBuffer::OnNameEnd() {
- DVLOG(2) << "HpackWholeEntryBuffer::OnNameEnd";
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameEnd";
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnEnd()) {
ReportError("Error decoding HPACK entry name.");
@@ -82,12 +83,13 @@
}
void HpackWholeEntryBuffer::OnValueStart(bool huffman_encoded, size_t len) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnValueStart: huffman_encoded="
- << (huffman_encoded ? "true" : "false") << ", len=" << len;
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueStart: huffman_encoded="
+ << (huffman_encoded ? "true" : "false") << ", len=" << len;
if (!error_detected_) {
if (len > max_string_size_bytes_) {
- DVLOG(1) << "Value length (" << len << ") is longer than permitted ("
- << max_string_size_bytes_ << ")";
+ HTTP2_DVLOG(1) << "Value length (" << len
+ << ") is longer than permitted (" << max_string_size_bytes_
+ << ")";
ReportError("HPACK entry value size is too long.");
return;
}
@@ -96,15 +98,16 @@
}
void HpackWholeEntryBuffer::OnValueData(const char* data, size_t len) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnValueData: len=" << len << " data:\n"
- << Http2HexDump(Http2StringPiece(data, len));
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueData: len=" << len
+ << " data:\n"
+ << Http2HexDump(Http2StringPiece(data, len));
if (!error_detected_ && !value_.OnData(data, len)) {
ReportError("Error decoding HPACK entry value.");
}
}
void HpackWholeEntryBuffer::OnValueEnd() {
- DVLOG(2) << "HpackWholeEntryBuffer::OnValueEnd";
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueEnd";
if (error_detected_) {
return;
}
@@ -123,13 +126,14 @@
}
void HpackWholeEntryBuffer::OnDynamicTableSizeUpdate(size_t size) {
- DVLOG(2) << "HpackWholeEntryBuffer::OnDynamicTableSizeUpdate: size=" << size;
+ HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnDynamicTableSizeUpdate: size="
+ << size;
listener_->OnDynamicTableSizeUpdate(size);
}
void HpackWholeEntryBuffer::ReportError(Http2StringPiece error_message) {
if (!error_detected_) {
- DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << error_message;
+ HTTP2_DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << error_message;
error_detected_ = true;
listener_->OnHpackDecodeError(error_message);
listener_ = HpackWholeEntryNoOpListener::NoOpListener();
diff --git a/http2/hpack/hpack_string.cc b/http2/hpack/hpack_string.cc
index 58bb821..957cffa 100644
--- a/http2/hpack/hpack_string.cc
+++ b/http2/hpack/hpack_string.cc
@@ -6,7 +6,7 @@
#include <utility>
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
namespace http2 {
@@ -47,16 +47,16 @@
HpackStringPair::HpackStringPair(const HpackString& name,
const HpackString& value)
: name(name), value(value) {
- DVLOG(3) << DebugString() << " ctor";
+ HTTP2_DVLOG(3) << DebugString() << " ctor";
}
HpackStringPair::HpackStringPair(Http2StringPiece name, Http2StringPiece value)
: name(name), value(value) {
- DVLOG(3) << DebugString() << " ctor";
+ HTTP2_DVLOG(3) << DebugString() << " ctor";
}
HpackStringPair::~HpackStringPair() {
- DVLOG(3) << DebugString() << " dtor";
+ HTTP2_DVLOG(3) << DebugString() << " dtor";
}
Http2String HpackStringPair::DebugString() const {
diff --git a/http2/hpack/hpack_string_test.cc b/http2/hpack/hpack_string_test.cc
index 87f5975..898ef8d 100644
--- a/http2/hpack/hpack_string_test.cc
+++ b/http2/hpack/hpack_string_test.cc
@@ -8,8 +8,8 @@
#include <utility>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
using ::testing::AssertionFailure;
@@ -140,8 +140,8 @@
EXPECT_TRUE(VerifyEqual(&hs0, ""));
EXPECT_TRUE(VerifyNotEqual(&hs1, ""));
- LOG(INFO) << hs0;
- LOG(INFO) << hs1;
+ HTTP2_LOG(INFO) << hs0;
+ HTTP2_LOG(INFO) << hs1;
}
} // namespace
diff --git a/http2/hpack/http2_hpack_constants_test.cc b/http2/hpack/http2_hpack_constants_test.cc
index 5b20b18..54cb9a3 100644
--- a/http2/hpack/http2_hpack_constants_test.cc
+++ b/http2/hpack/http2_hpack_constants_test.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_mock_log.h"
namespace http2 {
@@ -33,37 +33,37 @@
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "kIndexedHeader");
- LOG(INFO) << HpackEntryType::kIndexedHeader;
+ HTTP2_LOG(INFO) << HpackEntryType::kIndexedHeader;
}
{
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "kDynamicTableSizeUpdate");
- LOG(INFO) << HpackEntryType::kDynamicTableSizeUpdate;
+ HTTP2_LOG(INFO) << HpackEntryType::kDynamicTableSizeUpdate;
}
{
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "kIndexedLiteralHeader");
- LOG(INFO) << HpackEntryType::kIndexedLiteralHeader;
+ HTTP2_LOG(INFO) << HpackEntryType::kIndexedLiteralHeader;
}
{
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "kUnindexedLiteralHeader");
- LOG(INFO) << HpackEntryType::kUnindexedLiteralHeader;
+ HTTP2_LOG(INFO) << HpackEntryType::kUnindexedLiteralHeader;
}
{
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "kNeverIndexedLiteralHeader");
- LOG(INFO) << HpackEntryType::kNeverIndexedLiteralHeader;
+ HTTP2_LOG(INFO) << HpackEntryType::kNeverIndexedLiteralHeader;
}
{
CREATE_HTTP2_MOCK_LOG(log);
log.StartCapturingLogs();
EXPECT_HTTP2_LOG_CALL_CONTAINS(log, INFO, "UnknownHpackEntryType(1234321)");
- LOG(INFO) << static_cast<HpackEntryType>(1234321);
+ HTTP2_LOG(INFO) << static_cast<HpackEntryType>(1234321);
}
}
diff --git a/http2/hpack/huffman/hpack_huffman_decoder.cc b/http2/hpack/huffman/hpack_huffman_decoder.cc
index d1076ed..e74ca14 100644
--- a/http2/hpack/huffman/hpack_huffman_decoder.cc
+++ b/http2/hpack/huffman/hpack_huffman_decoder.cc
@@ -7,7 +7,7 @@
#include <bitset>
#include <limits>
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
// Terminology:
//
@@ -415,13 +415,13 @@
HpackHuffmanDecoder::~HpackHuffmanDecoder() = default;
bool HpackHuffmanDecoder::Decode(Http2StringPiece input, Http2String* output) {
- DVLOG(1) << "HpackHuffmanDecoder::Decode";
+ HTTP2_DVLOG(1) << "HpackHuffmanDecoder::Decode";
// Fill bit_buffer_ from input.
input.remove_prefix(bit_buffer_.AppendBytes(input));
while (true) {
- DVLOG(3) << "Enter Decode Loop, bit_buffer_: " << bit_buffer_;
+ HTTP2_DVLOG(3) << "Enter Decode Loop, bit_buffer_: " << bit_buffer_;
if (bit_buffer_.count() >= 7) {
// Get high 7 bits of the bit buffer, see if that contains a complete
// code of 5, 6 or 7 bits.
@@ -447,10 +447,10 @@
}
HuffmanCode code_prefix = bit_buffer_.value() >> kExtraAccumulatorBitCount;
- DVLOG(3) << "code_prefix: " << HuffmanCodeBitSet(code_prefix);
+ HTTP2_DVLOG(3) << "code_prefix: " << HuffmanCodeBitSet(code_prefix);
PrefixInfo prefix_info = PrefixToInfo(code_prefix);
- DVLOG(3) << "prefix_info: " << prefix_info;
+ HTTP2_DVLOG(3) << "prefix_info: " << prefix_info;
DCHECK_LE(kMinCodeBitCount, prefix_info.code_length);
DCHECK_LE(prefix_info.code_length, kMaxCodeBitCount);
@@ -465,8 +465,8 @@
continue;
}
// Encoder is not supposed to explicity encode the EOS symbol.
- DLOG(ERROR) << "EOS explicitly encoded!\n " << bit_buffer_ << "\n "
- << prefix_info;
+ HTTP2_DLOG(ERROR) << "EOS explicitly encoded!\n " << bit_buffer_ << "\n "
+ << prefix_info;
return false;
}
// bit_buffer_ doesn't have enough bits in it to decode the next symbol.
diff --git a/http2/hpack/huffman/hpack_huffman_decoder_test.cc b/http2/hpack/huffman/hpack_huffman_decoder_test.cc
index 6c07ca5..30b586f 100644
--- a/http2/hpack/huffman/hpack_huffman_decoder_test.cc
+++ b/http2/hpack/huffman/hpack_huffman_decoder_test.cc
@@ -8,7 +8,6 @@
#include <iostream>
-#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
diff --git a/http2/hpack/huffman/hpack_huffman_encoder.cc b/http2/hpack/huffman/hpack_huffman_encoder.cc
index 9f561ee..a92a4c0 100644
--- a/http2/hpack/huffman/hpack_huffman_encoder.cc
+++ b/http2/hpack/huffman/hpack_huffman_encoder.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
// TODO(jamessynge): Remove use of binary literals, that is a C++ 14 feature.
diff --git a/http2/hpack/huffman/hpack_huffman_encoder_test.cc b/http2/hpack/huffman/hpack_huffman_encoder_test.cc
index ccb6983..2a8999f 100644
--- a/http2/hpack/huffman/hpack_huffman_encoder_test.cc
+++ b/http2/hpack/huffman/hpack_huffman_encoder_test.cc
@@ -4,7 +4,6 @@
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
-#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_arraysize.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
diff --git a/http2/hpack/tools/hpack_example.cc b/http2/hpack/tools/hpack_example.cc
index d20eb35..d7b8c7c 100644
--- a/http2/hpack/tools/hpack_example.cc
+++ b/http2/hpack/tools/hpack_example.cc
@@ -6,8 +6,8 @@
#include <ctype.h>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
namespace http2 {
diff --git a/http2/hpack/varint/hpack_varint_decoder.cc b/http2/hpack/varint/hpack_varint_decoder.cc
index ac85247..9741a23 100644
--- a/http2/hpack/varint/hpack_varint_decoder.cc
+++ b/http2/hpack/varint/hpack_varint_decoder.cc
@@ -103,8 +103,9 @@
}
// Signal error if value is too large or there are too many extension bytes.
- DLOG(WARNING) << "Variable length int encoding is too large or too long. "
- << DebugString();
+ HTTP2_DLOG(WARNING)
+ << "Variable length int encoding is too large or too long. "
+ << DebugString();
MarkDone();
return DecodeStatus::kDecodeError;
}
diff --git a/http2/hpack/varint/hpack_varint_decoder.h b/http2/hpack/varint/hpack_varint_decoder.h
index 5c99b5c..855ced4 100644
--- a/http2/hpack/varint/hpack_varint_decoder.h
+++ b/http2/hpack/varint/hpack_varint_decoder.h
@@ -30,10 +30,10 @@
#include <cstdint>
#include <limits>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
diff --git a/http2/hpack/varint/hpack_varint_decoder_test.cc b/http2/hpack/varint/hpack_varint_decoder_test.cc
index 2d589fd..1610126 100644
--- a/http2/hpack/varint/hpack_varint_decoder_test.cc
+++ b/http2/hpack/varint/hpack_varint_decoder_test.cc
@@ -8,9 +8,9 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_arraysize.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
@@ -108,7 +108,8 @@
};
INSTANTIATE_TEST_SUITE_P(
- HpackVarintDecoderTest, HpackVarintDecoderTest,
+ HpackVarintDecoderTest,
+ HpackVarintDecoderTest,
::testing::Combine(
// Bits of the first byte not part of the prefix should be ignored.
::testing::Values(0b00000000, 0b11111111, 0b10101010),
@@ -259,11 +260,11 @@
};
TEST_P(HpackVarintDecoderTest, Success) {
- for (size_t i = 0; i < HTTP2_ARRAYSIZE(kSuccessTestData); ++i) {
- DecodeExpectSuccess(Http2HexDecode(kSuccessTestData[i].data),
- kSuccessTestData[i].prefix_length,
- kSuccessTestData[i].expected_value);
- }
+ for (size_t i = 0; i < HTTP2_ARRAYSIZE(kSuccessTestData); ++i) {
+ DecodeExpectSuccess(Http2HexDecode(kSuccessTestData[i].data),
+ kSuccessTestData[i].prefix_length,
+ kSuccessTestData[i].expected_value);
+ }
}
struct {
@@ -300,10 +301,10 @@
{"ff80feffffffffffffff8100", 8}};
TEST_P(HpackVarintDecoderTest, Error) {
- for (size_t i = 0; i < HTTP2_ARRAYSIZE(kErrorTestData); ++i) {
- DecodeExpectError(Http2HexDecode(kErrorTestData[i].data),
- kErrorTestData[i].prefix_length);
- }
+ for (size_t i = 0; i < HTTP2_ARRAYSIZE(kErrorTestData); ++i) {
+ DecodeExpectError(Http2HexDecode(kErrorTestData[i].data),
+ kErrorTestData[i].prefix_length);
+ }
}
} // namespace
diff --git a/http2/hpack/varint/hpack_varint_encoder.cc b/http2/hpack/varint/hpack_varint_encoder.cc
index d3685d9..2e7ad3e 100644
--- a/http2/hpack/varint/hpack_varint_encoder.cc
+++ b/http2/hpack/varint/hpack_varint_encoder.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder.h"
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
diff --git a/http2/hpack/varint/hpack_varint_round_trip_test.cc b/http2/hpack/varint/hpack_varint_round_trip_test.cc
index cd26553..594317b 100644
--- a/http2/hpack/varint/hpack_varint_round_trip_test.cc
+++ b/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -13,9 +13,9 @@
#include <set>
#include <vector>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
@@ -167,9 +167,9 @@
Http2HexDump(buffer_));
if (value == minimum) {
- LOG(INFO) << "Checking minimum; " << msg;
+ HTTP2_LOG(INFO) << "Checking minimum; " << msg;
} else if (value == maximum) {
- LOG(INFO) << "Checking maximum; " << msg;
+ HTTP2_LOG(INFO) << "Checking maximum; " << msg;
}
SCOPED_TRACE(msg);
@@ -206,13 +206,15 @@
const uint8_t prefix_mask = (1 << prefix_length) - 1;
const uint64_t beyond = start + range;
- LOG(INFO) << "############################################################";
- LOG(INFO) << "prefix_length=" << static_cast<int>(prefix_length);
- LOG(INFO) << "prefix_mask=" << std::hex << static_cast<int>(prefix_mask);
- LOG(INFO) << "start=" << start << " (" << std::hex << start << ")";
- LOG(INFO) << "range=" << range << " (" << std::hex << range << ")";
- LOG(INFO) << "beyond=" << beyond << " (" << std::hex << beyond << ")";
- LOG(INFO) << "expected_bytes=" << expected_bytes;
+ HTTP2_LOG(INFO)
+ << "############################################################";
+ HTTP2_LOG(INFO) << "prefix_length=" << static_cast<int>(prefix_length);
+ HTTP2_LOG(INFO) << "prefix_mask=" << std::hex
+ << static_cast<int>(prefix_mask);
+ HTTP2_LOG(INFO) << "start=" << start << " (" << std::hex << start << ")";
+ HTTP2_LOG(INFO) << "range=" << range << " (" << std::hex << range << ")";
+ HTTP2_LOG(INFO) << "beyond=" << beyond << " (" << std::hex << beyond << ")";
+ HTTP2_LOG(INFO) << "expected_bytes=" << expected_bytes;
if (expected_bytes < 11) {
// Confirm the claim that beyond requires more bytes.
@@ -243,7 +245,7 @@
uint8_t prefix_length_;
};
-// To help me and future debuggers of varint encodings, this LOGs out the
+// To help me and future debuggers of varint encodings, this HTTP2_LOGs out the
// transition points where a new extension byte is added.
TEST_F(HpackVarintRoundTripTest, Encode) {
for (int prefix_length = 3; prefix_length <= 8; ++prefix_length) {
@@ -258,11 +260,12 @@
const uint64_t i = HiValueOfExtensionBytes(8, prefix_length);
const uint64_t j = HiValueOfExtensionBytes(9, prefix_length);
- LOG(INFO) << "############################################################";
- LOG(INFO) << "prefix_length=" << prefix_length << " a=" << a
- << " b=" << b << " c=" << c << " d=" << d << " e=" << e
- << " f=" << f << " g=" << g << " h=" << h << " i=" << i
- << " j=" << j;
+ HTTP2_LOG(INFO)
+ << "############################################################";
+ HTTP2_LOG(INFO) << "prefix_length=" << prefix_length << " a=" << a
+ << " b=" << b << " c=" << c << " d=" << d
+ << " e=" << e << " f=" << f << " g=" << g
+ << " h=" << h << " i=" << i << " j=" << j;
std::vector<uint64_t> values = {
0, 1, // Force line break.
@@ -281,8 +284,8 @@
for (uint64_t value : values) {
EncodeNoRandom(value, prefix_length);
Http2String dump = Http2HexDump(buffer_);
- LOG(INFO) << Http2StringPrintf("%10llu %0#18x ", value, value)
- << Http2HexDump(buffer_).substr(7);
+ HTTP2_LOG(INFO) << Http2StringPrintf("%10llu %0#18x ", value, value)
+ << Http2HexDump(buffer_).substr(7);
}
}
}
diff --git a/http2/http2_constants.cc b/http2/http2_constants.cc
index d4d59a5..ad15b69 100644
--- a/http2/http2_constants.cc
+++ b/http2/http2_constants.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/http2/http2_constants.h"
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
diff --git a/http2/http2_structures.h b/http2/http2_structures.h
index 01c011e..f236cfb 100644
--- a/http2/http2_structures.h
+++ b/http2/http2_structures.h
@@ -30,9 +30,9 @@
#include <cstdint>
#include <ostream>
-#include "base/logging.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
diff --git a/http2/http2_structures_test.cc b/http2/http2_structures_test.cc
index 78107f7..9e38248 100644
--- a/http2/http2_structures_test.cc
+++ b/http2/http2_structures_test.cc
@@ -154,8 +154,9 @@
protected:
Http2FrameHeaderTypeAndFlagTest()
: type_(std::get<0>(GetParam())), flags_(std::get<1>(GetParam())) {
- LOG(INFO) << "Frame type: " << type_;
- LOG(INFO) << "Frame flags: " << Http2FrameFlagsToString(type_, flags_);
+ HTTP2_LOG(INFO) << "Frame type: " << type_;
+ HTTP2_LOG(INFO) << "Frame flags: "
+ << Http2FrameFlagsToString(type_, flags_);
}
const Http2FrameType type_;
@@ -163,7 +164,8 @@
};
class IsEndStreamTest : public Http2FrameHeaderTypeAndFlagTest {};
-INSTANTIATE_TEST_SUITE_P(IsEndStream, IsEndStreamTest,
+INSTANTIATE_TEST_SUITE_P(IsEndStream,
+ IsEndStreamTest,
Combine(ValuesIn(ValidFrameTypes()),
Values(~Http2FrameFlag::END_STREAM, 0xff)));
TEST_P(IsEndStreamTest, IsEndStream) {
@@ -200,7 +202,8 @@
}
class IsACKTest : public Http2FrameHeaderTypeAndFlagTest {};
-INSTANTIATE_TEST_SUITE_P(IsAck, IsACKTest,
+INSTANTIATE_TEST_SUITE_P(IsAck,
+ IsACKTest,
Combine(ValuesIn(ValidFrameTypes()),
Values(~Http2FrameFlag::ACK, 0xff)));
TEST_P(IsACKTest, IsAck) {
@@ -236,7 +239,8 @@
}
class IsEndHeadersTest : public Http2FrameHeaderTypeAndFlagTest {};
-INSTANTIATE_TEST_SUITE_P(IsEndHeaders, IsEndHeadersTest,
+INSTANTIATE_TEST_SUITE_P(IsEndHeaders,
+ IsEndHeadersTest,
Combine(ValuesIn(ValidFrameTypes()),
Values(~Http2FrameFlag::END_HEADERS, 0xff)));
TEST_P(IsEndHeadersTest, IsEndHeaders) {
@@ -276,7 +280,8 @@
}
class IsPaddedTest : public Http2FrameHeaderTypeAndFlagTest {};
-INSTANTIATE_TEST_SUITE_P(IsPadded, IsPaddedTest,
+INSTANTIATE_TEST_SUITE_P(IsPadded,
+ IsPaddedTest,
Combine(ValuesIn(ValidFrameTypes()),
Values(~Http2FrameFlag::PADDED, 0xff)));
TEST_P(IsPaddedTest, IsPadded) {
@@ -314,7 +319,8 @@
}
class HasPriorityTest : public Http2FrameHeaderTypeAndFlagTest {};
-INSTANTIATE_TEST_SUITE_P(HasPriority, HasPriorityTest,
+INSTANTIATE_TEST_SUITE_P(HasPriority,
+ HasPriorityTest,
Combine(ValuesIn(ValidFrameTypes()),
Values(~Http2FrameFlag::PRIORITY, 0xff)));
TEST_P(HasPriorityTest, HasPriority) {
diff --git a/http2/platform/api/http2_logging.h b/http2/platform/api/http2_logging.h
new file mode 100644
index 0000000..cd93ac3
--- /dev/null
+++ b/http2/platform/api/http2_logging.h
@@ -0,0 +1,22 @@
+#ifndef QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
+#define QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
+
+#include "net/http2/platform/impl/http2_logging_impl.h"
+
+#define HTTP2_LOG(severity) HTTP2_LOG_IMPL(severity)
+
+#define HTTP2_VLOG(verbose_level) HTTP2_VLOG_IMPL(verbose_level)
+
+#define HTTP2_DLOG(severity) HTTP2_DLOG_IMPL(severity)
+
+#define HTTP2_DLOG_IF(severity, condition) \
+ HTTP2_DLOG_IF_IMPL(severity, condition)
+
+#define HTTP2_DVLOG(verbose_level) HTTP2_DVLOG_IMPL(verbose_level)
+
+#define HTTP2_DVLOG_IF(verbose_level, condition) \
+ HTTP2_DVLOG_IF_IMPL(verbose_level, condition)
+
+#define HTTP2_DLOG_EVERY_N(severity, n) HTTP2_DLOG_EVERY_N_IMPL(severity, n)
+
+#endif // QUICHE_HTTP2_PLATFORM_API_HTTP2_LOGGING_H_
diff --git a/http2/test_tools/frame_parts.cc b/http2/test_tools/frame_parts.cc
index 3d0453e..d550788 100644
--- a/http2/test_tools/frame_parts.cc
+++ b/http2/test_tools/frame_parts.cc
@@ -6,10 +6,10 @@
#include <type_traits>
-#include "base/logging.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
@@ -48,12 +48,12 @@
} // namespace
FrameParts::FrameParts(const Http2FrameHeader& header) : frame_header_(header) {
- VLOG(1) << "FrameParts, header: " << frame_header_;
+ HTTP2_VLOG(1) << "FrameParts, header: " << frame_header_;
}
FrameParts::FrameParts(const Http2FrameHeader& header, Http2StringPiece payload)
: FrameParts(header) {
- VLOG(1) << "FrameParts with payload.size() = " << payload.size();
+ HTTP2_VLOG(1) << "FrameParts with payload.size() = " << payload.size();
this->payload_.append(payload.data(), payload.size());
opt_payload_length_ = payload.size();
}
@@ -61,7 +61,7 @@
Http2StringPiece payload,
size_t total_pad_length)
: FrameParts(header, payload) {
- VLOG(1) << "FrameParts with total_pad_length=" << total_pad_length;
+ HTTP2_VLOG(1) << "FrameParts with total_pad_length=" << total_pad_length;
SetTotalPadLength(total_pad_length);
}
@@ -110,9 +110,10 @@
}
if (opt_pad_length_) {
- VLOG(1) << "SetTotalPadLength: pad_length=" << opt_pad_length_.value();
+ HTTP2_VLOG(1) << "SetTotalPadLength: pad_length="
+ << opt_pad_length_.value();
} else {
- VLOG(1) << "SetTotalPadLength: has no pad length";
+ HTTP2_VLOG(1) << "SetTotalPadLength: has no pad length";
}
}
@@ -130,33 +131,33 @@
}
void FrameParts::OnDataStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnDataStart: " << header;
+ HTTP2_VLOG(1) << "OnDataStart: " << header;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::DATA)) << *this;
opt_payload_length_ = header.payload_length;
}
void FrameParts::OnDataPayload(const char* data, size_t len) {
- VLOG(1) << "OnDataPayload: len=" << len
- << "; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnDataPayload: len=" << len
+ << "; frame_header_: " << frame_header_;
ASSERT_TRUE(InFrameOfType(Http2FrameType::DATA)) << *this;
ASSERT_TRUE(AppendString(Http2StringPiece(data, len), &payload_,
&opt_payload_length_));
}
void FrameParts::OnDataEnd() {
- VLOG(1) << "OnDataEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnDataEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::DATA)) << *this;
}
void FrameParts::OnHeadersStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnHeadersStart: " << header;
+ HTTP2_VLOG(1) << "OnHeadersStart: " << header;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::HEADERS)) << *this;
opt_payload_length_ = header.payload_length;
}
void FrameParts::OnHeadersPriority(const Http2PriorityFields& priority) {
- VLOG(1) << "OnHeadersPriority: priority: " << priority
- << "; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnHeadersPriority: priority: " << priority
+ << "; frame_header_: " << frame_header_;
ASSERT_TRUE(InFrameOfType(Http2FrameType::HEADERS)) << *this;
ASSERT_FALSE(opt_priority_);
opt_priority_ = priority;
@@ -166,8 +167,8 @@
}
void FrameParts::OnHpackFragment(const char* data, size_t len) {
- VLOG(1) << "OnHpackFragment: len=" << len
- << "; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len
+ << "; frame_header_: " << frame_header_;
ASSERT_TRUE(got_start_callback_);
ASSERT_FALSE(got_end_callback_);
ASSERT_TRUE(FrameCanHaveHpackPayload(frame_header_)) << *this;
@@ -176,13 +177,13 @@
}
void FrameParts::OnHeadersEnd() {
- VLOG(1) << "OnHeadersEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnHeadersEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::HEADERS)) << *this;
}
void FrameParts::OnPriorityFrame(const Http2FrameHeader& header,
const Http2PriorityFields& priority) {
- VLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority;
+ HTTP2_VLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::PRIORITY)) << *this;
ASSERT_FALSE(opt_priority_);
opt_priority_ = priority;
@@ -190,18 +191,18 @@
}
void FrameParts::OnContinuationStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnContinuationStart: " << header;
+ HTTP2_VLOG(1) << "OnContinuationStart: " << header;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::CONTINUATION)) << *this;
opt_payload_length_ = header.payload_length;
}
void FrameParts::OnContinuationEnd() {
- VLOG(1) << "OnContinuationEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnContinuationEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::CONTINUATION)) << *this;
}
void FrameParts::OnPadLength(size_t trailing_length) {
- VLOG(1) << "OnPadLength: trailing_length=" << trailing_length;
+ HTTP2_VLOG(1) << "OnPadLength: trailing_length=" << trailing_length;
ASSERT_TRUE(InPaddedFrame()) << *this;
ASSERT_FALSE(opt_pad_length_);
ASSERT_TRUE(opt_payload_length_);
@@ -212,7 +213,7 @@
}
void FrameParts::OnPadding(const char* pad, size_t skipped_length) {
- VLOG(1) << "OnPadding: skipped_length=" << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: skipped_length=" << skipped_length;
ASSERT_TRUE(InPaddedFrame()) << *this;
ASSERT_TRUE(opt_pad_length_);
ASSERT_TRUE(AppendString(Http2StringPiece(pad, skipped_length), &padding_,
@@ -221,7 +222,7 @@
void FrameParts::OnRstStream(const Http2FrameHeader& header,
Http2ErrorCode error_code) {
- VLOG(1) << "OnRstStream: " << header << "; code=" << error_code;
+ HTTP2_VLOG(1) << "OnRstStream: " << header << "; code=" << error_code;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::RST_STREAM)) << *this;
ASSERT_FALSE(opt_rst_stream_error_code_);
opt_rst_stream_error_code_ = error_code;
@@ -229,25 +230,25 @@
}
void FrameParts::OnSettingsStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsStart: " << header;
+ HTTP2_VLOG(1) << "OnSettingsStart: " << header;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::SETTINGS)) << *this;
ASSERT_EQ(0u, settings_.size());
ASSERT_FALSE(header.IsAck()) << header;
}
void FrameParts::OnSetting(const Http2SettingFields& setting_fields) {
- VLOG(1) << "OnSetting: " << setting_fields;
+ HTTP2_VLOG(1) << "OnSetting: " << setting_fields;
ASSERT_TRUE(InFrameOfType(Http2FrameType::SETTINGS)) << *this;
settings_.push_back(setting_fields);
}
void FrameParts::OnSettingsEnd() {
- VLOG(1) << "OnSettingsEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnSettingsEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::SETTINGS)) << *this;
}
void FrameParts::OnSettingsAck(const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsAck: " << header;
+ HTTP2_VLOG(1) << "OnSettingsAck: " << header;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::SETTINGS)) << *this;
ASSERT_EQ(0u, settings_.size());
ASSERT_TRUE(header.IsAck());
@@ -257,8 +258,9 @@
void FrameParts::OnPushPromiseStart(const Http2FrameHeader& header,
const Http2PushPromiseFields& promise,
size_t total_padding_length) {
- VLOG(1) << "OnPushPromiseStart header: " << header << "; promise: " << promise
- << "; total_padding_length: " << total_padding_length;
+ HTTP2_VLOG(1) << "OnPushPromiseStart header: " << header
+ << "; promise: " << promise
+ << "; total_padding_length: " << total_padding_length;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::PUSH_PROMISE)) << *this;
ASSERT_GE(header.payload_length, Http2PushPromiseFields::EncodedSize());
opt_payload_length_ =
@@ -274,13 +276,13 @@
}
void FrameParts::OnPushPromiseEnd() {
- VLOG(1) << "OnPushPromiseEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnPushPromiseEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::PUSH_PROMISE)) << *this;
}
void FrameParts::OnPing(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPing header: " << header << " ping: " << ping;
+ HTTP2_VLOG(1) << "OnPing header: " << header << " ping: " << ping;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::PING)) << *this;
ASSERT_FALSE(header.IsAck());
ASSERT_FALSE(opt_ping_);
@@ -290,7 +292,7 @@
void FrameParts::OnPingAck(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPingAck header: " << header << " ping: " << ping;
+ HTTP2_VLOG(1) << "OnPingAck header: " << header << " ping: " << ping;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::PING)) << *this;
ASSERT_TRUE(header.IsAck());
ASSERT_FALSE(opt_ping_);
@@ -300,7 +302,7 @@
void FrameParts::OnGoAwayStart(const Http2FrameHeader& header,
const Http2GoAwayFields& goaway) {
- VLOG(1) << "OnGoAwayStart: " << goaway;
+ HTTP2_VLOG(1) << "OnGoAwayStart: " << goaway;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::GOAWAY)) << *this;
ASSERT_FALSE(opt_goaway_);
opt_goaway_ = goaway;
@@ -309,21 +311,21 @@
}
void FrameParts::OnGoAwayOpaqueData(const char* data, size_t len) {
- VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
+ HTTP2_VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::GOAWAY)) << *this;
ASSERT_TRUE(AppendString(Http2StringPiece(data, len), &payload_,
&opt_payload_length_));
}
void FrameParts::OnGoAwayEnd() {
- VLOG(1) << "OnGoAwayEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnGoAwayEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::GOAWAY)) << *this;
}
void FrameParts::OnWindowUpdate(const Http2FrameHeader& header,
uint32_t increment) {
- VLOG(1) << "OnWindowUpdate header: " << header
- << " increment=" << increment;
+ HTTP2_VLOG(1) << "OnWindowUpdate header: " << header
+ << " increment=" << increment;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::WINDOW_UPDATE)) << *this;
ASSERT_FALSE(opt_window_update_increment_);
opt_window_update_increment_ = increment;
@@ -333,9 +335,9 @@
void FrameParts::OnAltSvcStart(const Http2FrameHeader& header,
size_t origin_length,
size_t value_length) {
- VLOG(1) << "OnAltSvcStart: " << header
- << " origin_length: " << origin_length
- << " value_length: " << value_length;
+ HTTP2_VLOG(1) << "OnAltSvcStart: " << header
+ << " origin_length: " << origin_length
+ << " value_length: " << value_length;
ASSERT_TRUE(StartFrameOfType(header, Http2FrameType::ALTSVC)) << *this;
ASSERT_FALSE(opt_altsvc_origin_length_);
opt_altsvc_origin_length_ = origin_length;
@@ -344,26 +346,26 @@
}
void FrameParts::OnAltSvcOriginData(const char* data, size_t len) {
- VLOG(1) << "OnAltSvcOriginData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcOriginData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::ALTSVC)) << *this;
ASSERT_TRUE(AppendString(Http2StringPiece(data, len), &altsvc_origin_,
&opt_altsvc_origin_length_));
}
void FrameParts::OnAltSvcValueData(const char* data, size_t len) {
- VLOG(1) << "OnAltSvcValueData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcValueData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::ALTSVC)) << *this;
ASSERT_TRUE(AppendString(Http2StringPiece(data, len), &altsvc_value_,
&opt_altsvc_value_length_));
}
void FrameParts::OnAltSvcEnd() {
- VLOG(1) << "OnAltSvcEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnAltSvcEnd; frame_header_: " << frame_header_;
ASSERT_TRUE(EndFrameOfType(Http2FrameType::ALTSVC)) << *this;
}
void FrameParts::OnUnknownStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnUnknownStart: " << header;
+ HTTP2_VLOG(1) << "OnUnknownStart: " << header;
ASSERT_FALSE(IsSupportedHttp2FrameType(header.type)) << header;
ASSERT_FALSE(got_start_callback_);
ASSERT_EQ(frame_header_, header);
@@ -372,7 +374,7 @@
}
void FrameParts::OnUnknownPayload(const char* data, size_t len) {
- VLOG(1) << "OnUnknownPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnUnknownPayload: len=" << len;
ASSERT_FALSE(IsSupportedHttp2FrameType(frame_header_.type)) << *this;
ASSERT_TRUE(got_start_callback_);
ASSERT_FALSE(got_end_callback_);
@@ -381,7 +383,7 @@
}
void FrameParts::OnUnknownEnd() {
- VLOG(1) << "OnUnknownEnd; frame_header_: " << frame_header_;
+ HTTP2_VLOG(1) << "OnUnknownEnd; frame_header_: " << frame_header_;
ASSERT_FALSE(IsSupportedHttp2FrameType(frame_header_.type)) << *this;
ASSERT_TRUE(got_start_callback_);
ASSERT_FALSE(got_end_callback_);
@@ -390,8 +392,8 @@
void FrameParts::OnPaddingTooLong(const Http2FrameHeader& header,
size_t missing_length) {
- VLOG(1) << "OnPaddingTooLong: " << header
- << "; missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << "; missing_length: " << missing_length;
ASSERT_EQ(frame_header_, header);
ASSERT_FALSE(got_end_callback_);
ASSERT_TRUE(FrameIsPadded(header));
@@ -403,7 +405,7 @@
}
void FrameParts::OnFrameSizeError(const Http2FrameHeader& header) {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
ASSERT_EQ(frame_header_, header);
ASSERT_FALSE(got_end_callback_);
ASSERT_FALSE(has_frame_size_error_);
diff --git a/http2/test_tools/frame_parts.h b/http2/test_tools/frame_parts.h
index b531174..5a7d872 100644
--- a/http2/test_tools/frame_parts.h
+++ b/http2/test_tools/frame_parts.h
@@ -15,11 +15,11 @@
#include <cstdint>
#include <vector>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_optional.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
diff --git a/http2/test_tools/frame_parts_collector.cc b/http2/test_tools/frame_parts_collector.cc
index be4d986..cb0e32b 100644
--- a/http2/test_tools/frame_parts_collector.cc
+++ b/http2/test_tools/frame_parts_collector.cc
@@ -6,9 +6,9 @@
#include <utility>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_ptr_util.h"
namespace http2 {
diff --git a/http2/test_tools/frame_parts_collector_listener.cc b/http2/test_tools/frame_parts_collector_listener.cc
index 8d9da78..a7c3ecc 100644
--- a/http2/test_tools/frame_parts_collector_listener.cc
+++ b/http2/test_tools/frame_parts_collector_listener.cc
@@ -4,95 +4,95 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.h"
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
namespace http2 {
namespace test {
bool FramePartsCollectorListener::OnFrameHeader(
const Http2FrameHeader& header) {
- VLOG(1) << "OnFrameHeader: " << header;
+ HTTP2_VLOG(1) << "OnFrameHeader: " << header;
ExpectFrameHeader(header);
return true;
}
void FramePartsCollectorListener::OnDataStart(const Http2FrameHeader& header) {
- VLOG(1) << "OnDataStart: " << header;
+ HTTP2_VLOG(1) << "OnDataStart: " << header;
StartFrame(header)->OnDataStart(header);
}
void FramePartsCollectorListener::OnDataPayload(const char* data, size_t len) {
- VLOG(1) << "OnDataPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnDataPayload: len=" << len;
CurrentFrame()->OnDataPayload(data, len);
}
void FramePartsCollectorListener::OnDataEnd() {
- VLOG(1) << "OnDataEnd";
+ HTTP2_VLOG(1) << "OnDataEnd";
EndFrame()->OnDataEnd();
}
void FramePartsCollectorListener::OnHeadersStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnHeadersStart: " << header;
+ HTTP2_VLOG(1) << "OnHeadersStart: " << header;
StartFrame(header)->OnHeadersStart(header);
}
void FramePartsCollectorListener::OnHeadersPriority(
const Http2PriorityFields& priority) {
- VLOG(1) << "OnHeadersPriority: " << priority;
+ HTTP2_VLOG(1) << "OnHeadersPriority: " << priority;
CurrentFrame()->OnHeadersPriority(priority);
}
void FramePartsCollectorListener::OnHpackFragment(const char* data,
size_t len) {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
CurrentFrame()->OnHpackFragment(data, len);
}
void FramePartsCollectorListener::OnHeadersEnd() {
- VLOG(1) << "OnHeadersEnd";
+ HTTP2_VLOG(1) << "OnHeadersEnd";
EndFrame()->OnHeadersEnd();
}
void FramePartsCollectorListener::OnPriorityFrame(
const Http2FrameHeader& header,
const Http2PriorityFields& priority_fields) {
- VLOG(1) << "OnPriority: " << header << "; " << priority_fields;
+ HTTP2_VLOG(1) << "OnPriority: " << header << "; " << priority_fields;
StartAndEndFrame(header)->OnPriorityFrame(header, priority_fields);
}
void FramePartsCollectorListener::OnContinuationStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnContinuationStart: " << header;
+ HTTP2_VLOG(1) << "OnContinuationStart: " << header;
StartFrame(header)->OnContinuationStart(header);
}
void FramePartsCollectorListener::OnContinuationEnd() {
- VLOG(1) << "OnContinuationEnd";
+ HTTP2_VLOG(1) << "OnContinuationEnd";
EndFrame()->OnContinuationEnd();
}
void FramePartsCollectorListener::OnPadLength(size_t pad_length) {
- VLOG(1) << "OnPadLength: " << pad_length;
+ HTTP2_VLOG(1) << "OnPadLength: " << pad_length;
CurrentFrame()->OnPadLength(pad_length);
}
void FramePartsCollectorListener::OnPadding(const char* padding,
size_t skipped_length) {
- VLOG(1) << "OnPadding: " << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: " << skipped_length;
CurrentFrame()->OnPadding(padding, skipped_length);
}
void FramePartsCollectorListener::OnRstStream(const Http2FrameHeader& header,
Http2ErrorCode error_code) {
- VLOG(1) << "OnRstStream: " << header << "; error_code=" << error_code;
+ HTTP2_VLOG(1) << "OnRstStream: " << header << "; error_code=" << error_code;
StartAndEndFrame(header)->OnRstStream(header, error_code);
}
void FramePartsCollectorListener::OnSettingsStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsStart: " << header;
+ HTTP2_VLOG(1) << "OnSettingsStart: " << header;
EXPECT_EQ(Http2FrameType::SETTINGS, header.type) << header;
EXPECT_EQ(Http2FrameFlag(), header.flags) << header;
StartFrame(header)->OnSettingsStart(header);
@@ -100,18 +100,18 @@
void FramePartsCollectorListener::OnSetting(
const Http2SettingFields& setting_fields) {
- VLOG(1) << "Http2SettingFields: setting_fields=" << setting_fields;
+ HTTP2_VLOG(1) << "Http2SettingFields: setting_fields=" << setting_fields;
CurrentFrame()->OnSetting(setting_fields);
}
void FramePartsCollectorListener::OnSettingsEnd() {
- VLOG(1) << "OnSettingsEnd";
+ HTTP2_VLOG(1) << "OnSettingsEnd";
EndFrame()->OnSettingsEnd();
}
void FramePartsCollectorListener::OnSettingsAck(
const Http2FrameHeader& header) {
- VLOG(1) << "OnSettingsAck: " << header;
+ HTTP2_VLOG(1) << "OnSettingsAck: " << header;
StartAndEndFrame(header)->OnSettingsAck(header);
}
@@ -119,52 +119,53 @@
const Http2FrameHeader& header,
const Http2PushPromiseFields& promise,
size_t total_padding_length) {
- VLOG(1) << "OnPushPromiseStart header: " << header << " promise: " << promise
- << " total_padding_length: " << total_padding_length;
+ HTTP2_VLOG(1) << "OnPushPromiseStart header: " << header
+ << " promise: " << promise
+ << " total_padding_length: " << total_padding_length;
EXPECT_EQ(Http2FrameType::PUSH_PROMISE, header.type);
StartFrame(header)->OnPushPromiseStart(header, promise, total_padding_length);
}
void FramePartsCollectorListener::OnPushPromiseEnd() {
- VLOG(1) << "OnPushPromiseEnd";
+ HTTP2_VLOG(1) << "OnPushPromiseEnd";
EndFrame()->OnPushPromiseEnd();
}
void FramePartsCollectorListener::OnPing(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPing: " << header << "; " << ping;
+ HTTP2_VLOG(1) << "OnPing: " << header << "; " << ping;
StartAndEndFrame(header)->OnPing(header, ping);
}
void FramePartsCollectorListener::OnPingAck(const Http2FrameHeader& header,
const Http2PingFields& ping) {
- VLOG(1) << "OnPingAck: " << header << "; " << ping;
+ HTTP2_VLOG(1) << "OnPingAck: " << header << "; " << ping;
StartAndEndFrame(header)->OnPingAck(header, ping);
}
void FramePartsCollectorListener::OnGoAwayStart(
const Http2FrameHeader& header,
const Http2GoAwayFields& goaway) {
- VLOG(1) << "OnGoAwayStart header: " << header << "; goaway: " << goaway;
+ HTTP2_VLOG(1) << "OnGoAwayStart header: " << header << "; goaway: " << goaway;
StartFrame(header)->OnGoAwayStart(header, goaway);
}
void FramePartsCollectorListener::OnGoAwayOpaqueData(const char* data,
size_t len) {
- VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
+ HTTP2_VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
CurrentFrame()->OnGoAwayOpaqueData(data, len);
}
void FramePartsCollectorListener::OnGoAwayEnd() {
- VLOG(1) << "OnGoAwayEnd";
+ HTTP2_VLOG(1) << "OnGoAwayEnd";
EndFrame()->OnGoAwayEnd();
}
void FramePartsCollectorListener::OnWindowUpdate(
const Http2FrameHeader& header,
uint32_t window_size_increment) {
- VLOG(1) << "OnWindowUpdate: " << header
- << "; window_size_increment=" << window_size_increment;
+ HTTP2_VLOG(1) << "OnWindowUpdate: " << header
+ << "; window_size_increment=" << window_size_increment;
EXPECT_EQ(Http2FrameType::WINDOW_UPDATE, header.type);
StartAndEndFrame(header)->OnWindowUpdate(header, window_size_increment);
}
@@ -172,57 +173,57 @@
void FramePartsCollectorListener::OnAltSvcStart(const Http2FrameHeader& header,
size_t origin_length,
size_t value_length) {
- VLOG(1) << "OnAltSvcStart header: " << header
- << "; origin_length=" << origin_length
- << "; value_length=" << value_length;
+ HTTP2_VLOG(1) << "OnAltSvcStart header: " << header
+ << "; origin_length=" << origin_length
+ << "; value_length=" << value_length;
StartFrame(header)->OnAltSvcStart(header, origin_length, value_length);
}
void FramePartsCollectorListener::OnAltSvcOriginData(const char* data,
size_t len) {
- VLOG(1) << "OnAltSvcOriginData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcOriginData: len=" << len;
CurrentFrame()->OnAltSvcOriginData(data, len);
}
void FramePartsCollectorListener::OnAltSvcValueData(const char* data,
size_t len) {
- VLOG(1) << "OnAltSvcValueData: len=" << len;
+ HTTP2_VLOG(1) << "OnAltSvcValueData: len=" << len;
CurrentFrame()->OnAltSvcValueData(data, len);
}
void FramePartsCollectorListener::OnAltSvcEnd() {
- VLOG(1) << "OnAltSvcEnd";
+ HTTP2_VLOG(1) << "OnAltSvcEnd";
EndFrame()->OnAltSvcEnd();
}
void FramePartsCollectorListener::OnUnknownStart(
const Http2FrameHeader& header) {
- VLOG(1) << "OnUnknownStart: " << header;
+ HTTP2_VLOG(1) << "OnUnknownStart: " << header;
StartFrame(header)->OnUnknownStart(header);
}
void FramePartsCollectorListener::OnUnknownPayload(const char* data,
size_t len) {
- VLOG(1) << "OnUnknownPayload: len=" << len;
+ HTTP2_VLOG(1) << "OnUnknownPayload: len=" << len;
CurrentFrame()->OnUnknownPayload(data, len);
}
void FramePartsCollectorListener::OnUnknownEnd() {
- VLOG(1) << "OnUnknownEnd";
+ HTTP2_VLOG(1) << "OnUnknownEnd";
EndFrame()->OnUnknownEnd();
}
void FramePartsCollectorListener::OnPaddingTooLong(
const Http2FrameHeader& header,
size_t missing_length) {
- VLOG(1) << "OnPaddingTooLong: " << header
- << " missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << " missing_length: " << missing_length;
EndFrame()->OnPaddingTooLong(header, missing_length);
}
void FramePartsCollectorListener::OnFrameSizeError(
const Http2FrameHeader& header) {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
diff --git a/http2/test_tools/http2_random.cc b/http2/test_tools/http2_random.cc
index fc577f4..81c0366 100644
--- a/http2/test_tools/http2_random.cc
+++ b/http2/test_tools/http2_random.cc
@@ -1,6 +1,6 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
-#include "base/logging.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "third_party/boringssl/src/include/openssl/chacha.h"
#include "third_party/boringssl/src/include/openssl/rand.h"
@@ -13,7 +13,7 @@
Http2Random::Http2Random() {
RAND_bytes(key_, sizeof(key_));
- LOG(INFO) << "Initialized test RNG with the following key: " << Key();
+ HTTP2_LOG(INFO) << "Initialized test RNG with the following key: " << Key();
}
Http2Random::Http2Random(Http2StringPiece key) {
diff --git a/http2/tools/random_decoder_test.cc b/http2/tools/random_decoder_test.cc
index 623487c..640e7e9 100644
--- a/http2/tools/random_decoder_test.cc
+++ b/http2/tools/random_decoder_test.cc
@@ -9,11 +9,11 @@
#include <algorithm>
#include <memory>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
using ::testing::AssertionFailure;
@@ -33,13 +33,14 @@
const SelectSize& select_size) {
DecodeStatus status = DecodeStatus::kDecodeInProgress;
bool first = true;
- VLOG(2) << "DecodeSegments: input size=" << original->Remaining();
+ HTTP2_VLOG(2) << "DecodeSegments: input size=" << original->Remaining();
while (first || original->HasData()) {
size_t remaining = original->Remaining();
size_t size =
std::min(remaining, select_size(first, original->Offset(), remaining));
DecodeBuffer db(original->cursor(), size);
- VLOG(2) << "Decoding " << size << " bytes of " << remaining << " remaining";
+ HTTP2_VLOG(2) << "Decoding " << size << " bytes of " << remaining
+ << " remaining";
if (first) {
first = false;
status = StartDecoding(&db);
@@ -78,13 +79,13 @@
bool return_non_zero_on_first,
const Validator& validator) {
const uint32_t original_remaining = original->Remaining();
- VLOG(1) << "DecodeAndValidateSeveralWays - Start, remaining = "
- << original_remaining;
+ HTTP2_VLOG(1) << "DecodeAndValidateSeveralWays - Start, remaining = "
+ << original_remaining;
uint32_t first_consumed;
{
// Fast decode (no stopping unless decoder does so).
DecodeBuffer input(original->cursor(), original_remaining);
- VLOG(2) << "DecodeSegmentsAndValidate with SelectRemaining";
+ HTTP2_VLOG(2) << "DecodeSegmentsAndValidate with SelectRemaining";
VERIFY_SUCCESS(
DecodeSegmentsAndValidate(&input, SelectRemaining(), validator))
<< "\nFailed with SelectRemaining; input.Offset=" << input.Offset()
@@ -94,7 +95,7 @@
if (original_remaining <= 30) {
// Decode again, one byte at a time.
DecodeBuffer input(original->cursor(), original_remaining);
- VLOG(2) << "DecodeSegmentsAndValidate with SelectOne";
+ HTTP2_VLOG(2) << "DecodeSegmentsAndValidate with SelectOne";
VERIFY_SUCCESS(DecodeSegmentsAndValidate(&input, SelectOne(), validator))
<< "\nFailed with SelectOne; input.Offset=" << input.Offset()
<< "; input.Remaining=" << input.Remaining();
@@ -103,7 +104,7 @@
if (original_remaining <= 20) {
// Decode again, one or zero bytes at a time.
DecodeBuffer input(original->cursor(), original_remaining);
- VLOG(2) << "DecodeSegmentsAndValidate with SelectZeroAndOne";
+ HTTP2_VLOG(2) << "DecodeSegmentsAndValidate with SelectZeroAndOne";
VERIFY_SUCCESS(DecodeSegmentsAndValidate(
&input, SelectZeroAndOne(return_non_zero_on_first), validator))
<< "\nFailed with SelectZeroAndOne";
@@ -114,7 +115,7 @@
{
// Decode again, with randomly selected segment sizes.
DecodeBuffer input(original->cursor(), original_remaining);
- VLOG(2) << "DecodeSegmentsAndValidate with SelectRandom";
+ HTTP2_VLOG(2) << "DecodeSegmentsAndValidate with SelectRandom";
VERIFY_SUCCESS(DecodeSegmentsAndValidate(
&input, SelectRandom(return_non_zero_on_first), validator))
<< "\nFailed with SelectRandom; input.Offset=" << input.Offset()
@@ -123,7 +124,7 @@
}
VERIFY_EQ(original_remaining, original->Remaining());
original->AdvanceCursor(first_consumed);
- VLOG(1) << "DecodeAndValidateSeveralWays - SUCCESS";
+ HTTP2_VLOG(1) << "DecodeAndValidateSeveralWays - SUCCESS";
return ::testing::AssertionSuccess();
}
diff --git a/http2/tools/random_decoder_test.h b/http2/tools/random_decoder_test.h
index 36f3196..f162ad7 100644
--- a/http2/tools/random_decoder_test.h
+++ b/http2/tools/random_decoder_test.h
@@ -17,10 +17,10 @@
#include <memory>
#include <type_traits>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"