Migration from GFE_BUG_V2 (and friends) to GFE_BUG

Per go/gfe-bug-improvements GFE_BUGs are getting stable IDs to allow for monitoring and alerting. To achieve that, a temporary set of V2 macros was added and the codebase was migrated to using the V2 macros. Now that migration is complete, the old-style (sans _V2) macros were changed to also take bug_id parameter, which makes the V2 set obsolete. To complete the transition, the codebase is being migrated back to GFE_BUG macros. Once done, V2 macros will be removed.

PiperOrigin-RevId: 363320613
Change-Id: Ia8fffb0af2f4a276799adaf8f1408f0cfe7a6ecd
diff --git a/quic/core/http/http_decoder.cc b/quic/core/http/http_decoder.cc
index 86a8a49..5377f7c 100644
--- a/quic/core/http/http_decoder.cc
+++ b/quic/core/http/http_decoder.cc
@@ -111,7 +111,7 @@
       case STATE_ERROR:
         break;
       default:
-        QUIC_BUG_V2(quic_bug_10411_1) << "Invalid state: " << state_;
+        QUIC_BUG(quic_bug_10411_1) << "Invalid state: " << state_;
     }
   }
 
diff --git a/quic/core/http/http_encoder.cc b/quic/core/http/http_encoder.cc
index 79cb555..804a2bf 100644
--- a/quic/core/http/http_encoder.cc
+++ b/quic/core/http/http_encoder.cc
@@ -205,7 +205,7 @@
     const PriorityUpdateFrame& priority_update,
     std::unique_ptr<char[]>* output) {
   if (priority_update.prioritized_element_type != REQUEST_STREAM) {
-    QUIC_BUG_V2(quic_bug_10402_1)
+    QUIC_BUG(quic_bug_10402_1)
         << "PRIORITY_UPDATE for push streams not implemented";
     return 0;
   }
diff --git a/quic/core/http/quic_client_promised_info.cc b/quic/core/http/quic_client_promised_info.cc
index dfc5a30..3601180 100644
--- a/quic/core/http/quic_client_promised_info.cc
+++ b/quic/core/http/quic_client_promised_info.cc
@@ -98,7 +98,7 @@
     // This shouldn't be possible, as |ClientRequest| guards against
     // closed stream for the synchronous case.  And in the
     // asynchronous case, a RST can only be caught by |OnAlarm()|.
-    QUIC_BUG_V2(quic_bug_10378_1) << "missing promised stream" << id_;
+    QUIC_BUG(quic_bug_10378_1) << "missing promised stream" << id_;
   }
   QuicClientPushPromiseIndex::Delegate* delegate = client_request_delegate_;
   session_->DeletePromised(this);
diff --git a/quic/core/http/quic_header_list.cc b/quic/core/http/quic_header_list.cc
index 6f655dd..7ac768d 100644
--- a/quic/core/http/quic_header_list.cc
+++ b/quic/core/http/quic_header_list.cc
@@ -32,7 +32,7 @@
 QuicHeaderList::~QuicHeaderList() {}
 
 void QuicHeaderList::OnHeaderBlockStart() {
-  QUIC_BUG_IF_V2(quic_bug_12518_1, current_header_list_size_ != 0)
+  QUIC_BUG_IF(quic_bug_12518_1, current_header_list_size_ != 0)
       << "OnHeaderBlockStart called more than once!";
 }
 
