Replaces all uses of SPDY_BUG and SPDY_BUG_IF with the QUICHE equivalents.

PiperOrigin-RevId: 367467471
Change-Id: I3157d1cb22d5ee592859085667570b2cee38a480
diff --git a/http2/adapter/oghttp2_adapter.cc b/http2/adapter/oghttp2_adapter.cc
index 7b7d2a2..747d425 100644
--- a/http2/adapter/oghttp2_adapter.cc
+++ b/http2/adapter/oghttp2_adapter.cc
@@ -6,6 +6,7 @@
 #include "absl/strings/str_cat.h"
 #include "http2/adapter/http2_util.h"
 #include "http2/adapter/window_manager.h"
+#include "common/platform/api/quiche_bug_tracker.h"
 #include "spdy/core/spdy_framer.h"
 #include "spdy/core/spdy_protocol.h"
 
@@ -33,15 +34,15 @@
   ~OgHttp2Session() override {}
 
   ssize_t ProcessBytes(absl::string_view bytes) override {
-    SPDY_BUG(oghttp2_process_bytes) << "Not implemented";
+    QUICHE_BUG(oghttp2_process_bytes) << "Not implemented";
     return 0;
   }
 
   int Consume(Http2StreamId stream_id, size_t num_bytes) override {
     auto it = stream_map_.find(stream_id);
     if (it == stream_map_.end()) {
-      // TODO(b/181586191): LOG_ERROR rather than SPDY_BUG.
-      SPDY_BUG(stream_consume_notfound)
+      // TODO(b/181586191): LOG_ERROR rather than QUICHE_BUG.
+      QUICHE_BUG(stream_consume_notfound)
           << "Stream " << stream_id << " not found";
     } else {
       it->second.window_manager.MarkDataFlushed(num_bytes);
@@ -54,7 +55,7 @@
     return !frames_.empty() || !serialized_prefix_.empty();
   }
   int GetRemoteWindowSize() const override {
-    SPDY_BUG(peer_window_not_updated) << "Not implemented";
+    QUICHE_BUG(peer_window_not_updated) << "Not implemented";
     return peer_window_;
   }
 
@@ -135,7 +136,7 @@
 }
 
 void OgHttp2Adapter::SubmitMetadata(Http2StreamId stream_id, bool fin) {
-  SPDY_BUG(oghttp2_submit_metadata) << "Not implemented";
+  QUICHE_BUG(oghttp2_submit_metadata) << "Not implemented";
 }
 
 std::string OgHttp2Adapter::GetBytesToWrite(absl::optional<size_t> max_bytes) {
diff --git a/http2/adapter/window_manager.cc b/http2/adapter/window_manager.cc
index a1b92d5..eef3714 100644
--- a/http2/adapter/window_manager.cc
+++ b/http2/adapter/window_manager.cc
@@ -2,8 +2,8 @@
 
 #include <utility>
 
+#include "common/platform/api/quiche_bug_tracker.h"
 #include "common/platform/api/quiche_logging.h"
-#include "spdy/platform/api/spdy_bug_tracker.h"
 
 namespace http2 {
 namespace adapter {
@@ -20,7 +20,7 @@
   if (new_limit > limit_) {
     window_ += (new_limit - limit_);
   } else {
-    SPDY_BUG(H2 window decrease)
+    QUICHE_BUG(H2 window decrease)
         << "Window size limit decrease not currently supported.";
   }
   limit_ = new_limit;
@@ -56,8 +56,8 @@
   QUICHE_VLOG(2) << "WindowManager@" << this << " buffered: " << buffered_
                  << " bytes: " << bytes;
   if (buffered_ < bytes) {
-    SPDY_BUG(bug_2816_1) << "WindowManager@" << this << " buffered underflow "
-                         << "buffered_: " << buffered_ << " bytes: " << bytes;
+    QUICHE_BUG(bug_2816_1) << "WindowManager@" << this << " buffered underflow "
+                           << "buffered_: " << buffered_ << " bytes: " << bytes;
     buffered_ = 0;
   } else {
     buffered_ -= bytes;
diff --git a/http2/core/http2_priority_write_scheduler.h b/http2/core/http2_priority_write_scheduler.h
index 33f5097..27e84ad 100644
--- a/http2/core/http2_priority_write_scheduler.h
+++ b/http2/core/http2_priority_write_scheduler.h
@@ -19,9 +19,9 @@
 
 #include "absl/strings/str_cat.h"
 #include "http2/core/write_scheduler.h"
+#include "common/platform/api/quiche_bug_tracker.h"
 #include "spdy/core/spdy_intrusive_list.h"
 #include "spdy/core/spdy_protocol.h"
-#include "spdy/platform/api/spdy_bug_tracker.h"
 #include "spdy/platform/api/spdy_containers.h"
 #include "spdy/platform/api/spdy_logging.h"
 #include "spdy/platform/api/spdy_string_utils.h"
@@ -218,15 +218,15 @@
 void Http2PriorityWriteScheduler<StreamIdType>::RegisterStream(
     StreamIdType stream_id,
     const StreamPrecedenceType& precedence) {
-  // TODO(mpw): uncomment the SPDY_BUG_IF below once all tests
+  // TODO(mpw): uncomment the QUICHE_BUG_IF below once all tests
   //   (e.g. SpdyClientDispatcher) modified to pass StreamPrecedence instances
   //   appropriate for protocol version under test.
   //
-  // SPDY_BUG_IF(spdy_bug_8_1, precedence.is_spdy3_priority())
+  // QUICHE_BUG_IF(spdy_bug_8_1, precedence.is_spdy3_priority())
   //     << "Expected HTTP/2 stream dependency";
 
   if (StreamRegistered(stream_id)) {
-    SPDY_BUG(spdy_bug_8_2) << "Stream " << stream_id << " already registered";
+    QUICHE_BUG(spdy_bug_8_2) << "Stream " << stream_id << " already registered";
     return;
   }
 
@@ -273,13 +273,13 @@
 void Http2PriorityWriteScheduler<StreamIdType>::UnregisterStream(
     StreamIdType stream_id) {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_3) << "Cannot unregister root stream";
+    QUICHE_BUG(spdy_bug_8_3) << "Cannot unregister root stream";
     return;
   }
   // Remove the stream from table.
   auto it = all_stream_infos_.find(stream_id);
   if (it == all_stream_infos_.end()) {
-    SPDY_BUG(spdy_bug_8_4) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_4) << "Stream " << stream_id << " not registered";
     return;
   }
   std::unique_ptr<StreamInfo> stream_info(std::move(it->second));
@@ -336,7 +336,7 @@
   std::vector<StreamIdType> child_vec;
   const StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_5) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_5) << "Stream " << stream_id << " not registered";
   } else {
     child_vec.reserve(stream_info->children.size());
     for (StreamInfo* child : stream_info->children) {
@@ -350,14 +350,14 @@
 void Http2PriorityWriteScheduler<StreamIdType>::UpdateStreamPrecedence(
     StreamIdType stream_id,
     const StreamPrecedenceType& precedence) {
-  // TODO(mpw): uncomment the SPDY_BUG_IF below once all tests
+  // TODO(mpw): uncomment the QUICHE_BUG_IF below once all tests
   //   (e.g. SpdyClientDispatcher) modified to pass StreamPrecedence instances
   //   appropriate for protocol version under test.
   //
-  // SPDY_BUG_IF(spdy_bug_8_6, precedence.is_spdy3_priority())
+  // QUICHE_BUG_IF(spdy_bug_8_6, precedence.is_spdy3_priority())
   //     << "Expected HTTP/2 stream dependency";
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_7) << "Cannot set precedence of root stream";
+    QUICHE_BUG(spdy_bug_8_7) << "Cannot set precedence of root stream";
     return;
   }
 
@@ -394,7 +394,7 @@
     StreamIdType parent_id,
     bool exclusive) {
   if (stream_info->id == parent_id) {
-    SPDY_BUG(spdy_bug_8_8) << "Cannot set stream to be its own parent";
+    QUICHE_BUG(spdy_bug_8_8) << "Cannot set stream to be its own parent";
     return;
   }
   StreamInfo* new_parent = FindStream(parent_id);
@@ -458,12 +458,12 @@
     StreamIdType stream_id,
     int64_t now_in_usec) {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_9) << "Cannot record event time for root stream";
