gfe-relnote: In QUIC, add uber_received_packet_manager which purely wraps a received_packet_manager. Using it is protected by gfe2_reloadable_flag_quic_use_uber_received_packet_manager.

PiperOrigin-RevId: 239601171
Change-Id: Iaa62e2641e0466a03981a6ba7dd128990b09744c
diff --git a/quic/test_tools/quic_connection_peer.cc b/quic/test_tools/quic_connection_peer.cc
index 953e495..22d2880 100644
--- a/quic/test_tools/quic_connection_peer.cc
+++ b/quic/test_tools/quic_connection_peer.cc
@@ -39,7 +39,12 @@
     QuicConnection* connection) {
   const bool ack_frame_updated = connection->ack_frame_updated();
   const QuicFrame ack_frame = connection->GetUpdatedAckFrame();
-  connection->received_packet_manager_.ack_frame_updated_ = ack_frame_updated;
+  if (connection->use_uber_received_packet_manager_) {
+    connection->uber_received_packet_manager_.received_packet_manager_
+        .ack_frame_updated_ = ack_frame_updated;
+  } else {
+    connection->received_packet_manager_.ack_frame_updated_ = ack_frame_updated;
+  }
   return ack_frame;
 }
 
@@ -259,7 +264,12 @@
 void QuicConnectionPeer::SetAckMode(QuicConnection* connection,
                                     AckMode ack_mode) {
   if (connection->received_packet_manager_.decide_when_to_send_acks()) {
-    connection->received_packet_manager_.ack_mode_ = ack_mode;
+    if (connection->use_uber_received_packet_manager_) {
+      connection->uber_received_packet_manager_.received_packet_manager_
+          .ack_mode_ = ack_mode;
+    } else {
+      connection->received_packet_manager_.ack_mode_ = ack_mode;
+    }
   } else {
     connection->ack_mode_ = ack_mode;
   }
@@ -270,8 +280,13 @@
     QuicConnection* connection,
     bool fast_ack_after_quiescence) {
   if (connection->received_packet_manager_.decide_when_to_send_acks()) {
-    connection->received_packet_manager_.fast_ack_after_quiescence_ =
-        fast_ack_after_quiescence;
+    if (connection->use_uber_received_packet_manager_) {
+      connection->uber_received_packet_manager_.received_packet_manager_
+          .fast_ack_after_quiescence_ = fast_ack_after_quiescence;
+    } else {
+      connection->received_packet_manager_.fast_ack_after_quiescence_ =
+          fast_ack_after_quiescence;
+    }
   } else {
     connection->fast_ack_after_quiescence_ = fast_ack_after_quiescence;
   }
@@ -281,8 +296,13 @@
 void QuicConnectionPeer::SetAckDecimationDelay(QuicConnection* connection,
                                                float ack_decimation_delay) {
   if (connection->received_packet_manager_.decide_when_to_send_acks()) {
-    connection->received_packet_manager_.ack_decimation_delay_ =
-        ack_decimation_delay;
+    if (connection->use_uber_received_packet_manager_) {
+      connection->uber_received_packet_manager_.received_packet_manager_
+          .ack_decimation_delay_ = ack_decimation_delay;
+    } else {
+      connection->received_packet_manager_.ack_decimation_delay_ =
+          ack_decimation_delay;
+    }
   } else {
     connection->ack_decimation_delay_ = ack_decimation_delay;
   }
diff --git a/quic/test_tools/quic_test_utils.h b/quic/test_tools/quic_test_utils.h
index 965082b..f61bd25 100644
--- a/quic/test_tools/quic_test_utils.h
+++ b/quic/test_tools/quic_test_utils.h
@@ -1040,7 +1040,7 @@
   MOCK_METHOD2(RecordPacketReceived,
                void(const QuicPacketHeader& header, QuicTime receipt_time));
   MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number));
-  MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number));
+  MOCK_CONST_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number));
   MOCK_METHOD1(UpdatePacketInformationSentByPeer,
                void(const QuicStopWaitingFrame& stop_waiting));
   MOCK_CONST_METHOD0(HasNewMissingPackets, bool(void));