diff --git a/quic/core/http/quic_headers_stream.cc b/quic/core/http/quic_headers_stream.cc
index 05b8a30..2b9f485 100644
--- a/quic/core/http/quic_headers_stream.cc
+++ b/quic/core/http/quic_headers_stream.cc
@@ -84,7 +84,7 @@
           std::min(acked_length, header.full_length - header_offset);
 
       if (header.unacked_length < header_length) {
-        QUIC_BUG_V2(quic_bug_10416_1)
+        QUIC_BUG(quic_bug_10416_1)
             << "Unsent stream data is acked. unacked_length: "
             << header.unacked_length << " acked_length: " << header_length;
         OnUnrecoverableError(QUIC_INTERNAL_ERROR,
diff --git a/quic/core/http/quic_send_control_stream.cc b/quic/core/http/quic_send_control_stream.cc
index 70bb6d4..3334e52 100644
--- a/quic/core/http/quic_send_control_stream.cc
+++ b/quic/core/http/quic_send_control_stream.cc
@@ -27,7 +27,7 @@
       spdy_session_(spdy_session) {}
 
 void QuicSendControlStream::OnStreamReset(const QuicRstStreamFrame& /*frame*/) {
-  QUIC_BUG_V2(quic_bug_10382_1)
+  QUIC_BUG(quic_bug_10382_1)
       << "OnStreamReset() called for write unidirectional stream.";
 }
 
diff --git a/quic/core/http/quic_server_session_base.cc b/quic/core/http/quic_server_session_base.cc
index 7746113..b955835 100644
--- a/quic/core/http/quic_server_session_base.cc
+++ b/quic/core/http/quic_server_session_base.cc
@@ -171,9 +171,9 @@
           bandwidth_estimate_sent_to_client_);
   const int32_t max_bw_estimate_bytes_per_second =
       BandwidthToCachedParameterBytesPerSecond(max_bandwidth_estimate);
-  QUIC_BUG_IF_V2(quic_bug_12513_1, max_bw_estimate_bytes_per_second < 0)
+  QUIC_BUG_IF(quic_bug_12513_1, max_bw_estimate_bytes_per_second < 0)
       << max_bw_estimate_bytes_per_second;
-  QUIC_BUG_IF_V2(quic_bug_10393_1, bw_estimate_bytes_per_second < 0)
+  QUIC_BUG_IF(quic_bug_10393_1, bw_estimate_bytes_per_second < 0)
       << bw_estimate_bytes_per_second;
 
   CachedNetworkParameters cached_network_params;
@@ -206,13 +206,13 @@
 
 bool QuicServerSessionBase::ShouldCreateIncomingStream(QuicStreamId id) {
   if (!connection()->connected()) {
-    QUIC_BUG_V2(quic_bug_10393_2)
+    QUIC_BUG(quic_bug_10393_2)
         << "ShouldCreateIncomingStream called when disconnected";
     return false;
   }
 
   if (QuicUtils::IsServerInitiatedStreamId(transport_version(), id)) {
-    QUIC_BUG_V2(quic_bug_10393_3)
+    QUIC_BUG(quic_bug_10393_3)
         << "ShouldCreateIncomingStream called with server initiated "
            "stream ID.";
     return false;
@@ -230,12 +230,12 @@
 
 bool QuicServerSessionBase::ShouldCreateOutgoingBidirectionalStream() {
   if (!connection()->connected()) {
-    QUIC_BUG_V2(quic_bug_12513_2)
+    QUIC_BUG(quic_bug_12513_2)
         << "ShouldCreateOutgoingBidirectionalStream called when disconnected";
     return false;
   }
   if (!crypto_stream_->encryption_established()) {
-    QUIC_BUG_V2(quic_bug_10393_4)
+    QUIC_BUG(quic_bug_10393_4)
         << "Encryption not established so no outgoing stream created.";
     return false;
   }
@@ -245,12 +245,12 @@
 
 bool QuicServerSessionBase::ShouldCreateOutgoingUnidirectionalStream() {
   if (!connection()->connected()) {
-    QUIC_BUG_V2(quic_bug_12513_3)
+    QUIC_BUG(quic_bug_12513_3)
         << "ShouldCreateOutgoingUnidirectionalStream called when disconnected";
     return false;
   }
   if (!crypto_stream_->encryption_established()) {
-    QUIC_BUG_V2(quic_bug_10393_5)
+    QUIC_BUG(quic_bug_10393_5)
         << "Encryption not established so no outgoing stream created.";
     return false;
   }
diff --git a/quic/core/http/quic_spdy_client_session.cc b/quic/core/http/quic_spdy_client_session.cc
index ada6d85..1094f4d 100644
--- a/quic/core/http/quic_spdy_client_session.cc
+++ b/quic/core/http/quic_spdy_client_session.cc
@@ -66,7 +66,7 @@
 }
 
 bool QuicSpdyClientSession::ShouldCreateOutgoingUnidirectionalStream() {
-  QUIC_BUG_V2(quic_bug_10396_1)
+  QUIC_BUG(quic_bug_10396_1)
       << "Try to create outgoing unidirectional client data streams";
   return false;
 }
@@ -84,7 +84,7 @@
 
 QuicSpdyClientStream*
 QuicSpdyClientSession::CreateOutgoingUnidirectionalStream() {
-  QUIC_BUG_V2(quic_bug_10396_2)
+  QUIC_BUG(quic_bug_10396_2)
       << "Try to create outgoing unidirectional client data streams";
   return nullptr;
 }
@@ -139,7 +139,7 @@
 
 bool QuicSpdyClientSession::ShouldCreateIncomingStream(QuicStreamId id) {
   if (!connection()->connected()) {
-    QUIC_BUG_V2(quic_bug_10396_3)
+    QUIC_BUG(quic_bug_10396_3)
         << "ShouldCreateIncomingStream called when disconnected";
     return false;
   }
@@ -150,7 +150,7 @@
   }
 
   if (QuicUtils::IsClientInitiatedStreamId(transport_version(), id)) {
-    QUIC_BUG_V2(quic_bug_10396_4)
+    QUIC_BUG(quic_bug_10396_4)
         << "ShouldCreateIncomingStream called with client initiated "
            "stream ID.";
     return false;
diff --git a/quic/core/http/quic_spdy_client_session_base.cc b/quic/core/http/quic_spdy_client_session_base.cc
index 2cc0eb0..56a9764 100644
--- a/quic/core/http/quic_spdy_client_session_base.cc
+++ b/quic/core/http/quic_spdy_client_session_base.cc
@@ -142,7 +142,7 @@
   if (GetPromisedById(promised_id)) {
     // OnPromiseHeadersComplete() would have closed the connection if
     // promised id is a duplicate.
-    QUIC_BUG_V2(quic_bug_10412_1) << "Duplicate promise for id " << promised_id;
+    QUIC_BUG(quic_bug_10412_1) << "Duplicate promise for id " << promised_id;
     return false;
   }
 
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 6aa9829..2a2df67 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -351,8 +351,8 @@
       return;
     }
 
-    QUIC_BUG_IF_V2(quic_bug_12477_1,
-                   session_->destruction_indicator() != 123456789)
+    QUIC_BUG_IF(quic_bug_12477_1,
+                session_->destruction_indicator() != 123456789)
         << "QuicSpdyStream use after free. "
         << session_->destruction_indicator() << QuicStackTrace();
 
@@ -416,7 +416,7 @@
                              size_t payload_len,
                              size_t frame_len) override {
     if (payload_len == 0) {
-      QUIC_BUG_V2(quic_bug_10360_1) << "Zero payload length.";
+      QUIC_BUG(quic_bug_10360_1) << "Zero payload length.";
       return;
     }
     int compression_pct = 100 - (100 * frame_len) / payload_len;
@@ -499,11 +499,11 @@
 }
 
 QuicSpdySession::~QuicSpdySession() {
-  QUIC_BUG_IF_V2(quic_bug_12477_2, destruction_indicator_ != 123456789)
+  QUIC_BUG_IF(quic_bug_12477_2, destruction_indicator_ != 123456789)
       << "QuicSpdySession use after free. " << destruction_indicator_
       << QuicStackTrace();
   destruction_indicator_ = 987654321;
-  QUIC_BUG_IF_V2(quic_bug_12477_3, !h3_datagram_registrations_.empty())
+  QUIC_BUG_IF(quic_bug_12477_3, !h3_datagram_registrations_.empty())
       << "HTTP/3 datagram flow ID was not unregistered";
 }
 
@@ -677,7 +677,7 @@
                      buffered_stream_priorities_.size(),
                      ", which should not exceed the incoming stream limit of ",
                      max_open_incoming_bidirectional_streams());
-    QUIC_BUG_V2(quic_bug_10360_2) << error_message;
+    QUIC_BUG(quic_bug_10360_2) << error_message;
     connection()->CloseConnection(
         QUIC_INTERNAL_ERROR, error_message,
         ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
@@ -694,7 +694,7 @@
 }
 
 size_t QuicSpdySession::ProcessHeaderData(const struct iovec& iov) {
-  QUIC_BUG_IF_V2(quic_bug_12477_4, destruction_indicator_ != 123456789)
+  QUIC_BUG_IF(quic_bug_12477_4, destruction_indicator_ != 123456789)
       << "QuicSpdyStream use after free. " << destruction_indicator_
       << QuicStackTrace();
   return h2_deframer_.ProcessInput(static_cast<char*>(iov.iov_base),
@@ -736,7 +736,7 @@
 }
 
 void QuicSpdySession::OnHttp3GoAway(uint64_t id) {
-  QUIC_BUG_IF_V2(quic_bug_12477_5, !version().UsesHttp3())
+  QUIC_BUG_IF(quic_bug_12477_5, !version().UsesHttp3())
       << "HTTP/3 GOAWAY received on version " << version();
 
   if (last_received_http3_goaway_id_.has_value() &&
@@ -815,7 +815,7 @@
       // A previous GOAWAY frame was sent with smaller stream ID.  This is not
       // possible, because the only time a GOAWAY frame with non-maximal
       // stream ID is sent is right before closing connection.
-      QUIC_BUG_V2(quic_bug_10360_3)
+      QUIC_BUG(quic_bug_10360_3)
           << "Not sending GOAWAY frame with " << stream_id
           << " because one with " << last_sent_http3_goaway_id_.value()
           << " already sent on connection " << connection()->connection_id();
@@ -831,7 +831,7 @@
                                        QuicStreamId promised_stream_id,
                                        SpdyHeaderBlock headers) {
   if (perspective() == Perspective::IS_CLIENT) {
-    QUIC_BUG_V2(quic_bug_10360_4) << "Client shouldn't send PUSH_PROMISE";
+    QUIC_BUG(quic_bug_10360_4) << "Client shouldn't send PUSH_PROMISE";
     return;
   }
 
@@ -849,7 +849,7 @@
   }
 
   if (!max_push_id_.has_value() || promised_stream_id > max_push_id_.value()) {
-    QUIC_BUG_V2(quic_bug_12477_6)
+    QUIC_BUG(quic_bug_12477_6)
         << "Server shouldn't send push id higher than client's MAX_PUSH_ID.";
     return;
   }
@@ -914,7 +914,7 @@
     const QuicStreamId stream_id) {
   QuicStream* stream = GetOrCreateStream(stream_id);
   if (stream && stream->is_static()) {
-    QUIC_BUG_V2(quic_bug_10360_5)
+    QUIC_BUG(quic_bug_10360_5)
         << "GetOrCreateSpdyDataStream returns static stream " << stream_id
         << " in version " << transport_version() << "\n"
         << QuicStackTrace();
@@ -1006,7 +1006,7 @@
     const QuicHeaderList& /*header_list*/) {
   std::string error =
       "OnPromiseHeaderList should be overridden in client code.";
-  QUIC_BUG_V2(quic_bug_10360_6) << error;
+  QUIC_BUG(quic_bug_10360_6) << error;
   connection()->CloseConnection(QUIC_INTERNAL_ERROR, error,
                                 ConnectionCloseBehavior::SILENT_CLOSE);
 }
@@ -1184,7 +1184,7 @@
         if (value != 0 && value != 1) {
           std::string error_details = absl::StrCat(
               "received SETTINGS_H3_DATAGRAM with invalid value ", value);
-          QUIC_PEER_BUG_V2(quic_peer_bug_10360_7) << ENDPOINT << error_details;
+          QUIC_PEER_BUG(quic_peer_bug_10360_7) << ENDPOINT << error_details;
           CloseConnectionWithDetails(QUIC_HTTP_RECEIVE_SPDY_SETTING,
                                      error_details);
           return false;
@@ -1509,7 +1509,7 @@
     // possible, because this is the only method sending a GOAWAY frame with
     // non-maximal stream ID, and this must only be called once, right
     // before closing connection.
-    QUIC_BUG_V2(quic_bug_10360_8)
+    QUIC_BUG(quic_bug_10360_8)
         << "Not sending GOAWAY frame with " << stream_id << " because one with "
         << last_sent_http3_goaway_id_.value() << " already sent on connection "
         << connection()->connection_id();
@@ -1630,7 +1630,7 @@
 
 void QuicSpdySession::CloseConnectionOnDuplicateHttp3UnidirectionalStreams(
     absl::string_view type) {
-  QUIC_PEER_BUG_V2(quic_peer_bug_10360_9) << absl::StrCat(
+  QUIC_PEER_BUG(quic_peer_bug_10360_9) << absl::StrCat(
       "Received a duplicate ", type, " stream: Closing connection.");
   CloseConnectionWithDetails(QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
                              absl::StrCat(type, " stream is received twice."));
@@ -1696,11 +1696,11 @@
       connection()->helper()->GetStreamSendBufferAllocator(), slice_length);
   QuicDataWriter writer(slice_length, buffer.get());
   if (!writer.WriteVarInt62(flow_id)) {
-    QUIC_BUG_V2(quic_bug_10360_10) << "Failed to write HTTP/3 datagram flow ID";
+    QUIC_BUG(quic_bug_10360_10) << "Failed to write HTTP/3 datagram flow ID";
     return MESSAGE_STATUS_INTERNAL_ERROR;
   }
   if (!writer.WriteBytes(payload.data(), payload.length())) {
-    QUIC_BUG_V2(quic_bug_10360_11) << "Failed to write HTTP/3 datagram payload";
+    QUIC_BUG(quic_bug_10360_11) << "Failed to write HTTP/3 datagram payload";
     return MESSAGE_STATUS_INTERNAL_ERROR;
   }
 
@@ -1713,13 +1713,13 @@
     QuicSpdySession::Http3DatagramVisitor* visitor) {
   QUICHE_DCHECK_NE(visitor, nullptr);
   auto insertion_result = h3_datagram_registrations_.insert({flow_id, visitor});
-  QUIC_BUG_IF_V2(quic_bug_12477_7, !insertion_result.second)
+  QUIC_BUG_IF(quic_bug_12477_7, !insertion_result.second)
       << "Attempted to doubly register HTTP/3 flow ID " << flow_id;
 }
 
 void QuicSpdySession::UnregisterHttp3FlowId(QuicDatagramFlowId flow_id) {
   size_t num_erased = h3_datagram_registrations_.erase(flow_id);
-  QUIC_BUG_IF_V2(quic_bug_12477_8, num_erased != 1)
+  QUIC_BUG_IF(quic_bug_12477_8, num_erased != 1)
       << "Attempted to unregister unknown HTTP/3 flow ID " << flow_id;
 }