+    QUICHE_BUG(spdy_bug_8_9) << "Cannot record event time for root stream";
     return;
   }
   StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_10) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_10) << "Stream " << stream_id << " not registered";
     return;
   }
   stream_info->last_event_time_usec = now_in_usec;
@@ -478,12 +478,12 @@
 int64_t Http2PriorityWriteScheduler<StreamIdType>::GetLatestEventWithPrecedence(
     StreamIdType stream_id) const {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_11) << "Invalid argument: root stream";
+    QUICHE_BUG(spdy_bug_8_11) << "Invalid argument: root stream";
     return 0;
   }
   const StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_12) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_12) << "Stream " << stream_id << " not registered";
     return 0;
   }
   int64_t last_event_time_usec = 0;
@@ -504,12 +504,12 @@
 bool Http2PriorityWriteScheduler<StreamIdType>::ShouldYield(
     StreamIdType stream_id) const {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_13) << "Invalid argument: root stream";
+    QUICHE_BUG(spdy_bug_8_13) << "Invalid argument: root stream";
     return false;
   }
   const StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_14) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_14) << "Stream " << stream_id << " not registered";
     return false;
   }
   if (HasReadyAncestor(*stream_info)) {
@@ -535,12 +535,12 @@
     StreamIdType stream_id,
     bool add_to_front) {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_15) << "Cannot mark root stream ready";
