gfe-relnote: (n/a) Platformize logging for spdy. Refactor only, no behavior change. Note on merge: spdy/platform/impl/spdy_logging_impl.h also needs to be merged to Chromium. PiperOrigin-RevId: 237328904 Change-Id: I8834e0c0bc004f545337b14d1c76f2b578fc1745
diff --git a/spdy/core/hpack/hpack_constants.cc b/spdy/core/hpack/hpack_constants.cc index 9c1498a..77cae3a 100644 --- a/spdy/core/hpack/hpack_constants.cc +++ b/spdy/core/hpack/hpack_constants.cc
@@ -8,10 +8,10 @@ #include <memory> #include <vector> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy {
diff --git a/spdy/core/hpack/hpack_decoder_adapter.cc b/spdy/core/hpack/hpack_decoder_adapter.cc index 309af39..ad05b1f 100644 --- a/spdy/core/hpack/hpack_decoder_adapter.cc +++ b/spdy/core/hpack/hpack_decoder_adapter.cc
@@ -4,10 +4,10 @@ #include "net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.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_status.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" using ::http2::DecodeBuffer; using ::http2::HpackEntryType; @@ -26,13 +26,13 @@ HpackDecoderAdapter::~HpackDecoderAdapter() = default; void HpackDecoderAdapter::ApplyHeaderTableSizeSetting(size_t size_setting) { - DVLOG(2) << "HpackDecoderAdapter::ApplyHeaderTableSizeSetting"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ApplyHeaderTableSizeSetting"; hpack_decoder_.ApplyHeaderTableSizeSetting(size_setting); } void HpackDecoderAdapter::HandleControlFrameHeadersStart( SpdyHeadersHandlerInterface* handler) { - DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersStart"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersStart"; DCHECK(!header_block_started_); listener_adapter_.set_handler(handler); } @@ -40,8 +40,8 @@ bool HpackDecoderAdapter::HandleControlFrameHeadersData( const char* headers_data, size_t headers_data_length) { - DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersData: len=" - << headers_data_length; + SPDY_DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersData: len=" + << headers_data_length; if (!header_block_started_) { // Initialize the decoding process here rather than in // HandleControlFrameHeadersStart because that method is not always called. @@ -58,8 +58,9 @@ if (headers_data_length > 0) { DCHECK_NE(headers_data, nullptr); if (headers_data_length > max_decode_buffer_size_bytes_) { - DVLOG(1) << "max_decode_buffer_size_bytes_ < headers_data_length: " - << max_decode_buffer_size_bytes_ << " < " << headers_data_length; + SPDY_DVLOG(1) << "max_decode_buffer_size_bytes_ < headers_data_length: " + << max_decode_buffer_size_bytes_ << " < " + << headers_data_length; return false; } listener_adapter_.AddToTotalHpackBytes(headers_data_length); @@ -73,12 +74,12 @@ bool HpackDecoderAdapter::HandleControlFrameHeadersComplete( size_t* compressed_len) { - DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersComplete"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersComplete"; if (compressed_len != nullptr) { *compressed_len = listener_adapter_.total_hpack_bytes(); } if (!hpack_decoder_.EndDecodingBlock()) { - DVLOG(3) << "EndDecodingBlock returned false"; + SPDY_DVLOG(3) << "EndDecodingBlock returned false"; return false; } header_block_started_ = false; @@ -91,7 +92,7 @@ void HpackDecoderAdapter::SetHeaderTableDebugVisitor( std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { - DVLOG(2) << "HpackDecoderAdapter::SetHeaderTableDebugVisitor"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::SetHeaderTableDebugVisitor"; if (visitor != nullptr) { listener_adapter_.SetHeaderTableDebugVisitor(std::move(visitor)); hpack_decoder_.set_tables_debug_listener(&listener_adapter_); @@ -103,7 +104,7 @@ void HpackDecoderAdapter::set_max_decode_buffer_size_bytes( size_t max_decode_buffer_size_bytes) { - DVLOG(2) << "HpackDecoderAdapter::set_max_decode_buffer_size_bytes"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::set_max_decode_buffer_size_bytes"; max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes; hpack_decoder_.set_max_string_size_bytes(max_decode_buffer_size_bytes); } @@ -126,7 +127,7 @@ } void HpackDecoderAdapter::ListenerAdapter::OnHeaderListStart() { - DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeaderListStart"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeaderListStart"; total_hpack_bytes_ = 0; total_uncompressed_bytes_ = 0; decoded_block_.clear(); @@ -138,21 +139,21 @@ void HpackDecoderAdapter::ListenerAdapter::OnHeader(HpackEntryType entry_type, const HpackString& name, const HpackString& value) { - DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeader:\n name: " << name - << "\n value: " << value; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeader:\n name: " + << name << "\n value: " << value; total_uncompressed_bytes_ += name.size() + value.size(); if (handler_ == nullptr) { - DVLOG(3) << "Adding to decoded_block"; + SPDY_DVLOG(3) << "Adding to decoded_block"; decoded_block_.AppendValueOrAddHeader(name.ToStringPiece(), value.ToStringPiece()); } else { - DVLOG(3) << "Passing to handler"; + SPDY_DVLOG(3) << "Passing to handler"; handler_->OnHeader(name.ToStringPiece(), value.ToStringPiece()); } } void HpackDecoderAdapter::ListenerAdapter::OnHeaderListEnd() { - DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeaderListEnd"; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnHeaderListEnd"; // We don't clear the SpdyHeaderBlock here to allow access to it until the // next HPACK block is decoded. if (handler_ != nullptr) { @@ -163,21 +164,21 @@ void HpackDecoderAdapter::ListenerAdapter::OnHeaderErrorDetected( SpdyStringPiece error_message) { - VLOG(1) << error_message; + SPDY_VLOG(1) << error_message; } int64_t HpackDecoderAdapter::ListenerAdapter::OnEntryInserted( const http2::HpackStringPair& sp, size_t insert_count) { - DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnEntryInserted: " << sp - << ", insert_count=" << insert_count; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnEntryInserted: " + << sp << ", insert_count=" << insert_count; if (visitor_ == nullptr) { return 0; } HpackEntry entry(sp.name.ToStringPiece(), sp.value.ToStringPiece(), /*is_static*/ false, insert_count); int64_t time_added = visitor_->OnNewEntry(entry); - DVLOG(2) + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnEntryInserted: time_added=" << time_added; return time_added; @@ -187,9 +188,9 @@ const http2::HpackStringPair& sp, size_t insert_count, int64_t time_added) { - DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnUseEntry: " << sp - << ", insert_count=" << insert_count - << ", time_added=" << time_added; + SPDY_DVLOG(2) << "HpackDecoderAdapter::ListenerAdapter::OnUseEntry: " << sp + << ", insert_count=" << insert_count + << ", time_added=" << time_added; if (visitor_ != nullptr) { HpackEntry entry(sp.name.ToStringPiece(), sp.value.ToStringPiece(), /*is_static*/ false, insert_count);
diff --git a/spdy/core/hpack/hpack_decoder_adapter.h b/spdy/core/hpack/hpack_decoder_adapter.h index b497fe7..d54cf1e 100644 --- a/spdy/core/hpack/hpack_decoder_adapter.h +++ b/spdy/core/hpack/hpack_decoder_adapter.h
@@ -13,7 +13,6 @@ #include <cstdint> #include <memory> -#include "base/macros.h" #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder.h" #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h" #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
diff --git a/spdy/core/hpack/hpack_decoder_adapter_test.cc b/spdy/core/hpack/hpack_decoder_adapter_test.cc index 9c94126..0d952d1 100644 --- a/spdy/core/hpack/hpack_decoder_adapter_test.cc +++ b/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -12,7 +12,6 @@ #include <utility> #include <vector> -#include "base/logging.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h" @@ -24,6 +23,7 @@ #include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h" #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" @@ -135,7 +135,7 @@ } bool HandleControlFrameHeadersData(SpdyStringPiece str) { - VLOG(3) << "HandleControlFrameHeadersData:\n" << SpdyHexDump(str); + SPDY_VLOG(3) << "HandleControlFrameHeadersData:\n" << SpdyHexDump(str); bytes_passed_in_ += str.size(); return decoder_.HandleControlFrameHeadersData(str.data(), str.size()); } @@ -260,12 +260,14 @@ }; INSTANTIATE_TEST_SUITE_P( - NoHandler, HpackDecoderAdapterTest, + NoHandler, + HpackDecoderAdapterTest, ::testing::Combine(::testing::Values(START_WITHOUT_HANDLER, NO_START), ::testing::Bool())); INSTANTIATE_TEST_SUITE_P( - WithHandler, HpackDecoderAdapterTest, + WithHandler, + HpackDecoderAdapterTest, ::testing::Combine(::testing::Values(START_WITH_HANDLER), ::testing::Bool()));
diff --git a/spdy/core/hpack/hpack_encoder.cc b/spdy/core/hpack/hpack_encoder.cc index a9981b9..d76ead0 100644 --- a/spdy/core/hpack/hpack_encoder.cc +++ b/spdy/core/hpack/hpack_encoder.cc
@@ -7,12 +7,12 @@ #include <algorithm> #include <limits> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" namespace spdy { @@ -155,22 +155,22 @@ } void HpackEncoder::EmitIndex(const HpackEntry* entry) { - DVLOG(2) << "Emitting index " << header_table_.IndexOf(entry); + SPDY_DVLOG(2) << "Emitting index " << header_table_.IndexOf(entry); output_stream_.AppendPrefix(kIndexedOpcode); output_stream_.AppendUint32(header_table_.IndexOf(entry)); } void HpackEncoder::EmitIndexedLiteral(const Representation& representation) { - DVLOG(2) << "Emitting indexed literal: (" << representation.first << ", " - << representation.second << ")"; + SPDY_DVLOG(2) << "Emitting indexed literal: (" << representation.first << ", " + << representation.second << ")"; output_stream_.AppendPrefix(kLiteralIncrementalIndexOpcode); EmitLiteral(representation); header_table_.TryAddEntry(representation.first, representation.second); } void HpackEncoder::EmitNonIndexedLiteral(const Representation& representation) { - DVLOG(2) << "Emitting nonindexed literal: (" << representation.first << ", " - << representation.second << ")"; + SPDY_DVLOG(2) << "Emitting nonindexed literal: (" << representation.first + << ", " << representation.second << ")"; output_stream_.AppendPrefix(kLiteralNoIndexOpcode); output_stream_.AppendUint32(0); EmitString(representation.first); @@ -192,12 +192,13 @@ size_t encoded_size = enable_compression_ ? huffman_table_.EncodedSize(str) : str.size(); if (encoded_size < str.size()) { - DVLOG(2) << "Emitted Huffman-encoded string of length " << encoded_size; + SPDY_DVLOG(2) << "Emitted Huffman-encoded string of length " + << encoded_size; output_stream_.AppendPrefix(kStringLiteralHuffmanEncoded); output_stream_.AppendUint32(encoded_size); huffman_table_.EncodeString(str, &output_stream_); } else { - DVLOG(2) << "Emitted literal string of length " << str.size(); + SPDY_DVLOG(2) << "Emitted literal string of length " << str.size(); output_stream_.AppendPrefix(kStringLiteralIdentityEncoded); output_stream_.AppendUint32(str.size()); output_stream_.AppendBytes(str); @@ -209,9 +210,9 @@ return; } const size_t current_size = CurrentHeaderTableSizeSetting(); - DVLOG(1) << "MaybeEmitTableSize current_size=" << current_size; - DVLOG(1) << "MaybeEmitTableSize min_table_size_setting_received_=" - << min_table_size_setting_received_; + SPDY_DVLOG(1) << "MaybeEmitTableSize current_size=" << current_size; + SPDY_DVLOG(1) << "MaybeEmitTableSize min_table_size_setting_received_=" + << min_table_size_setting_received_; if (min_table_size_setting_received_ < current_size) { output_stream_.AppendPrefix(kHeaderTableSizeUpdateOpcode); output_stream_.AppendUint32(min_table_size_setting_received_);
diff --git a/spdy/core/hpack/hpack_encoder.h b/spdy/core/hpack/hpack_encoder.h index 486d536..c0cf968 100644 --- a/spdy/core/hpack/hpack_encoder.h +++ b/spdy/core/hpack/hpack_encoder.h
@@ -13,7 +13,6 @@ #include <utility> #include <vector> -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
diff --git a/spdy/core/hpack/hpack_encoder_test.cc b/spdy/core/hpack/hpack_encoder_test.cc index 7d7d37d..a4f763c 100644 --- a/spdy/core/hpack/hpack_encoder_test.cc +++ b/spdy/core/hpack/hpack_encoder_test.cc
@@ -207,7 +207,8 @@ bool use_incremental_; }; -INSTANTIATE_TEST_SUITE_P(HpackEncoderTests, HpackEncoderTest, +INSTANTIATE_TEST_SUITE_P(HpackEncoderTests, + HpackEncoderTest, ::testing::Bool()); TEST_P(HpackEncoderTest, SingleDynamicIndex) {
diff --git a/spdy/core/hpack/hpack_entry.cc b/spdy/core/hpack/hpack_entry.cc index 90d53e6..46e6086 100644 --- a/spdy/core/hpack/hpack_entry.cc +++ b/spdy/core/hpack/hpack_entry.cc
@@ -4,8 +4,8 @@ #include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h" -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" namespace spdy {
diff --git a/spdy/core/hpack/hpack_entry.h b/spdy/core/hpack/hpack_entry.h index 28dee47..61103fd 100644 --- a/spdy/core/hpack/hpack_entry.h +++ b/spdy/core/hpack/hpack_entry.h
@@ -8,7 +8,6 @@ #include <cstddef> #include <cstdint> -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
diff --git a/spdy/core/hpack/hpack_header_table.cc b/spdy/core/hpack/hpack_header_table.cc index dbe565f..17f91cd 100644 --- a/spdy/core/hpack/hpack_header_table.cc +++ b/spdy/core/hpack/hpack_header_table.cc
@@ -6,11 +6,11 @@ #include <algorithm> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy { @@ -202,9 +202,9 @@ if (!index_result.second) { // An entry with the same name and value already exists in the dynamic // index. We should replace it with the newly added entry. - DVLOG(1) << "Found existing entry: " - << (*index_result.first)->GetDebugString() - << " replacing with: " << new_entry->GetDebugString(); + SPDY_DVLOG(1) << "Found existing entry: " + << (*index_result.first)->GetDebugString() + << " replacing with: " << new_entry->GetDebugString(); DCHECK_GT(new_entry->InsertionIndex(), (*index_result.first)->InsertionIndex()); dynamic_index_.erase(index_result.first); @@ -216,9 +216,9 @@ if (!name_result.second) { // An entry with the same name already exists in the dynamic index. We // should replace it with the newly added entry. - DVLOG(1) << "Found existing entry: " - << name_result.first->second->GetDebugString() - << " replacing with: " << new_entry->GetDebugString(); + SPDY_DVLOG(1) << "Found existing entry: " + << name_result.first->second->GetDebugString() + << " replacing with: " << new_entry->GetDebugString(); DCHECK_GT(new_entry->InsertionIndex(), name_result.first->second->InsertionIndex()); dynamic_name_index_.erase(name_result.first); @@ -233,35 +233,35 @@ // Call |debug_visitor_->OnNewEntry()| to get the current time. HpackEntry& entry = dynamic_entries_.front(); entry.set_time_added(debug_visitor_->OnNewEntry(entry)); - DVLOG(2) << "HpackHeaderTable::OnNewEntry: name=" << entry.name() - << ", value=" << entry.value() - << ", insert_index=" << entry.InsertionIndex() - << ", time_added=" << entry.time_added(); + SPDY_DVLOG(2) << "HpackHeaderTable::OnNewEntry: name=" << entry.name() + << ", value=" << entry.value() + << ", insert_index=" << entry.InsertionIndex() + << ", time_added=" << entry.time_added(); } return &dynamic_entries_.front(); } void HpackHeaderTable::DebugLogTableState() const { - DVLOG(2) << "Dynamic table:"; + SPDY_DVLOG(2) << "Dynamic table:"; for (auto it = dynamic_entries_.begin(); it != dynamic_entries_.end(); ++it) { - DVLOG(2) << " " << it->GetDebugString(); + SPDY_DVLOG(2) << " " << it->GetDebugString(); } - DVLOG(2) << "Full Static Index:"; + SPDY_DVLOG(2) << "Full Static Index:"; for (const auto* entry : static_index_) { - DVLOG(2) << " " << entry->GetDebugString(); + SPDY_DVLOG(2) << " " << entry->GetDebugString(); } - DVLOG(2) << "Full Static Name Index:"; + SPDY_DVLOG(2) << "Full Static Name Index:"; for (const auto it : static_name_index_) { - DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); + SPDY_DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); } - DVLOG(2) << "Full Dynamic Index:"; + SPDY_DVLOG(2) << "Full Dynamic Index:"; for (const auto* entry : dynamic_index_) { - DVLOG(2) << " " << entry->GetDebugString(); + SPDY_DVLOG(2) << " " << entry->GetDebugString(); } - DVLOG(2) << "Full Dynamic Name Index:"; + SPDY_DVLOG(2) << "Full Dynamic Name Index:"; for (const auto it : dynamic_name_index_) { - DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); + SPDY_DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); } }
diff --git a/spdy/core/hpack/hpack_header_table.h b/spdy/core/hpack/hpack_header_table.h index e85edb7..7ff49f3 100644 --- a/spdy/core/hpack/hpack_header_table.h +++ b/spdy/core/hpack/hpack_header_table.h
@@ -10,7 +10,6 @@ #include <deque> #include <memory> -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h"
diff --git a/spdy/core/hpack/hpack_header_table_test.cc b/spdy/core/hpack/hpack_header_table_test.cc index b032aba..6649cc2 100644 --- a/spdy/core/hpack/hpack_header_table_test.cc +++ b/spdy/core/hpack/hpack_header_table_test.cc
@@ -9,7 +9,6 @@ #include <set> #include <vector> -#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
diff --git a/spdy/core/hpack/hpack_huffman_table.cc b/spdy/core/hpack/hpack_huffman_table.cc index c917767..3c637a4 100644 --- a/spdy/core/hpack/hpack_huffman_table.cc +++ b/spdy/core/hpack/hpack_huffman_table.cc
@@ -9,9 +9,9 @@ #include <limits> #include <memory> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy {
diff --git a/spdy/core/hpack/hpack_huffman_table_test.cc b/spdy/core/hpack/hpack_huffman_table_test.cc index f30926c..2febbd8 100644 --- a/spdy/core/hpack/hpack_huffman_table_test.cc +++ b/spdy/core/hpack/hpack_huffman_table_test.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/macros.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
diff --git a/spdy/core/hpack/hpack_output_stream.cc b/spdy/core/hpack/hpack_output_stream.cc index 30b5662..fc01c3f 100644 --- a/spdy/core/hpack/hpack_output_stream.cc +++ b/spdy/core/hpack/hpack_output_stream.cc
@@ -6,8 +6,8 @@ #include <utility> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy {
diff --git a/spdy/core/hpack/hpack_output_stream.h b/spdy/core/hpack/hpack_output_stream.h index 450803f..0163146 100644 --- a/spdy/core/hpack/hpack_output_stream.h +++ b/spdy/core/hpack/hpack_output_stream.h
@@ -8,7 +8,6 @@ #include <cstdint> #include <map> -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
diff --git a/spdy/core/hpack/hpack_round_trip_test.cc b/spdy/core/hpack/hpack_round_trip_test.cc index bd4d6ee..17477a7 100644 --- a/spdy/core/hpack/hpack_round_trip_test.cc +++ b/spdy/core/hpack/hpack_round_trip_test.cc
@@ -78,8 +78,10 @@ HpackDecoderAdapter decoder_; }; -INSTANTIATE_TEST_SUITE_P(Tests, HpackRoundTripTest, - ::testing::Values(ALL_INPUT, ONE_BYTE, +INSTANTIATE_TEST_SUITE_P(Tests, + HpackRoundTripTest, + ::testing::Values(ALL_INPUT, + ONE_BYTE, ZERO_THEN_ONE_BYTE)); TEST_P(HpackRoundTripTest, ResponseFixtures) {
diff --git a/spdy/core/hpack/hpack_static_table.cc b/spdy/core/hpack/hpack_static_table.cc index 14e282e..eea1d9e 100644 --- a/spdy/core/hpack/hpack_static_table.cc +++ b/spdy/core/hpack/hpack_static_table.cc
@@ -4,10 +4,10 @@ #include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h" -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h" namespace spdy {
diff --git a/spdy/core/http2_frame_decoder_adapter.cc b/spdy/core/http2_frame_decoder_adapter.cc index c4e728d..e5e3e9a 100644 --- a/spdy/core/http2_frame_decoder_adapter.cc +++ b/spdy/core/http2_frame_decoder_adapter.cc
@@ -4,10 +4,10 @@ #include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h" -// Logging policy: If an error in the input is detected, VLOG(n) is used so that -// the option exists to debug the situation. Otherwise, this code mostly uses -// DVLOG so that the logging does not slow down production code when things are -// working OK. +// Logging policy: If an error in the input is detected, SPDY_VLOG(n) is used so +// that the option exists to debug the situation. Otherwise, this code mostly +// uses DVLOG so that the logging does not slow down production code when things +// are working OK. #include <stddef.h> @@ -15,7 +15,6 @@ #include <cstring> #include <utility> -#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.h" @@ -33,6 +32,7 @@ #include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" @@ -173,7 +173,7 @@ } Http2DecoderAdapter::Http2DecoderAdapter() { - DVLOG(1) << "Http2DecoderAdapter ctor"; + SPDY_DVLOG(1) << "Http2DecoderAdapter ctor"; ResetInternal(); } @@ -261,7 +261,7 @@ // This function is largely based on Http2DecoderAdapter::ValidateFrameHeader // and some parts of Http2DecoderAdapter::ProcessCommonHeader. bool Http2DecoderAdapter::OnFrameHeader(const Http2FrameHeader& header) { - DVLOG(1) << "OnFrameHeader: " << header; + SPDY_DVLOG(1) << "OnFrameHeader: " << header; decoded_frame_header_ = true; if (!latched_probable_http_response_) { latched_probable_http_response_ = header.IsProbableHttpResponse(); @@ -273,9 +273,10 @@ // Report an unexpected frame error and close the connection if we // expect a known frame type (probably CONTINUATION) and receive an // unknown frame. - VLOG(1) << "The framer was expecting to receive a " << expected_frame_type_ - << " frame, but instead received an unknown frame of type " - << header.type; + SPDY_VLOG(1) << "The framer was expecting to receive a " + << expected_frame_type_ + << " frame, but instead received an unknown frame of type " + << header.type; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_UNEXPECTED_FRAME); return false; } @@ -291,34 +292,34 @@ visitor()->OnUnknownFrame(header.stream_id, raw_frame_type); if (!valid_stream) { // Report an invalid frame error if the stream_id is not valid. - VLOG(1) << "Unknown control frame type " << header.type - << " received on invalid stream " << header.stream_id; + SPDY_VLOG(1) << "Unknown control frame type " << header.type + << " received on invalid stream " << header.stream_id; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_CONTROL_FRAME); return false; } else { - DVLOG(1) << "Ignoring unknown frame type " << header.type; + SPDY_DVLOG(1) << "Ignoring unknown frame type " << header.type; return true; } } SpdyFrameType frame_type = ToSpdyFrameType(header.type); if (!IsValidHTTP2FrameStreamId(header.stream_id, frame_type)) { - VLOG(1) << "The framer received an invalid streamID of " << header.stream_id - << " for a frame of type " << header.type; + SPDY_VLOG(1) << "The framer received an invalid streamID of " + << header.stream_id << " for a frame of type " << header.type; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_STREAM_ID); return false; } if (has_expected_frame_type_ && header.type != expected_frame_type_) { - VLOG(1) << "Expected frame type " << expected_frame_type_ << ", not " - << header.type; + SPDY_VLOG(1) << "Expected frame type " << expected_frame_type_ << ", not " + << header.type; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_UNEXPECTED_FRAME); return false; } if (!has_expected_frame_type_ && header.type == Http2FrameType::CONTINUATION) { - VLOG(1) << "Got CONTINUATION frame when not expected."; + SPDY_VLOG(1) << "Got CONTINUATION frame when not expected."; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_UNEXPECTED_FRAME); return false; } @@ -336,7 +337,7 @@ } void Http2DecoderAdapter::OnDataStart(const Http2FrameHeader& header) { - DVLOG(1) << "OnDataStart: " << header; + SPDY_DVLOG(1) << "OnDataStart: " << header; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { frame_header_ = header; @@ -347,14 +348,14 @@ } void Http2DecoderAdapter::OnDataPayload(const char* data, size_t len) { - DVLOG(1) << "OnDataPayload: len=" << len; + SPDY_DVLOG(1) << "OnDataPayload: len=" << len; DCHECK(has_frame_header_); DCHECK_EQ(frame_header_.type, Http2FrameType::DATA); visitor()->OnStreamFrameData(frame_header().stream_id, data, len); } void Http2DecoderAdapter::OnDataEnd() { - DVLOG(1) << "OnDataEnd"; + SPDY_DVLOG(1) << "OnDataEnd"; DCHECK(has_frame_header_); DCHECK_EQ(frame_header_.type, Http2FrameType::DATA); if (frame_header().IsEndStream()) { @@ -364,7 +365,7 @@ } void Http2DecoderAdapter::OnHeadersStart(const Http2FrameHeader& header) { - DVLOG(1) << "OnHeadersStart: " << header; + SPDY_DVLOG(1) << "OnHeadersStart: " << header; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { frame_header_ = header; has_frame_header_ = true; @@ -387,7 +388,7 @@ void Http2DecoderAdapter::OnHeadersPriority( const Http2PriorityFields& priority) { - DVLOG(1) << "OnHeadersPriority: " << priority; + SPDY_DVLOG(1) << "OnHeadersPriority: " << priority; DCHECK(has_frame_header_); DCHECK_EQ(frame_type(), Http2FrameType::HEADERS) << frame_header_; DCHECK(frame_header_.HasPriority()); @@ -402,7 +403,7 @@ } void Http2DecoderAdapter::OnHpackFragment(const char* data, size_t len) { - DVLOG(1) << "OnHpackFragment: len=" << len; + SPDY_DVLOG(1) << "OnHpackFragment: len=" << len; on_hpack_fragment_called_ = true; if (!GetHpackDecoder()->HandleControlFrameHeadersData(data, len)) { SetSpdyErrorAndNotify(SpdyFramerError::SPDY_DECOMPRESS_FAILURE); @@ -411,14 +412,14 @@ } void Http2DecoderAdapter::OnHeadersEnd() { - DVLOG(1) << "OnHeadersEnd"; + SPDY_DVLOG(1) << "OnHeadersEnd"; CommonHpackFragmentEnd(); opt_pad_length_.reset(); } void Http2DecoderAdapter::OnPriorityFrame(const Http2FrameHeader& header, const Http2PriorityFields& priority) { - DVLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority; + SPDY_DVLOG(1) << "OnPriorityFrame: " << header << "; priority: " << priority; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { visitor()->OnPriority(header.stream_id, priority.stream_dependency, priority.weight, priority.is_exclusive); @@ -426,7 +427,7 @@ } void Http2DecoderAdapter::OnContinuationStart(const Http2FrameHeader& header) { - DVLOG(1) << "OnContinuationStart: " << header; + SPDY_DVLOG(1) << "OnContinuationStart: " << header; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { DCHECK(has_hpack_first_frame_header_); if (header.stream_id != hpack_first_frame_header_.stream_id) { @@ -441,12 +442,12 @@ } void Http2DecoderAdapter::OnContinuationEnd() { - DVLOG(1) << "OnContinuationEnd"; + SPDY_DVLOG(1) << "OnContinuationEnd"; CommonHpackFragmentEnd(); } void Http2DecoderAdapter::OnPadLength(size_t trailing_length) { - DVLOG(1) << "OnPadLength: " << trailing_length; + SPDY_DVLOG(1) << "OnPadLength: " << trailing_length; opt_pad_length_ = trailing_length; DCHECK_LT(trailing_length, 256u); if (frame_header_.type == Http2FrameType::DATA) { @@ -456,7 +457,7 @@ void Http2DecoderAdapter::OnPadding(const char* padding, size_t skipped_length) { - DVLOG(1) << "OnPadding: " << skipped_length; + SPDY_DVLOG(1) << "OnPadding: " << skipped_length; if (frame_header_.type == Http2FrameType::DATA) { visitor()->OnStreamPadding(stream_id(), skipped_length); } else { @@ -466,7 +467,7 @@ void Http2DecoderAdapter::OnRstStream(const Http2FrameHeader& header, Http2ErrorCode http2_error_code) { - DVLOG(1) << "OnRstStream: " << header << "; code=" << http2_error_code; + SPDY_DVLOG(1) << "OnRstStream: " << header << "; code=" << http2_error_code; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { SpdyErrorCode error_code = ParseErrorCode(static_cast<uint32_t>(http2_error_code)); @@ -475,7 +476,7 @@ } void Http2DecoderAdapter::OnSettingsStart(const Http2FrameHeader& header) { - DVLOG(1) << "OnSettingsStart: " << header; + SPDY_DVLOG(1) << "OnSettingsStart: " << header; if (IsOkToStartFrame(header) && HasRequiredStreamIdZero(header)) { frame_header_ = header; has_frame_header_ = true; @@ -484,7 +485,7 @@ } void Http2DecoderAdapter::OnSetting(const Http2SettingFields& setting_fields) { - DVLOG(1) << "OnSetting: " << setting_fields; + SPDY_DVLOG(1) << "OnSetting: " << setting_fields; const auto parameter = static_cast<SpdySettingsId>(setting_fields.parameter); visitor()->OnSetting(parameter, setting_fields.value); if (extension_ != nullptr) { @@ -493,12 +494,12 @@ } void Http2DecoderAdapter::OnSettingsEnd() { - DVLOG(1) << "OnSettingsEnd"; + SPDY_DVLOG(1) << "OnSettingsEnd"; visitor()->OnSettingsEnd(); } void Http2DecoderAdapter::OnSettingsAck(const Http2FrameHeader& header) { - DVLOG(1) << "OnSettingsAck: " << header; + SPDY_DVLOG(1) << "OnSettingsAck: " << header; if (IsOkToStartFrame(header) && HasRequiredStreamIdZero(header)) { visitor()->OnSettingsAck(); } @@ -508,8 +509,8 @@ const Http2FrameHeader& header, const Http2PushPromiseFields& promise, size_t total_padding_length) { - DVLOG(1) << "OnPushPromiseStart: " << header << "; promise: " << promise - << "; total_padding_length: " << total_padding_length; + SPDY_DVLOG(1) << "OnPushPromiseStart: " << header << "; promise: " << promise + << "; total_padding_length: " << total_padding_length; if (IsOkToStartFrame(header) && HasRequiredStreamId(header)) { if (promise.promised_stream_id == 0) { SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_CONTROL_FRAME); @@ -525,14 +526,14 @@ } void Http2DecoderAdapter::OnPushPromiseEnd() { - DVLOG(1) << "OnPushPromiseEnd"; + SPDY_DVLOG(1) << "OnPushPromiseEnd"; CommonHpackFragmentEnd(); opt_pad_length_.reset(); } void Http2DecoderAdapter::OnPing(const Http2FrameHeader& header, const Http2PingFields& ping) { - DVLOG(1) << "OnPing: " << header << "; ping: " << ping; + SPDY_DVLOG(1) << "OnPing: " << header << "; ping: " << ping; if (IsOkToStartFrame(header) && HasRequiredStreamIdZero(header)) { visitor()->OnPing(ToSpdyPingId(ping), false); } @@ -540,7 +541,7 @@ void Http2DecoderAdapter::OnPingAck(const Http2FrameHeader& header, const Http2PingFields& ping) { - DVLOG(1) << "OnPingAck: " << header << "; ping: " << ping; + SPDY_DVLOG(1) << "OnPingAck: " << header << "; ping: " << ping; if (IsOkToStartFrame(header) && HasRequiredStreamIdZero(header)) { visitor()->OnPing(ToSpdyPingId(ping), true); } @@ -548,7 +549,7 @@ void Http2DecoderAdapter::OnGoAwayStart(const Http2FrameHeader& header, const Http2GoAwayFields& goaway) { - DVLOG(1) << "OnGoAwayStart: " << header << "; goaway: " << goaway; + SPDY_DVLOG(1) << "OnGoAwayStart: " << header << "; goaway: " << goaway; if (IsOkToStartFrame(header) && HasRequiredStreamIdZero(header)) { frame_header_ = header; has_frame_header_ = true; @@ -559,18 +560,18 @@ } void Http2DecoderAdapter::OnGoAwayOpaqueData(const char* data, size_t len) { - DVLOG(1) << "OnGoAwayOpaqueData: len=" << len; + SPDY_DVLOG(1) << "OnGoAwayOpaqueData: len=" << len; visitor()->OnGoAwayFrameData(data, len); } void Http2DecoderAdapter::OnGoAwayEnd() { - DVLOG(1) << "OnGoAwayEnd"; + SPDY_DVLOG(1) << "OnGoAwayEnd"; visitor()->OnGoAwayFrameData(nullptr, 0); } void Http2DecoderAdapter::OnWindowUpdate(const Http2FrameHeader& header, uint32_t increment) { - DVLOG(1) << "OnWindowUpdate: " << header << "; increment=" << increment; + SPDY_DVLOG(1) << "OnWindowUpdate: " << header << "; increment=" << increment; if (IsOkToStartFrame(header)) { visitor()->OnWindowUpdate(header.stream_id, increment); } @@ -583,9 +584,9 @@ void Http2DecoderAdapter::OnAltSvcStart(const Http2FrameHeader& header, size_t origin_length, size_t value_length) { - DVLOG(1) << "OnAltSvcStart: " << header - << "; origin_length: " << origin_length - << "; value_length: " << value_length; + SPDY_DVLOG(1) << "OnAltSvcStart: " << header + << "; origin_length: " << origin_length + << "; value_length: " << value_length; if (!IsOkToStartFrame(header)) { return; } @@ -596,20 +597,20 @@ } void Http2DecoderAdapter::OnAltSvcOriginData(const char* data, size_t len) { - DVLOG(1) << "OnAltSvcOriginData: len=" << len; + SPDY_DVLOG(1) << "OnAltSvcOriginData: len=" << len; alt_svc_origin_.append(data, len); } // Called when decoding the Alt-Svc-Field-Value of an ALTSVC; // the field is uninterpreted. void Http2DecoderAdapter::OnAltSvcValueData(const char* data, size_t len) { - DVLOG(1) << "OnAltSvcValueData: len=" << len; + SPDY_DVLOG(1) << "OnAltSvcValueData: len=" << len; alt_svc_value_.append(data, len); } void Http2DecoderAdapter::OnAltSvcEnd() { - DVLOG(1) << "OnAltSvcEnd: origin.size(): " << alt_svc_origin_.size() - << "; value.size(): " << alt_svc_value_.size(); + SPDY_DVLOG(1) << "OnAltSvcEnd: origin.size(): " << alt_svc_origin_.size() + << "; value.size(): " << alt_svc_value_.size(); SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector; if (!SpdyAltSvcWireFormat::ParseHeaderFieldValue(alt_svc_value_, &altsvc_vector)) { @@ -628,7 +629,7 @@ // Except for BLOCKED frames, all other unknown frames are either dropped or // passed to a registered extension. void Http2DecoderAdapter::OnUnknownStart(const Http2FrameHeader& header) { - DVLOG(1) << "OnUnknownStart: " << header; + SPDY_DVLOG(1) << "OnUnknownStart: " << header; if (IsOkToStartFrame(header)) { if (extension_ != nullptr) { const uint8_t type = static_cast<uint8_t>(header.type); @@ -643,19 +644,19 @@ if (handling_extension_payload_) { extension_->OnFramePayload(data, len); } else { - DVLOG(1) << "OnUnknownPayload: len=" << len; + SPDY_DVLOG(1) << "OnUnknownPayload: len=" << len; } } void Http2DecoderAdapter::OnUnknownEnd() { - DVLOG(1) << "OnUnknownEnd"; + SPDY_DVLOG(1) << "OnUnknownEnd"; handling_extension_payload_ = false; } void Http2DecoderAdapter::OnPaddingTooLong(const Http2FrameHeader& header, size_t missing_length) { - DVLOG(1) << "OnPaddingTooLong: " << header - << "; missing_length: " << missing_length; + SPDY_DVLOG(1) << "OnPaddingTooLong: " << header + << "; missing_length: " << missing_length; if (header.type == Http2FrameType::DATA) { if (header.payload_length == 0) { DCHECK_EQ(1u, missing_length); @@ -668,7 +669,7 @@ } void Http2DecoderAdapter::OnFrameSizeError(const Http2FrameHeader& header) { - DVLOG(1) << "OnFrameSizeError: " << header; + SPDY_DVLOG(1) << "OnFrameSizeError: " << header; size_t recv_limit = recv_frame_size_limit_; if (header.payload_length > recv_limit) { SetSpdyErrorAndNotify(SpdyFramerError::SPDY_OVERSIZED_PAYLOAD); @@ -698,8 +699,8 @@ if (spdy_state_ != SpdyState::SPDY_ERROR) { DetermineSpdyState(status); } else { - VLOG(1) << "ProcessInputFrame spdy_framer_error_=" - << SpdyFramerErrorToString(spdy_framer_error_); + SPDY_VLOG(1) << "ProcessInputFrame spdy_framer_error_=" + << SpdyFramerErrorToString(spdy_framer_error_); if (spdy_framer_error_ == SpdyFramerError::SPDY_INVALID_PADDING && has_frame_header_ && frame_type() != Http2FrameType::DATA) { // spdy_framer_test checks that all of the available frame payload @@ -707,8 +708,8 @@ size_t total = remaining_total_payload(); if (total <= frame_header().payload_length) { size_t avail = db.MinLengthRemaining(total); - VLOG(1) << "Skipping past " << avail << " bytes, of " << total - << " total remaining in the frame's payload."; + SPDY_VLOG(1) << "Skipping past " << avail << " bytes, of " << total + << " total remaining in the frame's payload."; db.AdvanceCursor(avail); } else { SPDY_BUG << "Total remaining (" << total @@ -729,11 +730,11 @@ DCHECK(!HasError()) << spdy_framer_error_; switch (status) { case DecodeStatus::kDecodeDone: - DVLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeDone"; + SPDY_DVLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeDone"; ResetBetweenFrames(); break; case DecodeStatus::kDecodeInProgress: - DVLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeInProgress"; + SPDY_DVLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeInProgress"; if (decoded_frame_header_) { if (IsDiscardingPayload()) { set_spdy_state(SpdyState::SPDY_IGNORE_REMAINING_PAYLOAD); @@ -753,7 +754,7 @@ } break; case DecodeStatus::kDecodeError: - VLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeError"; + SPDY_VLOG(1) << "ProcessInputFrame -> DecodeStatus::kDecodeError"; if (IsDiscardingPayload()) { if (remaining_total_payload() == 0) { // Push the Http2FrameDecoder out of state kDiscardPayload now @@ -808,7 +809,7 @@ } void Http2DecoderAdapter::set_spdy_state(SpdyState v) { - DVLOG(2) << "set_spdy_state(" << StateToString(v) << ")"; + SPDY_DVLOG(2) << "set_spdy_state(" << StateToString(v) << ")"; spdy_state_ = v; } @@ -816,8 +817,8 @@ if (HasError()) { DCHECK_EQ(spdy_state_, SpdyState::SPDY_ERROR); } else { - VLOG(2) << "SetSpdyErrorAndNotify(" << SpdyFramerErrorToString(error) - << ")"; + SPDY_VLOG(2) << "SetSpdyErrorAndNotify(" << SpdyFramerErrorToString(error) + << ")"; DCHECK_NE(error, SpdyFramerError::SPDY_NO_ERROR); spdy_framer_error_ = error; set_spdy_state(SpdyState::SPDY_ERROR); @@ -860,33 +861,33 @@ bool Http2DecoderAdapter::IsReadingPaddingLength() { bool result = frame_header_.IsPadded() && !opt_pad_length_; - DVLOG(2) << "Http2DecoderAdapter::IsReadingPaddingLength: " << result; + SPDY_DVLOG(2) << "Http2DecoderAdapter::IsReadingPaddingLength: " << result; return result; } bool Http2DecoderAdapter::IsSkippingPadding() { bool result = frame_header_.IsPadded() && opt_pad_length_ && frame_decoder_->remaining_payload() == 0 && frame_decoder_->remaining_padding() > 0; - DVLOG(2) << "Http2DecoderAdapter::IsSkippingPadding: " << result; + SPDY_DVLOG(2) << "Http2DecoderAdapter::IsSkippingPadding: " << result; return result; } bool Http2DecoderAdapter::IsDiscardingPayload() { bool result = decoded_frame_header_ && frame_decoder_->IsDiscardingPayload(); - DVLOG(2) << "Http2DecoderAdapter::IsDiscardingPayload: " << result; + SPDY_DVLOG(2) << "Http2DecoderAdapter::IsDiscardingPayload: " << result; return result; } // Called from OnXyz or OnXyzStart methods to decide whether it is OK to // handle the callback. bool Http2DecoderAdapter::IsOkToStartFrame(const Http2FrameHeader& header) { - DVLOG(3) << "IsOkToStartFrame"; + SPDY_DVLOG(3) << "IsOkToStartFrame"; if (HasError()) { - VLOG(2) << "HasError()"; + SPDY_VLOG(2) << "HasError()"; return false; } DCHECK(!has_frame_header_); if (has_expected_frame_type_ && header.type != expected_frame_type_) { - VLOG(1) << "Expected frame type " << expected_frame_type_ << ", not " - << header.type; + SPDY_VLOG(1) << "Expected frame type " << expected_frame_type_ << ", not " + << header.type; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_UNEXPECTED_FRAME); return false; } @@ -895,15 +896,15 @@ } bool Http2DecoderAdapter::HasRequiredStreamId(uint32_t stream_id) { - DVLOG(3) << "HasRequiredStreamId: " << stream_id; + SPDY_DVLOG(3) << "HasRequiredStreamId: " << stream_id; if (HasError()) { - VLOG(2) << "HasError()"; + SPDY_VLOG(2) << "HasError()"; return false; } if (stream_id != 0) { return true; } - VLOG(1) << "Stream Id is required, but zero provided"; + SPDY_VLOG(1) << "Stream Id is required, but zero provided"; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_STREAM_ID); return false; } @@ -913,15 +914,15 @@ } bool Http2DecoderAdapter::HasRequiredStreamIdZero(uint32_t stream_id) { - DVLOG(3) << "HasRequiredStreamIdZero: " << stream_id; + SPDY_DVLOG(3) << "HasRequiredStreamIdZero: " << stream_id; if (HasError()) { - VLOG(2) << "HasError()"; + SPDY_VLOG(2) << "HasError()"; return false; } if (stream_id == 0) { return true; } - VLOG(1) << "Stream Id was not zero, as required: " << stream_id; + SPDY_VLOG(1) << "Stream Id was not zero, as required: " << stream_id; SetSpdyErrorAndNotify(SpdyFramerError::SPDY_INVALID_STREAM_ID); return false; } @@ -948,7 +949,7 @@ } void Http2DecoderAdapter::CommonStartHpackBlock() { - DVLOG(1) << "CommonStartHpackBlock"; + SPDY_DVLOG(1) << "CommonStartHpackBlock"; DCHECK(!has_hpack_first_frame_header_); if (!frame_header_.IsEndHeaders()) { hpack_first_frame_header_ = frame_header_; @@ -977,9 +978,9 @@ } void Http2DecoderAdapter::CommonHpackFragmentEnd() { - DVLOG(1) << "CommonHpackFragmentEnd: stream_id=" << stream_id(); + SPDY_DVLOG(1) << "CommonHpackFragmentEnd: stream_id=" << stream_id(); if (HasError()) { - VLOG(1) << "HasError(), returning"; + SPDY_VLOG(1) << "HasError(), returning"; return; } DCHECK(has_frame_header_);
diff --git a/spdy/core/priority_write_scheduler.h b/spdy/core/priority_write_scheduler.h index d5c3c44..b02d463 100644 --- a/spdy/core/priority_write_scheduler.h +++ b/spdy/core/priority_write_scheduler.h
@@ -13,11 +13,11 @@ #include <utility> #include <vector> -#include "base/logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_containers.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/write_scheduler.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_macros.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" @@ -92,7 +92,7 @@ StreamIdType stream_id) const override { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - DVLOG(1) << "Stream " << stream_id << " not registered"; + SPDY_DVLOG(1) << "Stream " << stream_id << " not registered"; return StreamPrecedenceType(kV3LowestPriority); } return StreamPrecedenceType(it->second.priority); @@ -113,7 +113,7 @@ auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { // TODO(mpw): add to stream_infos_ on demand--see b/15676312. - DVLOG(1) << "Stream " << stream_id << " not registered"; + SPDY_DVLOG(1) << "Stream " << stream_id << " not registered"; return; } StreamInfo& stream_info = it->second; @@ -266,7 +266,7 @@ bool IsStreamReady(StreamIdType stream_id) const { auto it = stream_infos_.find(stream_id); if (it == stream_infos_.end()) { - DLOG(INFO) << "Stream " << stream_id << " not registered"; + SPDY_DLOG(INFO) << "Stream " << stream_id << " not registered"; return false; } return it->second.ready;
diff --git a/spdy/core/spdy_alt_svc_wire_format.cc b/spdy/core/spdy_alt_svc_wire_format.cc index 15234a6..d230ae0 100644 --- a/spdy/core/spdy_alt_svc_wire_format.cc +++ b/spdy/core/spdy_alt_svc_wire_format.cc
@@ -8,7 +8,7 @@ #include <cctype> #include <limits> -#include "base/logging.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" namespace spdy {
diff --git a/spdy/core/spdy_alt_svc_wire_format_test.cc b/spdy/core/spdy_alt_svc_wire_format_test.cc index c2595f0..c30edf2 100644 --- a/spdy/core/spdy_alt_svc_wire_format_test.cc +++ b/spdy/core/spdy_alt_svc_wire_format_test.cc
@@ -4,9 +4,9 @@ #include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h" -#include "base/logging.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy {
diff --git a/spdy/core/spdy_deframer_visitor.cc b/spdy/core/spdy_deframer_visitor.cc index 76188e9..ac93de4 100644 --- a/spdy/core/spdy_deframer_visitor.cc +++ b/spdy/core/spdy_deframer_visitor.cc
@@ -11,7 +11,6 @@ #include <limits> #include <memory> -#include "base/logging.h" #include "testing/gmock/include/gmock/gmock.h" #include "net/third_party/quiche/src/http2/platform/api/http2_macros.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" @@ -20,6 +19,7 @@ #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h" @@ -245,7 +245,7 @@ } void SpdyTestDeframerImpl::AtDataEnd() { - DVLOG(1) << "AtDataEnd"; + SPDY_DVLOG(1) << "AtDataEnd"; CHECK_EQ(data_len_, padding_len_ + data_->size()); auto ptr = SpdyMakeUnique<SpdyDataIR>(stream_id_, std::move(*data_)); CHECK_EQ(0u, data_->size()); @@ -266,7 +266,7 @@ } void SpdyTestDeframerImpl::AtGoAwayEnd() { - DVLOG(1) << "AtDataEnd"; + SPDY_DVLOG(1) << "AtDataEnd"; CHECK_EQ(frame_type_, GOAWAY); if (HTTP2_DIE_IF_NULL(goaway_description_)->empty()) { listener_->OnGoAway(std::move(goaway_ir_)); @@ -282,7 +282,7 @@ } void SpdyTestDeframerImpl::AtHeadersEnd() { - DVLOG(1) << "AtDataEnd"; + SPDY_DVLOG(1) << "AtDataEnd"; CHECK(frame_type_ == HEADERS || frame_type_ == CONTINUATION) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_); @@ -310,7 +310,7 @@ } void SpdyTestDeframerImpl::AtPushPromiseEnd() { - DVLOG(1) << "AtDataEnd"; + SPDY_DVLOG(1) << "AtDataEnd"; CHECK(frame_type_ == PUSH_PROMISE || frame_type_ == CONTINUATION) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(end_) << " frame_type_=" << Http2FrameTypeToString(frame_type_); @@ -372,7 +372,7 @@ } else if (push_promise_ir_) { AtPushPromiseEnd(); } else { - LOG(FATAL) << "Where is the SpdyFrameIR for the headers!"; + SPDY_LOG(FATAL) << "Where is the SpdyFrameIR for the headers!"; } } else { incomplete_logical_header = true; @@ -413,7 +413,7 @@ SpdyStreamId stream_id, SpdyStringPiece origin, const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) { - DVLOG(1) << "OnAltSvc stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnAltSvc stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -430,7 +430,7 @@ // PUSH_PROMISE or CONTINUATION). The last such frame has the END flag set. // SpdyFramer ensures that the behavior is correct before calling the visitor. void SpdyTestDeframerImpl::OnContinuation(SpdyStreamId stream_id, bool end) { - DVLOG(1) << "OnContinuation stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnContinuation stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -447,7 +447,7 @@ void SpdyTestDeframerImpl::OnDataFrameHeader(SpdyStreamId stream_id, size_t length, bool fin) { - DVLOG(1) << "OnDataFrameHeader stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnDataFrameHeader stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -463,9 +463,9 @@ // The SpdyFramer will not process any more data at this point. void SpdyTestDeframerImpl::OnError( http2::Http2DecoderAdapter::SpdyFramerError error) { - DVLOG(1) << "SpdyFramer detected an error in the stream: " - << http2::Http2DecoderAdapter::SpdyFramerErrorToString(error) - << " frame_type_: " << Http2FrameTypeToString(frame_type_); + SPDY_DVLOG(1) << "SpdyFramer detected an error in the stream: " + << http2::Http2DecoderAdapter::SpdyFramerErrorToString(error) + << " frame_type_: " << Http2FrameTypeToString(frame_type_); listener_->OnError(error, this); } @@ -476,8 +476,8 @@ // to indicate the end of the GOAWAY frame. void SpdyTestDeframerImpl::OnGoAway(SpdyStreamId last_good_stream_id, SpdyErrorCode error_code) { - DVLOG(1) << "OnGoAway last_good_stream_id: " << last_good_stream_id - << " error code: " << error_code; + SPDY_DVLOG(1) << "OnGoAway last_good_stream_id: " << last_good_stream_id + << " error code: " << error_code; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); frame_type_ = GOAWAY; @@ -489,7 +489,7 @@ // If len==0 then we've reached the end of the GOAWAY frame. bool SpdyTestDeframerImpl::OnGoAwayFrameData(const char* goaway_data, size_t len) { - DVLOG(1) << "OnGoAwayFrameData"; + SPDY_DVLOG(1) << "OnGoAwayFrameData"; CHECK_EQ(frame_type_, GOAWAY) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(goaway_description_ != nullptr); @@ -503,7 +503,7 @@ } void SpdyTestDeframerImpl::OnHeaderFrameEnd(SpdyStreamId stream_id) { - DVLOG(1) << "OnHeaderFrameEnd stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnHeaderFrameEnd stream_id: " << stream_id; } // Received the fixed portion of a HEADERS frame. Called before the variable @@ -520,7 +520,7 @@ bool exclusive, bool fin, bool end) { - DVLOG(1) << "OnHeaders stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnHeaders stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -548,8 +548,8 @@ // or frame id, as the SpdyPingId naming might imply. // Responding to a PING is supposed to be at the highest priority. void SpdyTestDeframerImpl::OnPing(uint64_t unique_id, bool is_ack) { - DVLOG(1) << "OnPing unique_id: " << unique_id - << " is_ack: " << (is_ack ? "true" : "false"); + SPDY_DVLOG(1) << "OnPing unique_id: " << unique_id + << " is_ack: " << (is_ack ? "true" : "false"); CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); auto ptr = SpdyMakeUnique<SpdyPingIR>(unique_id); @@ -565,7 +565,7 @@ SpdyStreamId parent_stream_id, int weight, bool exclusive) { - DVLOG(1) << "OnPriority stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnPriority stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -577,7 +577,7 @@ void SpdyTestDeframerImpl::OnPushPromise(SpdyStreamId stream_id, SpdyStreamId promised_stream_id, bool end) { - DVLOG(1) << "OnPushPromise stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnPushPromise stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -596,8 +596,8 @@ // frames for this stream, which we can ignore. void SpdyTestDeframerImpl::OnRstStream(SpdyStreamId stream_id, SpdyErrorCode error_code) { - DVLOG(1) << "OnRstStream stream_id: " << stream_id - << " error code: " << error_code; + SPDY_DVLOG(1) << "OnRstStream stream_id: " << stream_id + << " error code: " << error_code; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_GT(stream_id, 0u); @@ -609,7 +609,7 @@ // Called for an individual setting. There is no negotiation; the sender is // stating the value that the sender is using. void SpdyTestDeframerImpl::OnSetting(SpdySettingsId id, uint32_t value) { - DVLOG(1) << "OnSetting id: " << id << std::hex << " value: " << value; + SPDY_DVLOG(1) << "OnSetting id: " << id << std::hex << " value: " << value; CHECK_EQ(frame_type_, SETTINGS) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(settings_ != nullptr); @@ -624,7 +624,7 @@ // (required) ACK of a SETTINGS frame. There is no stream_id because // the settings apply to the entire connection, not to an individual stream. void SpdyTestDeframerImpl::OnSettings() { - DVLOG(1) << "OnSettings"; + SPDY_DVLOG(1) << "OnSettings"; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_EQ(nullptr, settings_ir_.get()); @@ -637,7 +637,7 @@ } void SpdyTestDeframerImpl::OnSettingsAck() { - DVLOG(1) << "OnSettingsAck"; + SPDY_DVLOG(1) << "OnSettingsAck"; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); auto ptr = SpdyMakeUnique<SpdySettingsIR>(); @@ -646,7 +646,7 @@ } void SpdyTestDeframerImpl::OnSettingsEnd() { - DVLOG(1) << "OnSettingsEnd"; + SPDY_DVLOG(1) << "OnSettingsEnd"; CHECK_EQ(frame_type_, SETTINGS) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK(!ack_); @@ -661,7 +661,7 @@ // frame with the END_STREAM flag set. Doesn't apply to PUSH_PROMISE frames // because they don't have END_STREAM flags. void SpdyTestDeframerImpl::OnStreamEnd(SpdyStreamId stream_id) { - DVLOG(1) << "OnStreamEnd stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnStreamEnd stream_id: " << stream_id; CHECK_EQ(stream_id_, stream_id); CHECK(frame_type_ == DATA || frame_type_ == HEADERS || frame_type_ == CONTINUATION) @@ -677,8 +677,8 @@ void SpdyTestDeframerImpl::OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) { - DVLOG(1) << "OnStreamFrameData stream_id: " << stream_id - << " len: " << len; + SPDY_DVLOG(1) << "OnStreamFrameData stream_id: " << stream_id + << " len: " << len; CHECK_EQ(stream_id_, stream_id); CHECK_EQ(frame_type_, DATA); data_->append(data, len); @@ -688,8 +688,8 @@ // payload. value will be in the range 0 to 255. void SpdyTestDeframerImpl::OnStreamPadLength(SpdyStreamId stream_id, size_t value) { - DVLOG(1) << "OnStreamPadding stream_id: " << stream_id - << " value: " << value; + SPDY_DVLOG(1) << "OnStreamPadding stream_id: " << stream_id + << " value: " << value; CHECK(frame_type_ == DATA || frame_type_ == HEADERS || frame_type_ == PUSH_PROMISE) << " frame_type_=" << Http2FrameTypeToString(frame_type_); @@ -703,7 +703,8 @@ // Called when padding is skipped over at the end of the DATA frame. len will // be in the range 1 to 255. void SpdyTestDeframerImpl::OnStreamPadding(SpdyStreamId stream_id, size_t len) { - DVLOG(1) << "OnStreamPadding stream_id: " << stream_id << " len: " << len; + SPDY_DVLOG(1) << "OnStreamPadding stream_id: " << stream_id + << " len: " << len; CHECK(frame_type_ == DATA || frame_type_ == HEADERS || frame_type_ == PUSH_PROMISE) << " frame_type_=" << Http2FrameTypeToString(frame_type_); @@ -720,8 +721,8 @@ // closed. void SpdyTestDeframerImpl::OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) { - DVLOG(1) << "OnWindowUpdate stream_id: " << stream_id - << " delta_window_size: " << delta_window_size; + SPDY_DVLOG(1) << "OnWindowUpdate stream_id: " << stream_id + << " delta_window_size: " << delta_window_size; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); CHECK_NE(0, delta_window_size); @@ -736,7 +737,7 @@ // frame types are unsupported. bool SpdyTestDeframerImpl::OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) { - DVLOG(1) << "OnAltSvc stream_id: " << stream_id; + SPDY_DVLOG(1) << "OnAltSvc stream_id: " << stream_id; CHECK_EQ(frame_type_, UNSET) << " frame_type_=" << Http2FrameTypeToString(frame_type_); frame_type_ = UNKNOWN; @@ -789,15 +790,15 @@ ~LoggingSpdyDeframerDelegate() override = default; void OnAltSvc(std::unique_ptr<SpdyAltSvcIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnAltSvc"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnAltSvc"; wrapped_->OnAltSvc(std::move(frame)); } void OnData(std::unique_ptr<SpdyDataIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnData"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnData"; wrapped_->OnData(std::move(frame)); } void OnGoAway(std::unique_ptr<SpdyGoAwayIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnGoAway"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnGoAway"; wrapped_->OnGoAway(std::move(frame)); } @@ -806,21 +807,21 @@ // and value strings) are provided in a vector. void OnHeaders(std::unique_ptr<SpdyHeadersIR> frame, std::unique_ptr<StringPairVector> headers) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnHeaders"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnHeaders"; wrapped_->OnHeaders(std::move(frame), std::move(headers)); } void OnPing(std::unique_ptr<SpdyPingIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPing"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPing"; wrapped_->OnPing(std::move(frame)); } void OnPingAck(std::unique_ptr<SpdyPingIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPingAck"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPingAck"; wrapped_->OnPingAck(std::move(frame)); } void OnPriority(std::unique_ptr<SpdyPriorityIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPriority"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPriority"; wrapped_->OnPriority(std::move(frame)); } @@ -829,12 +830,12 @@ // and value strings) are provided in a vector. void OnPushPromise(std::unique_ptr<SpdyPushPromiseIR> frame, std::unique_ptr<StringPairVector> headers) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPushPromise"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnPushPromise"; wrapped_->OnPushPromise(std::move(frame), std::move(headers)); } void OnRstStream(std::unique_ptr<SpdyRstStreamIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnRstStream"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnRstStream"; wrapped_->OnRstStream(std::move(frame)); } @@ -843,26 +844,26 @@ // the actual settings (parameter and value) are provided in a vector. void OnSettings(std::unique_ptr<SpdySettingsIR> frame, std::unique_ptr<SettingVector> settings) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnSettings"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnSettings"; wrapped_->OnSettings(std::move(frame), std::move(settings)); } // A settings frame with an ACK has no content, but for uniformity passing // a frame with the ACK flag set. void OnSettingsAck(std::unique_ptr<SpdySettingsIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnSettingsAck"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnSettingsAck"; wrapped_->OnSettingsAck(std::move(frame)); } void OnWindowUpdate(std::unique_ptr<SpdyWindowUpdateIR> frame) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnWindowUpdate"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnWindowUpdate"; wrapped_->OnWindowUpdate(std::move(frame)); } // The SpdyFramer will not process any more data at this point. void OnError(http2::Http2DecoderAdapter::SpdyFramerError error, SpdyTestDeframer* deframer) override { - DVLOG(1) << "LoggingSpdyDeframerDelegate::OnError"; + SPDY_DVLOG(1) << "LoggingSpdyDeframerDelegate::OnError"; wrapped_->OnError(error, deframer); }
diff --git a/spdy/core/spdy_deframer_visitor.h b/spdy/core/spdy_deframer_visitor.h index 50d9987..e3d01b2 100644 --- a/spdy/core/spdy_deframer_visitor.h +++ b/spdy/core/spdy_deframer_visitor.h
@@ -74,13 +74,12 @@ #include <utility> #include <vector> -#include "base/logging.h" -#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.h" #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" namespace spdy {
diff --git a/spdy/core/spdy_deframer_visitor_test.cc b/spdy/core/spdy_deframer_visitor_test.cc index ede1a20..e4f7218 100644 --- a/spdy/core/spdy_deframer_visitor_test.cc +++ b/spdy/core/spdy_deframer_visitor_test.cc
@@ -9,7 +9,6 @@ #include <algorithm> #include <limits> -#include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/http2/test_tools/http2_random.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" @@ -20,6 +19,7 @@ #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.h" #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" namespace spdy {
diff --git a/spdy/core/spdy_frame_builder.cc b/spdy/core/spdy_frame_builder.cc index a056b70..f4b71d3 100644 --- a/spdy/core/spdy_frame_builder.cc +++ b/spdy/core/spdy_frame_builder.cc
@@ -9,10 +9,10 @@ #include <limits> #include <new> -#include "base/logging.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/zero_copy_output_buffer.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy { @@ -167,8 +167,8 @@ if (output_ == nullptr) { if (offset_ + length_ + length > capacity_) { - DLOG(FATAL) << "Requested: " << length << " capacity: " << capacity_ - << " used: " << offset_ + length_; + SPDY_DLOG(FATAL) << "Requested: " << length << " capacity: " << capacity_ + << " used: " << offset_ + length_; return false; } } else {
diff --git a/spdy/core/spdy_framer.cc b/spdy/core/spdy_framer.cc index a9252a1..4e3ad1b 100644 --- a/spdy/core/spdy_framer.cc +++ b/spdy/core/spdy_framer.cc
@@ -10,7 +10,6 @@ #include <list> #include <new> -#include "base/logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_macros.h" #include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h" #include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h" @@ -18,6 +17,7 @@ #include "net/third_party/quiche/src/spdy/core/spdy_frame_reader.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" @@ -129,7 +129,7 @@ } if (!ret) { - DLOG(WARNING) << "Failed to build HEADERS. Not enough space in output"; + SPDY_DLOG(WARNING) << "Failed to build HEADERS. Not enough space in output"; } return ret; } @@ -159,8 +159,9 @@ ok = builder.WriteBytes(padding.data(), padding.length()); } - DLOG_IF(ERROR, !ok) << "Failed to write PUSH_PROMISE encoding, not enough " - << "space in output"; + SPDY_DLOG_IF(ERROR, !ok) + << "Failed to write PUSH_PROMISE encoding, not enough " + << "space in output"; return ok; } @@ -176,8 +177,8 @@ } else if (type == SpdyFrameType::PUSH_PROMISE) { end_flag = PUSH_PROMISE_FLAG_END_PUSH_PROMISE; } else { - DLOG(FATAL) << "CONTINUATION frames cannot be used with frame type " - << FrameTypeToString(type); + SPDY_DLOG(FATAL) << "CONTINUATION frames cannot be used with frame type " + << FrameTypeToString(type); } // Write all the padding payload and as much of the data payload as possible @@ -421,7 +422,7 @@ static_cast<const SpdyPushPromiseIR*>(frame_ir.release()))); } case SpdyFrameType::DATA: { - DVLOG(1) << "Serialize a stream end DATA frame for VTL"; + SPDY_DVLOG(1) << "Serialize a stream end DATA frame for VTL"; HTTP2_FALLTHROUGH; } default: {
diff --git a/spdy/core/spdy_framer_test.cc b/spdy/core/spdy_framer_test.cc index 3841172..0caa160 100644 --- a/spdy/core/spdy_framer_test.cc +++ b/spdy/core/spdy_framer_test.cc
@@ -12,8 +12,6 @@ #include <tuple> #include <vector> -#include "base/logging.h" -#include "base/macros.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/spdy/core/array_output_buffer.h" @@ -26,6 +24,7 @@ #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" @@ -65,8 +64,9 @@ size_t size_verified = 0; for (const auto& frame : *frame_list) { if (arg.size() < size_verified + frame.size()) { - LOG(FATAL) << "Incremental header serialization should not lead to a " - << "higher total frame length than non-incremental method."; + SPDY_LOG(FATAL) + << "Incremental header serialization should not lead to a " + << "higher total frame length than non-incremental method."; return false; } if (memcmp(arg.data() + size_verified, frame.data(), frame.size())) { @@ -269,16 +269,16 @@ header_buffer_valid_(false) {} void OnError(Http2DecoderAdapter::SpdyFramerError error) override { - VLOG(1) << "SpdyFramer Error: " - << Http2DecoderAdapter::SpdyFramerErrorToString(error); + SPDY_VLOG(1) << "SpdyFramer Error: " + << Http2DecoderAdapter::SpdyFramerErrorToString(error); ++error_count_; } void OnDataFrameHeader(SpdyStreamId stream_id, size_t length, bool fin) override { - VLOG(1) << "OnDataFrameHeader(" << stream_id << ", " << length << ", " - << fin << ")"; + SPDY_VLOG(1) << "OnDataFrameHeader(" << stream_id << ", " << length << ", " + << fin << ")"; ++data_frame_count_; header_stream_id_ = stream_id; } @@ -286,29 +286,30 @@ void OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) override { - VLOG(1) << "OnStreamFrameData(" << stream_id << ", data, " << len << ", " - << ") data:\n" - << SpdyHexDump(SpdyStringPiece(data, len)); + SPDY_VLOG(1) << "OnStreamFrameData(" << stream_id << ", data, " << len + << ", " + << ") data:\n" + << SpdyHexDump(SpdyStringPiece(data, len)); EXPECT_EQ(header_stream_id_, stream_id); data_bytes_ += len; } void OnStreamEnd(SpdyStreamId stream_id) override { - VLOG(1) << "OnStreamEnd(" << stream_id << ")"; + SPDY_VLOG(1) << "OnStreamEnd(" << stream_id << ")"; EXPECT_EQ(header_stream_id_, stream_id); ++end_of_stream_count_; } void OnStreamPadLength(SpdyStreamId stream_id, size_t value) override { - VLOG(1) << "OnStreamPadding(" << stream_id << ", " << value << ")\n"; + SPDY_VLOG(1) << "OnStreamPadding(" << stream_id << ", " << value << ")\n"; EXPECT_EQ(header_stream_id_, stream_id); // Count the padding length field byte against total data bytes. data_bytes_ += 1; } void OnStreamPadding(SpdyStreamId stream_id, size_t len) override { - VLOG(1) << "OnStreamPadding(" << stream_id << ", " << len << ")\n"; + SPDY_VLOG(1) << "OnStreamPadding(" << stream_id << ", " << len << ")\n"; EXPECT_EQ(header_stream_id_, stream_id); data_bytes_ += len; } @@ -329,33 +330,34 @@ } void OnRstStream(SpdyStreamId stream_id, SpdyErrorCode error_code) override { - VLOG(1) << "OnRstStream(" << stream_id << ", " << error_code << ")"; + SPDY_VLOG(1) << "OnRstStream(" << stream_id << ", " << error_code << ")"; ++fin_frame_count_; } void OnSetting(SpdySettingsId id, uint32_t value) override { - VLOG(1) << "OnSetting(" << id << ", " << std::hex << value << ")"; + SPDY_VLOG(1) << "OnSetting(" << id << ", " << std::hex << value << ")"; ++setting_count_; } void OnSettingsAck() override { - VLOG(1) << "OnSettingsAck"; + SPDY_VLOG(1) << "OnSettingsAck"; ++settings_ack_received_; } void OnSettingsEnd() override { - VLOG(1) << "OnSettingsEnd"; + SPDY_VLOG(1) << "OnSettingsEnd"; ++settings_ack_sent_; } void OnPing(SpdyPingId unique_id, bool is_ack) override { - LOG(DFATAL) << "OnPing(" << unique_id << ", " << (is_ack ? 1 : 0) << ")"; + SPDY_LOG(DFATAL) << "OnPing(" << unique_id << ", " << (is_ack ? 1 : 0) + << ")"; } void OnGoAway(SpdyStreamId last_accepted_stream_id, SpdyErrorCode error_code) override { - VLOG(1) << "OnGoAway(" << last_accepted_stream_id << ", " << error_code - << ")"; + SPDY_VLOG(1) << "OnGoAway(" << last_accepted_stream_id << ", " << error_code + << ")"; ++goaway_count_; } @@ -366,9 +368,9 @@ bool exclusive, bool fin, bool end) override { - VLOG(1) << "OnHeaders(" << stream_id << ", " << has_priority << ", " - << weight << ", " << parent_stream_id << ", " << exclusive << ", " - << fin << ", " << end << ")"; + SPDY_VLOG(1) << "OnHeaders(" << stream_id << ", " << has_priority << ", " + << weight << ", " << parent_stream_id << ", " << exclusive + << ", " << fin << ", " << end << ")"; ++headers_frame_count_; InitHeaderStreaming(SpdyFrameType::HEADERS, stream_id); if (fin) { @@ -380,8 +382,8 @@ } void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override { - VLOG(1) << "OnWindowUpdate(" << stream_id << ", " << delta_window_size - << ")"; + SPDY_VLOG(1) << "OnWindowUpdate(" << stream_id << ", " << delta_window_size + << ")"; last_window_update_stream_ = stream_id; last_window_update_delta_ = delta_window_size; } @@ -389,8 +391,8 @@ void OnPushPromise(SpdyStreamId stream_id, SpdyStreamId promised_stream_id, bool end) override { - VLOG(1) << "OnPushPromise(" << stream_id << ", " << promised_stream_id - << ", " << end << ")"; + SPDY_VLOG(1) << "OnPushPromise(" << stream_id << ", " << promised_stream_id + << ", " << end << ")"; ++push_promise_frame_count_; InitHeaderStreaming(SpdyFrameType::PUSH_PROMISE, stream_id); last_push_promise_stream_ = stream_id; @@ -398,7 +400,7 @@ } void OnContinuation(SpdyStreamId stream_id, bool end) override { - VLOG(1) << "OnContinuation(" << stream_id << ", " << end << ")"; + SPDY_VLOG(1) << "OnContinuation(" << stream_id << ", " << end << ")"; ++continuation_count_; } @@ -406,8 +408,8 @@ SpdyStringPiece origin, const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) override { - VLOG(1) << "OnAltSvc(" << stream_id << ", \"" << origin - << "\", altsvc_vector)"; + SPDY_VLOG(1) << "OnAltSvc(" << stream_id << ", \"" << origin + << "\", altsvc_vector)"; test_altsvc_ir_ = SpdyMakeUnique<SpdyAltSvcIR>(stream_id); if (origin.length() > 0) { test_altsvc_ir_->set_origin(SpdyString(origin)); @@ -422,13 +424,13 @@ SpdyStreamId parent_stream_id, int weight, bool exclusive) override { - VLOG(1) << "OnPriority(" << stream_id << ", " << parent_stream_id << ", " - << weight << ", " << (exclusive ? 1 : 0) << ")"; + SPDY_VLOG(1) << "OnPriority(" << stream_id << ", " << parent_stream_id + << ", " << weight << ", " << (exclusive ? 1 : 0) << ")"; ++priority_count_; } bool OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) override { - VLOG(1) << "OnUnknownFrame(" << stream_id << ", " << frame_type << ")"; + SPDY_VLOG(1) << "OnUnknownFrame(" << stream_id << ", " << frame_type << ")"; return on_unknown_frame_result_; } @@ -436,8 +438,8 @@ SpdyFrameType type, size_t payload_len, size_t frame_len) override { - VLOG(1) << "OnSendCompressedFrame(" << stream_id << ", " << type << ", " - << payload_len << ", " << frame_len << ")"; + SPDY_VLOG(1) << "OnSendCompressedFrame(" << stream_id << ", " << type + << ", " << payload_len << ", " << frame_len << ")"; last_payload_len_ = payload_len; last_frame_len_ = frame_len; } @@ -445,8 +447,8 @@ void OnReceiveCompressedFrame(SpdyStreamId stream_id, SpdyFrameType type, size_t frame_len) override { - VLOG(1) << "OnReceiveCompressedFrame(" << stream_id << ", " << type << ", " - << frame_len << ")"; + SPDY_VLOG(1) << "OnReceiveCompressedFrame(" << stream_id << ", " << type + << ", " << frame_len << ")"; last_frame_len_ = frame_len; } @@ -472,8 +474,8 @@ void InitHeaderStreaming(SpdyFrameType header_control_type, SpdyStreamId stream_id) { if (!IsDefinedFrameType(SerializeFrameType(header_control_type))) { - DLOG(FATAL) << "Attempted to init header streaming with " - << "invalid control frame type: " << header_control_type; + SPDY_DLOG(FATAL) << "Attempted to init header streaming with " + << "invalid control frame type: " << header_control_type; } memset(header_buffer_.get(), 0, header_buffer_size_); header_buffer_length_ = 0; @@ -615,7 +617,8 @@ Http2DecoderAdapter deframer_; }; -INSTANTIATE_TEST_SUITE_P(SpdyFramerTests, SpdyFramerTest, +INSTANTIATE_TEST_SUITE_P(SpdyFramerTests, + SpdyFramerTest, ::testing::Values(USE, NOT_USE)); // Test that we can encode and decode a SpdyHeaderBlock in serialized form. @@ -4641,8 +4644,8 @@ const size_t frame1_size = frame1.size(); const size_t frame2_size = frame2.size(); - VLOG(1) << "frame1_size = " << frame1_size; - VLOG(1) << "frame2_size = " << frame2_size; + SPDY_VLOG(1) << "frame1_size = " << frame1_size; + SPDY_VLOG(1) << "frame2_size = " << frame2_size; SpdyString input_buffer; input_buffer.append(frame1.data(), frame1_size); @@ -4651,7 +4654,7 @@ const char* buf = input_buffer.data(); const size_t buf_size = input_buffer.size(); - VLOG(1) << "buf_size = " << buf_size; + SPDY_VLOG(1) << "buf_size = " << buf_size; size_t processed = deframer_.ProcessInput(buf, buf_size); EXPECT_EQ(buf_size, processed); @@ -4688,8 +4691,8 @@ const size_t frame1_size = frame1.size(); const size_t frame2_size = frame2.size(); - VLOG(1) << "frame1_size = " << frame1_size; - VLOG(1) << "frame2_size = " << frame2_size; + SPDY_VLOG(1) << "frame1_size = " << frame1_size; + SPDY_VLOG(1) << "frame2_size = " << frame2_size; SpdyString input_buffer; input_buffer.append(frame1.data(), frame1_size); @@ -4698,10 +4701,10 @@ const char* buf = input_buffer.data(); const size_t buf_size = input_buffer.size(); - VLOG(1) << "buf_size = " << buf_size; + SPDY_VLOG(1) << "buf_size = " << buf_size; for (size_t first_size = 0; first_size <= buf_size; ++first_size) { - VLOG(1) << "first_size = " << first_size; + SPDY_VLOG(1) << "first_size = " << first_size; auto visitor = SpdyMakeUnique<TestSpdyVisitor>(SpdyFramer::DISABLE_COMPRESSION); deframer_.set_visitor(visitor.get()); @@ -4720,7 +4723,7 @@ const char* rest = buf + processed_first; const size_t remaining = buf_size - processed_first; - VLOG(1) << "remaining = " << remaining; + SPDY_VLOG(1) << "remaining = " << remaining; size_t processed_second = deframer_.ProcessInput(rest, remaining);
diff --git a/spdy/core/spdy_header_block.cc b/spdy/core/spdy_header_block.cc index dcf84b9..c99bbf3 100644 --- a/spdy/core/spdy_header_block.cc +++ b/spdy/core/spdy_header_block.cc
@@ -9,9 +9,8 @@ #include <algorithm> #include <utility> -#include "base/logging.h" -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_unsafe_arena.h" @@ -204,14 +203,14 @@ const SpdyStringPiece value) { *spdy_header_block_value_size_ += value.size(); if (lookup_result_ == block_->end()) { - DVLOG(1) << "Inserting: (" << key_ << ", " << value << ")"; + SPDY_DVLOG(1) << "Inserting: (" << key_ << ", " << value << ")"; lookup_result_ = block_ ->emplace(std::make_pair( key_, HeaderValue(storage_, key_, storage_->Write(value)))) .first; } else { - DVLOG(1) << "Updating key: " << key_ << " with value: " << value; + SPDY_DVLOG(1) << "Updating key: " << key_ << " with value: " << value; *spdy_header_block_value_size_ -= lookup_result_->second.SizeEstimate(); lookup_result_->second = HeaderValue(storage_, key_, storage_->Write(value)); @@ -279,7 +278,7 @@ void SpdyHeaderBlock::erase(SpdyStringPiece key) { auto iter = block_.find(key); if (iter != block_.end()) { - DVLOG(1) << "Erasing header with name: " << key; + SPDY_DVLOG(1) << "Erasing header with name: " << key; key_size_ -= key.size(); value_size_ -= iter->second.SizeEstimate(); block_.erase(iter); @@ -299,11 +298,12 @@ auto iter = block_.find(value.first); if (iter == block_.end()) { - DVLOG(1) << "Inserting: (" << value.first << ", " << value.second << ")"; + SPDY_DVLOG(1) << "Inserting: (" << value.first << ", " << value.second + << ")"; AppendHeader(value.first, value.second); } else { - DVLOG(1) << "Updating key: " << iter->first - << " with value: " << value.second; + SPDY_DVLOG(1) << "Updating key: " << iter->first + << " with value: " << value.second; value_size_ -= iter->second.SizeEstimate(); auto* storage = GetStorage(); iter->second = @@ -313,16 +313,16 @@ SpdyHeaderBlock::ValueProxy SpdyHeaderBlock::operator[]( const SpdyStringPiece key) { - DVLOG(2) << "Operator[] saw key: " << key; + SPDY_DVLOG(2) << "Operator[] saw key: " << key; SpdyStringPiece out_key; auto iter = block_.find(key); if (iter == block_.end()) { // We write the key first, to assure that the ValueProxy has a // reference to a valid SpdyStringPiece in its operator=. out_key = WriteKey(key); - DVLOG(2) << "Key written as: " << std::hex - << static_cast<const void*>(key.data()) << ", " << std::dec - << key.size(); + SPDY_DVLOG(2) << "Key written as: " << std::hex + << static_cast<const void*>(key.data()) << ", " << std::dec + << key.size(); } else { out_key = iter->first; } @@ -335,12 +335,13 @@ auto iter = block_.find(key); if (iter == block_.end()) { - DVLOG(1) << "Inserting: (" << key << ", " << value << ")"; + SPDY_DVLOG(1) << "Inserting: (" << key << ", " << value << ")"; AppendHeader(key, value); return; } - DVLOG(1) << "Updating key: " << iter->first << "; appending value: " << value; + SPDY_DVLOG(1) << "Updating key: " << iter->first + << "; appending value: " << value; value_size_ += SeparatorForKey(key).size(); iter->second.Append(GetStorage()->Write(value)); }
diff --git a/spdy/core/spdy_header_block.h b/spdy/core/spdy_header_block.h index f453246..ac172af 100644 --- a/spdy/core/spdy_header_block.h +++ b/spdy/core/spdy_header_block.h
@@ -12,7 +12,6 @@ #include <utility> #include <vector> -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_macros.h"
diff --git a/spdy/core/spdy_prefixed_buffer_reader.cc b/spdy/core/spdy_prefixed_buffer_reader.cc index 9f1fa7f..484cefe 100644 --- a/spdy/core/spdy_prefixed_buffer_reader.cc +++ b/spdy/core/spdy_prefixed_buffer_reader.cc
@@ -6,7 +6,7 @@ #include <new> -#include "base/logging.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy {
diff --git a/spdy/core/spdy_protocol.cc b/spdy/core/spdy_protocol.cc index f51dc6e..e454e08 100644 --- a/spdy/core/spdy_protocol.cc +++ b/spdy/core/spdy_protocol.cc
@@ -417,7 +417,7 @@ size_t SpdyContinuationIR::size() const { // We don't need to get the size of CONTINUATION frame directly. It is // calculated in HEADERS or PUSH_PROMISE frame. - DLOG(WARNING) << "Shouldn't not call size() for CONTINUATION frame."; + SPDY_DLOG(WARNING) << "Shouldn't not call size() for CONTINUATION frame."; return 0; }
diff --git a/spdy/core/spdy_protocol.h b/spdy/core/spdy_protocol.h index d300d10..0454d73 100644 --- a/spdy/core/spdy_protocol.h +++ b/spdy/core/spdy_protocol.h
@@ -18,13 +18,12 @@ #include <new> #include <utility> -#include "base/logging.h" -#include "base/macros.h" #include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h" #include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h" #include "net/third_party/quiche/src/spdy/core/spdy_header_block.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
diff --git a/spdy/core/spdy_protocol_test_utils.cc b/spdy/core/spdy_protocol_test_utils.cc index 14d3385..5714aa9 100644 --- a/spdy/core/spdy_protocol_test_utils.cc +++ b/spdy/core/spdy_protocol_test_utils.cc
@@ -17,7 +17,7 @@ ::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals( const SpdyFrameWithHeaderBlockIR& expected, const SpdyFrameWithHeaderBlockIR& actual) { - VLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals"; + SPDY_VLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals"; VERIFY_TRUE(actual.header_block() == expected.header_block()); return ::testing::AssertionSuccess(); } @@ -40,7 +40,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyDataIR& expected, const SpdyDataIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_EQ(expected.fin(), actual.fin()); VERIFY_EQ(expected.data_len(), actual.data_len()); @@ -56,7 +56,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyGoAwayIR& expected, const SpdyGoAwayIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR"; VERIFY_EQ(expected.last_good_stream_id(), actual.last_good_stream_id()); VERIFY_EQ(expected.error_code(), actual.error_code()); VERIFY_EQ(expected.description(), actual.description()); @@ -66,7 +66,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdyHeadersIR& expected, const SpdyHeadersIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_EQ(expected.fin(), actual.fin()); VERIFY_SUCCESS(VerifySpdyFrameWithHeaderBlockIREquals(expected, actual)); @@ -80,7 +80,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyPingIR& expected, const SpdyPingIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR"; VERIFY_EQ(expected.id(), actual.id()); VERIFY_EQ(expected.is_ack(), actual.is_ack()); return ::testing::AssertionSuccess(); @@ -89,7 +89,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdyPriorityIR& expected, const SpdyPriorityIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_SUCCESS(VerifySpdyFrameWithPriorityIREquals(expected, actual)); return ::testing::AssertionSuccess(); @@ -98,7 +98,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdyPushPromiseIR& expected, const SpdyPushPromiseIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual)); VERIFY_EQ(expected.promised_stream_id(), actual.promised_stream_id()); @@ -109,7 +109,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdyRstStreamIR& expected, const SpdyRstStreamIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_EQ(expected.error_code(), actual.error_code()); return ::testing::AssertionSuccess(); @@ -118,7 +118,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdySettingsIR& expected, const SpdySettingsIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR"; // Note, ignoring non-HTTP/2 fields such as clear_settings. VERIFY_EQ(expected.is_ack(), actual.is_ack()); @@ -145,7 +145,7 @@ ::testing::AssertionResult VerifySpdyFrameIREquals( const SpdyWindowUpdateIR& expected, const SpdyWindowUpdateIR& actual) { - VLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR"; VERIFY_EQ(expected.stream_id(), actual.stream_id()); VERIFY_EQ(expected.delta(), actual.delta()); return ::testing::AssertionSuccess();
diff --git a/spdy/core/spdy_protocol_test_utils.h b/spdy/core/spdy_protocol_test_utils.h index bbec597..ce2c9d5 100644 --- a/spdy/core/spdy_protocol_test_utils.h +++ b/spdy/core/spdy_protocol_test_utils.h
@@ -19,11 +19,11 @@ #include <typeinfo> -#include "base/logging.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" #include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy { namespace test { @@ -38,7 +38,7 @@ template <class T> ::testing::AssertionResult VerifySpdyFrameWithPaddingIREquals(const T& expected, const T& actual) { - VLOG(1) << "VerifySpdyFrameWithPaddingIREquals"; + SPDY_VLOG(1) << "VerifySpdyFrameWithPaddingIREquals"; VERIFY_EQ(expected.padded(), actual.padded()); if (expected.padded()) { VERIFY_EQ(expected.padding_payload_len(), actual.padding_payload_len()); @@ -52,7 +52,7 @@ ::testing::AssertionResult VerifySpdyFrameWithPriorityIREquals( const T& expected, const T& actual) { - VLOG(1) << "VerifySpdyFrameWithPriorityIREquals"; + SPDY_VLOG(1) << "VerifySpdyFrameWithPriorityIREquals"; VERIFY_EQ(expected.parent_stream_id(), actual.parent_stream_id()); VERIFY_EQ(expected.weight(), actual.weight()); VERIFY_EQ(expected.exclusive(), actual.exclusive()); @@ -123,12 +123,12 @@ ::testing::AssertionResult VerifySpdyFrameIREquals(const E* expected, const SpdyFrameIR* actual) { if (expected == nullptr || actual == nullptr) { - VLOG(1) << "VerifySpdyFrameIREquals one null"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals one null"; VERIFY_EQ(expected, nullptr); VERIFY_EQ(actual, nullptr); return ::testing::AssertionSuccess(); } - VLOG(1) << "VerifySpdyFrameIREquals not null"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals not null"; VERIFY_EQ(actual->frame_type(), expected->frame_type()); const E* actual2 = static_cast<const E*>(actual); return VerifySpdyFrameIREquals(*expected, *actual2); @@ -139,7 +139,7 @@ template <class E> ::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected, const SpdyFrameIR* actual) { - VLOG(1) << "VerifySpdyFrameIREquals"; + SPDY_VLOG(1) << "VerifySpdyFrameIREquals"; return VerifySpdyFrameIREquals(&expected, actual); }
diff --git a/spdy/core/spdy_test_utils.cc b/spdy/core/spdy_test_utils.cc index dd6c417..622a5a6 100644 --- a/spdy/core/spdy_test_utils.cc +++ b/spdy/core/spdy_test_utils.cc
@@ -11,9 +11,9 @@ #include <utility> #include <vector> -#include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" #include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h" +#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h" namespace spdy { namespace test { @@ -27,7 +27,7 @@ const int kSizeLimit = 1024; if (length > kSizeLimit || mark_length > kSizeLimit) { - LOG(ERROR) << "Only dumping first " << kSizeLimit << " bytes."; + SPDY_LOG(ERROR) << "Only dumping first " << kSizeLimit << " bytes."; length = std::min(length, kSizeLimit); mark_length = std::min(mark_length, kSizeLimit); }
diff --git a/spdy/platform/api/spdy_logging.h b/spdy/platform/api/spdy_logging.h new file mode 100644 index 0000000..657c5b1 --- /dev/null +++ b/spdy/platform/api/spdy_logging.h
@@ -0,0 +1,23 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef QUICHE_SPDY_PLATFORM_API_SPDY_LOGGING_H_ +#define QUICHE_SPDY_PLATFORM_API_SPDY_LOGGING_H_ + +#include "net/spdy/platform/impl/spdy_logging_impl.h" + +#define SPDY_LOG(severity) SPDY_LOG_IMPL(severity) + +#define SPDY_VLOG(verbose_level) SPDY_VLOG_IMPL(verbose_level) + +#define SPDY_DLOG(severity) SPDY_DLOG_IMPL(severity) + +#define SPDY_DLOG_IF(severity, condition) SPDY_DLOG_IF_IMPL(severity, condition) + +#define SPDY_DVLOG(verbose_level) SPDY_DVLOG_IMPL(verbose_level) + +#define SPDY_DVLOG_IF(verbose_level, condition) \ + SPDY_DVLOG_IF_IMPL(verbose_level, condition) + +#endif // QUICHE_SPDY_PLATFORM_API_SPDY_LOGGING_H_
diff --git a/spdy/platform/api/spdy_macros.h b/spdy/platform/api/spdy_macros.h index a75c957..58ea4d3 100644 --- a/spdy/platform/api/spdy_macros.h +++ b/spdy/platform/api/spdy_macros.h
@@ -10,6 +10,4 @@ #define SPDY_MUST_USE_RESULT SPDY_MUST_USE_RESULT_IMPL #define SPDY_UNUSED SPDY_UNUSED_IMPL -#define SPDY_DVLOG_IF SPDY_DVLOG_IF_IMPL - #endif // QUICHE_SPDY_PLATFORM_API_SPDY_MACROS_H_