Remove http2_bug_tracker.h. Replace HTTP2_BUG* macros with QUICHE_BUG*. PiperOrigin-RevId: 445207074
diff --git a/quiche/http2/decoder/decode_status.cc b/quiche/http2/decoder/decode_status.cc index 2adf9b5..ddb8c3b 100644 --- a/quiche/http2/decoder/decode_status.cc +++ b/quiche/http2/decoder/decode_status.cc
@@ -4,8 +4,8 @@ #include "quiche/http2/decoder/decode_status.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -21,7 +21,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_147_1) << "Unknown DecodeStatus " << unknown; + QUICHE_BUG(http2_bug_147_1) << "Unknown DecodeStatus " << unknown; return out << "DecodeStatus(" << unknown << ")"; }
diff --git a/quiche/http2/decoder/http2_frame_decoder.cc b/quiche/http2/decoder/http2_frame_decoder.cc index aac3ef8..e9dce51 100644 --- a/quiche/http2/decoder/http2_frame_decoder.cc +++ b/quiche/http2/decoder/http2_frame_decoder.cc
@@ -7,9 +7,9 @@ #include "quiche/http2/decoder/decode_status.h" #include "quiche/http2/hpack/varint/hpack_varint_decoder.h" #include "quiche/http2/http2_constants.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_flag_utils.h" #include "quiche/http2/platform/api/http2_flags.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" #include "quiche/common/platform/api/quiche_logging.h" namespace http2 { @@ -28,7 +28,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_155_1) << "Http2FrameDecoder::State " << unknown; + QUICHE_BUG(http2_bug_155_1) << "Http2FrameDecoder::State " << unknown; return out << "Http2FrameDecoder::State(" << unknown << ")"; }
diff --git a/quiche/http2/decoder/http2_structure_decoder.cc b/quiche/http2/decoder/http2_structure_decoder.cc index b8d0a9e..5065256 100644 --- a/quiche/http2/decoder/http2_structure_decoder.cc +++ b/quiche/http2/decoder/http2_structure_decoder.cc
@@ -7,7 +7,7 @@ #include <algorithm> #include <cstring> -#include "quiche/http2/platform/api/http2_bug_tracker.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -16,12 +16,12 @@ // against bugs in the decoder, only against malicious encoders, but since // we're copying memory into a buffer here, let's make sure we don't allow a // small mistake to grow larger. The decoder will get stuck if we hit the -// HTTP2_BUG conditions, but shouldn't corrupt memory. +// QUICHE_BUG conditions, but shouldn't corrupt memory. uint32_t Http2StructureDecoder::IncompleteStart(DecodeBuffer* db, uint32_t target_size) { if (target_size > sizeof buffer_) { - HTTP2_BUG(http2_bug_154_1) + QUICHE_BUG(http2_bug_154_1) << "target_size too large for buffer: " << target_size; return 0; } @@ -54,7 +54,7 @@ << ": target_size=" << target_size << "; offset_=" << offset_ << "; db->Remaining=" << db->Remaining(); if (target_size < offset_) { - HTTP2_BUG(http2_bug_154_2) + QUICHE_BUG(http2_bug_154_2) << "Already filled buffer_! target_size=" << target_size << " offset_=" << offset_; return false; @@ -76,7 +76,7 @@ << "; *remaining_payload=" << *remaining_payload << "; db->Remaining=" << db->Remaining(); if (target_size < offset_) { - HTTP2_BUG(http2_bug_154_3) + QUICHE_BUG(http2_bug_154_3) << "Already filled buffer_! target_size=" << target_size << " offset_=" << offset_; return false;
diff --git a/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder.cc index e2efeea..f48277e 100644 --- a/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/altsvc_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -31,7 +31,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_163_1) + QUICHE_BUG(http2_bug_163_1) << "Invalid AltSvcPayloadDecoder::PayloadState: " << unknown; return out << "AltSvcPayloadDecoder::PayloadState(" << unknown << ")"; } @@ -103,7 +103,7 @@ payload_state_ = PayloadState::kMaybeDecodedStruct; continue; } - HTTP2_BUG(http2_bug_163_2) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_163_2) << "PayloadState: " << payload_state_; } }
diff --git a/quiche/http2/decoder/payload_decoders/data_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/data_payload_decoder.cc index 8f4dcdd..6561a48 100644 --- a/quiche/http2/decoder/payload_decoders/data_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/data_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -29,7 +29,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_174_1) + QUICHE_BUG(http2_bug_174_1) << "Invalid DataPayloadDecoder::PayloadState: " << unknown; return out << "DataPayloadDecoder::PayloadState(" << unknown << ")"; } @@ -121,7 +121,7 @@ payload_state_ = PayloadState::kSkipPadding; return DecodeStatus::kDecodeInProgress; } - HTTP2_BUG(http2_bug_174_2) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_174_2) << "PayloadState: " << payload_state_; return DecodeStatus::kDecodeError; }
diff --git a/quiche/http2/decoder/payload_decoders/goaway_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/goaway_payload_decoder.cc index a5627fa..f69de71 100644 --- a/quiche/http2/decoder/payload_decoders/goaway_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/goaway_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -31,7 +31,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_167_1) + QUICHE_BUG(http2_bug_167_1) << "Invalid GoAwayPayloadDecoder::PayloadState: " << unknown; return out << "GoAwayPayloadDecoder::PayloadState(" << unknown << ")"; } @@ -113,7 +113,7 @@ payload_state_ = PayloadState::kHandleFixedFieldsStatus; continue; } - HTTP2_BUG(http2_bug_167_2) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_167_2) << "PayloadState: " << payload_state_; } }
diff --git a/quiche/http2/decoder/payload_decoders/headers_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/headers_payload_decoder.cc index 5996d88..933eae8 100644 --- a/quiche/http2/decoder/payload_decoders/headers_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/headers_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -33,7 +33,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_189_1) + QUICHE_BUG(http2_bug_189_1) << "Invalid HeadersPayloadDecoder::PayloadState: " << unknown; return out << "HeadersPayloadDecoder::PayloadState(" << unknown << ")"; } @@ -169,7 +169,7 @@ payload_state_ = PayloadState::kReadPayload; continue; } - HTTP2_BUG(http2_bug_189_2) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_189_2) << "PayloadState: " << payload_state_; } }
diff --git a/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder.cc index 5e11afa..a776826 100644 --- a/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/priority_update_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -31,7 +31,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_173_1) + QUICHE_BUG(http2_bug_173_1) << "Invalid PriorityUpdatePayloadDecoder::PayloadState: " << unknown; return out << "PriorityUpdatePayloadDecoder::PayloadState(" << unknown << ")"; } @@ -116,7 +116,7 @@ payload_state_ = PayloadState::kHandleFixedFieldsStatus; continue; } - HTTP2_BUG(http2_bug_173_2) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_173_2) << "PayloadState: " << payload_state_; } }
diff --git a/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder.cc b/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder.cc index b80454b..7ba81b0 100644 --- a/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder.cc +++ b/quiche/http2/decoder/payload_decoders/push_promise_payload_decoder.cc
@@ -11,8 +11,8 @@ #include "quiche/http2/decoder/http2_frame_decoder_listener.h" #include "quiche/http2/http2_constants.h" #include "quiche/http2/http2_structures.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -153,7 +153,7 @@ payload_state_ = PayloadState::kResumeDecodingPushPromiseFields; return status; } - HTTP2_BUG(http2_bug_183_1) << "PayloadState: " << payload_state_; + QUICHE_BUG(http2_bug_183_1) << "PayloadState: " << payload_state_; } }
diff --git a/quiche/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/quiche/http2/hpack/decoder/hpack_decoder_string_buffer.cc index e928686..f1b5045 100644 --- a/quiche/http2/hpack/decoder/hpack_decoder_string_buffer.cc +++ b/quiche/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -6,8 +6,8 @@ #include <utility> -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -24,7 +24,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. int unknown = static_cast<int>(v); - HTTP2_BUG(http2_bug_50_1) + QUICHE_BUG(http2_bug_50_1) << "Invalid HpackDecoderStringBuffer::State: " << unknown; return out << "HpackDecoderStringBuffer::State(" << unknown << ")"; } @@ -44,7 +44,7 @@ // Since the value doesn't come over the wire, only a programming bug should // result in reaching this point. auto v2 = static_cast<int>(v); - HTTP2_BUG(http2_bug_50_2) + QUICHE_BUG(http2_bug_50_2) << "Invalid HpackDecoderStringBuffer::Backing: " << v2; return out << "HpackDecoderStringBuffer::Backing(" << v2 << ")"; }
diff --git a/quiche/http2/hpack/decoder/hpack_entry_decoder.cc b/quiche/http2/hpack/decoder/hpack_entry_decoder.cc index c81e298..1cb49c8 100644 --- a/quiche/http2/hpack/decoder/hpack_entry_decoder.cc +++ b/quiche/http2/hpack/decoder/hpack_entry_decoder.cc
@@ -9,10 +9,10 @@ #include <cstdint> #include "absl/base/macros.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_flag_utils.h" #include "quiche/http2/platform/api/http2_flags.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { namespace { @@ -86,7 +86,7 @@ return status; } - HTTP2_BUG(http2_bug_63_1) << "Unreachable"; + QUICHE_BUG(http2_bug_63_1) << "Unreachable"; return DecodeStatus::kDecodeError; } @@ -252,7 +252,7 @@ return true; } - HTTP2_BUG(http2_bug_63_2) << "Unreachable, entry_type=" << entry_type; + QUICHE_BUG(http2_bug_63_2) << "Unreachable, entry_type=" << entry_type; return true; }
diff --git a/quiche/http2/hpack/decoder/hpack_entry_type_decoder.cc b/quiche/http2/hpack/decoder/hpack_entry_type_decoder.cc index 2bf6d8d..c1ff3ee 100644 --- a/quiche/http2/hpack/decoder/hpack_entry_type_decoder.cc +++ b/quiche/http2/hpack/decoder/hpack_entry_type_decoder.cc
@@ -5,10 +5,10 @@ #include "quiche/http2/hpack/decoder/hpack_entry_type_decoder.h" #include "absl/strings/str_cat.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_flag_utils.h" #include "quiche/http2/platform/api/http2_flags.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { @@ -353,7 +353,7 @@ // All of those bits are 1, so the varint extends into another byte. return varint_decoder_.StartExtended(7, db); } - HTTP2_BUG(http2_bug_66_1) + QUICHE_BUG(http2_bug_66_1) << "Unreachable, byte=" << std::hex << static_cast<uint32_t>(byte); HTTP2_CODE_COUNT_N(decompress_failure_3, 17, 23); return DecodeStatus::kDecodeError;
diff --git a/quiche/http2/hpack/tools/hpack_block_builder.cc b/quiche/http2/hpack/tools/hpack_block_builder.cc index d958b7c..b4eddb7 100644 --- a/quiche/http2/hpack/tools/hpack_block_builder.cc +++ b/quiche/http2/hpack/tools/hpack_block_builder.cc
@@ -5,7 +5,7 @@ #include "quiche/http2/hpack/tools/hpack_block_builder.h" #include "quiche/http2/hpack/varint/hpack_varint_encoder.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" #include "quiche/common/platform/api/quiche_test.h" namespace http2 { @@ -46,7 +46,7 @@ prefix_length = 4; break; default: - HTTP2_BUG(http2_bug_110_1) << "Unreached, entry_type=" << entry_type; + QUICHE_BUG(http2_bug_110_1) << "Unreached, entry_type=" << entry_type; high_bits = 0; prefix_length = 0; break;
diff --git a/quiche/http2/hpack/tools/hpack_example.cc b/quiche/http2/hpack/tools/hpack_example.cc index c6e6d2d..b44bddd 100644 --- a/quiche/http2/hpack/tools/hpack_example.cc +++ b/quiche/http2/hpack/tools/hpack_example.cc
@@ -8,8 +8,8 @@ #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" -#include "quiche/http2/platform/api/http2_bug_tracker.h" #include "quiche/http2/platform/api/http2_logging.h" +#include "quiche/common/platform/api/quiche_bug_tracker.h" namespace http2 { namespace test { @@ -40,7 +40,7 @@ example.remove_prefix(pos + 1); continue; } - HTTP2_BUG(http2_bug_107_1) + QUICHE_BUG(http2_bug_107_1) << "Can't parse byte " << static_cast<int>(c0) << absl::StrCat(" (0x", absl::Hex(c0), ")") << "\nExample: " << example; }
diff --git a/quiche/http2/platform/api/http2_bug_tracker.h b/quiche/http2/platform/api/http2_bug_tracker.h deleted file mode 100644 index b76b754..0000000 --- a/quiche/http2/platform/api/http2_bug_tracker.h +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2016 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_HTTP2_PLATFORM_API_HTTP2_BUG_TRACKER_H_ -#define QUICHE_HTTP2_PLATFORM_API_HTTP2_BUG_TRACKER_H_ - -#include "quiche/common/platform/api/quiche_bug_tracker.h" - -#define HTTP2_BUG QUICHE_BUG -#define HTTP2_BUG_IF QUICHE_BUG_IF - -// V2 macros are the same as all the HTTP2_BUG flavor above, but they take a -// bug_id parameter. -#define HTTP2_BUG_V2 QUICHE_BUG -#define HTTP2_BUG_IF_V2 QUICHE_BUG_IF - -#define FLAGS_http2_always_log_bugs_for_tests \ - FLAGS_http2_always_log_bugs_for_tests_IMPL - -#endif // QUICHE_HTTP2_PLATFORM_API_HTTP2_BUG_TRACKER_H_