+    QUICHE_BUG(spdy_bug_8_15) << "Cannot mark root stream ready";
     return;
   }
   StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_16) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_16) << "Stream " << stream_id << " not registered";
     return;
   }
   if (stream_info->ready) {
@@ -554,12 +554,12 @@
 void Http2PriorityWriteScheduler<StreamIdType>::MarkStreamNotReady(
     StreamIdType stream_id) {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_17) << "Cannot mark root stream unready";
+    QUICHE_BUG(spdy_bug_8_17) << "Cannot mark root stream unready";
     return;
   }
   StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_18) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_18) << "Stream " << stream_id << " not registered";
     return;
   }
   if (!stream_info->ready) {
@@ -681,7 +681,7 @@
       return std::make_tuple(stream_info.id, stream_info.ToStreamPrecedence());
     }
   }
-  SPDY_BUG(spdy_bug_8_19) << "No ready streams";
+  QUICHE_BUG(spdy_bug_8_19) << "No ready streams";
   return std::make_tuple(
       spdy::kHttp2RootStreamId,
       StreamPrecedenceType(spdy::kHttp2RootStreamId,
@@ -697,12 +697,12 @@
 bool Http2PriorityWriteScheduler<StreamIdType>::IsStreamReady(
     StreamIdType stream_id) const {
   if (stream_id == spdy::kHttp2RootStreamId) {
-    SPDY_BUG(spdy_bug_8_20) << "Try to check whether root stream is ready";
+    QUICHE_BUG(spdy_bug_8_20) << "Try to check whether root stream is ready";
     return false;
   }
   const StreamInfo* stream_info = FindStream(stream_id);
   if (stream_info == nullptr) {
-    SPDY_BUG(spdy_bug_8_21) << "Stream " << stream_id << " not registered";
+    QUICHE_BUG(spdy_bug_8_21) << "Stream " << stream_id << " not registered";
     return false;
   }
   return stream_info->ready;
diff --git a/http2/core/priority_write_scheduler.h b/http2/core/priority_write_scheduler.h
index a16eed5..1014050 100644
--- a/http2/core/priority_write_scheduler.h
+++ b/http2/core/priority_write_scheduler.h
@@ -17,8 +17,8 @@
 
 #include "absl/strings/str_cat.h"
 #include "http2/core/write_scheduler.h"
+#include "common/platform/api/quiche_bug_tracker.h"
 #include "spdy/core/spdy_protocol.h"
-#include "spdy/platform/api/spdy_bug_tracker.h"
 #include "spdy/platform/api/spdy_logging.h"
 
 namespace http2 {
@@ -61,21 +61,21 @@
         << "Parent stream " << parent_id << " not registered";
 
     if (stream_id == root_stream_id_) {
-      SPDY_BUG(spdy_bug_19_1)
+      QUICHE_BUG(spdy_bug_19_1)
           << "Stream " << root_stream_id_ << " already registered";
       return;
     }
     StreamInfo stream_info = {precedence.spdy3_priority(), stream_id, false};
     bool inserted =
         stream_infos_.insert(std::make_pair(stream_id, stream_info)).second;
-    SPDY_BUG_IF(spdy_bug_19_2, !inserted)
+    QUICHE_BUG_IF(spdy_bug_19_2, !inserted)
         << "Stream " << stream_id << " already registered";
   }
 
   void UnregisterStream(StreamIdType stream_id) override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_3) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_3) << "Stream " << stream_id << " not registered";
       return;
     }
     StreamInfo& stream_info = it->second;
@@ -143,7 +143,7 @@
                              int64_t now_in_usec) override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_4) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_4) << "Stream " << stream_id << " not registered";
       return;
     }
     PriorityInfo& priority_info = priority_infos_[it->second.priority];
@@ -154,7 +154,7 @@
   int64_t GetLatestEventWithPrecedence(StreamIdType stream_id) const override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_5) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_5) << "Stream " << stream_id << " not registered";
       return 0;
     }
     int64_t last_event_time_usec = 0;
@@ -189,14 +189,14 @@
                                StreamPrecedenceType(info->priority));
       }
     }
-    SPDY_BUG(spdy_bug_19_6) << "No ready streams available";
+    QUICHE_BUG(spdy_bug_19_6) << "No ready streams available";
     return std::make_tuple(0, StreamPrecedenceType(spdy::kV3LowestPriority));
   }
 
   bool ShouldYield(StreamIdType stream_id) const override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_7) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_7) << "Stream " << stream_id << " not registered";
       return false;
     }
 
@@ -224,7 +224,7 @@
   void MarkStreamReady(StreamIdType stream_id, bool add_to_front) override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_8) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_8) << "Stream " << stream_id << " not registered";
       return;
     }
     StreamInfo& stream_info = it->second;
@@ -244,7 +244,7 @@
   void MarkStreamNotReady(StreamIdType stream_id) override {
     auto it = stream_infos_.find(stream_id);
     if (it == stream_infos_.end()) {
-      SPDY_BUG(spdy_bug_19_9) << "Stream " << stream_id << " not registered";
+      QUICHE_BUG(spdy_bug_19_9) << "Stream " << stream_id << " not registered";
       return;
     }
     StreamInfo& stream_info = it->second;