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; } };