Deprecate gfe2_reloadable_flag_quic_loss_removes_from_inflight.

gfe-relnote: n/a (Flag deprection)
PiperOrigin-RevId: 267062161
Change-Id: I13504cbdb08fd27b4cee4ceedede5b2929604b89
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index a70dd01..2eb606b 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -47,16 +47,6 @@
   return transmission_info.has_crypto_handshake;
 }
 
-// Returns true if retransmissions the specified type leave the data in flight.
-inline bool RetransmissionLeavesBytesInFlight(
-    TransmissionType transmission_type) {
-  // Both TLP and the new RTO leave the packets in flight and let the loss
-  // detection decide if packets are lost.
-  return transmission_type == TLP_RETRANSMISSION ||
-         transmission_type == PROBING_RETRANSMISSION ||
-         transmission_type == RTO_RETRANSMISSION;
-}
-
 // Returns true of retransmissions of the specified type should retransmit
 // the frames directly (as opposed to resulting in a loss notification).
 inline bool ShouldForceRetransmission(TransmissionType transmission_type) {
@@ -118,15 +108,10 @@
       pto_enabled_(false),
       max_probe_packets_per_pto_(2),
       consecutive_pto_count_(0),
-      loss_removes_from_inflight_(
-          GetQuicReloadableFlag(quic_loss_removes_from_inflight)),
       ignore_tlpr_if_no_pending_stream_data_(
           GetQuicReloadableFlag(quic_ignore_tlpr_if_no_pending_stream_data)),
       fix_rto_retransmission_(false),
       handshake_mode_disabled_(false) {
-  if (loss_removes_from_inflight_) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_loss_removes_from_inflight);
-  }
   SetSendAlgorithm(congestion_control_type);
 }
 
@@ -401,7 +386,7 @@
        it != unacked_packets_.end(); ++it, ++packet_number) {
     if ((retransmission_type == ALL_UNACKED_RETRANSMISSION ||
          it->encryption_level == ENCRYPTION_ZERO_RTT)) {
-      if (loss_removes_from_inflight_ && it->in_flight) {
+      if (it->in_flight) {
         // Remove 0-RTT packets and packets of the wrong version from flight,
         // because neither can be processed by the peer.
         unacked_packets_.RemoveFromInFlight(&*it);
@@ -436,16 +421,13 @@
   for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
        it != unacked_packets_.end(); ++it, ++packet_number) {
     if (it->encryption_level == ENCRYPTION_INITIAL) {
-      if (loss_removes_from_inflight_ ||
-          unacked_packets_.HasRetransmittableFrames(*it)) {
-        // Once you're forward secure, no unencrypted packets will be sent,
-        // crypto or otherwise. Unencrypted packets are neutered and abandoned,
-        // to ensure they are not retransmitted or considered lost from a
-        // congestion control perspective.
-        pending_retransmissions_.erase(packet_number);
-        unacked_packets_.RemoveFromInFlight(packet_number);
-        unacked_packets_.RemoveRetransmittability(packet_number);
-      }
+      // Once you're forward secure, no unencrypted packets will be sent,
+      // crypto or otherwise. Unencrypted packets are neutered and abandoned,
+      // to ensure they are not retransmitted or considered lost from a
+      // congestion control perspective.
+      pending_retransmissions_.erase(packet_number);
+      unacked_packets_.RemoveFromInFlight(packet_number);
+      unacked_packets_.RemoveRetransmittability(packet_number);
     }
   }
 }
@@ -489,11 +471,6 @@
   // Handshake packets should never be sent as probing retransmissions.
   DCHECK(pto_enabled_ || !transmission_info->has_crypto_handshake ||
          transmission_type != PROBING_RETRANSMISSION);
-  if (!loss_removes_from_inflight_ &&
-      !RetransmissionLeavesBytesInFlight(transmission_type)) {
-    unacked_packets_.RemoveFromInFlight(transmission_info);
-  }
-
   if (!session_decides_what_to_write()) {
     if (!unacked_packets_.HasRetransmittableFrames(*transmission_info)) {
       return;
@@ -965,10 +942,7 @@
       debug_delegate_->OnPacketLoss(packet.packet_number, LOSS_RETRANSMISSION,
                                     time);
     }
-
-    if (loss_removes_from_inflight_) {
-      unacked_packets_.RemoveFromInFlight(packet.packet_number);
-    }
+    unacked_packets_.RemoveFromInFlight(packet.packet_number);
     MarkForRetransmission(packet.packet_number, LOSS_RETRANSMISSION);
   }
 }
diff --git a/quic/core/quic_sent_packet_manager.h b/quic/core/quic_sent_packet_manager.h
index 2d8381c..f201eb8 100644
--- a/quic/core/quic_sent_packet_manager.h
+++ b/quic/core/quic_sent_packet_manager.h
@@ -654,9 +654,6 @@
   // Number of times the PTO timer has fired in a row without receiving an ack.
   size_t consecutive_pto_count_;
 
-  // Latched value of quic_loss_removes_from_inflight.
-  const bool loss_removes_from_inflight_;
-
   // Latched value of quic_ignore_tlpr_if_no_pending_stream_data.
   const bool ignore_tlpr_if_no_pending_stream_data_;
 
diff --git a/quic/core/quic_sent_packet_manager_test.cc b/quic/core/quic_sent_packet_manager_test.cc
index 43b0094..50ecd9d 100644
--- a/quic/core/quic_sent_packet_manager_test.cc
+++ b/quic/core/quic_sent_packet_manager_test.cc
@@ -1125,9 +1125,7 @@
     EXPECT_FALSE(manager_.HasPendingRetransmissions());
   }
   // Expect all 4 handshake packets to be in flight and 3 data packets.
-  if (GetQuicReloadableFlag(quic_loss_removes_from_inflight)) {
-    EXPECT_EQ(7 * kDefaultLength, manager_.GetBytesInFlight());
-  }
+  EXPECT_EQ(7 * kDefaultLength, manager_.GetBytesInFlight());
   EXPECT_TRUE(manager_.HasUnackedCryptoPackets());
 
   // The second retransmits 2 packets.
@@ -1144,25 +1142,18 @@
     RetransmitNextPacket(9);
     EXPECT_FALSE(manager_.HasPendingRetransmissions());
   }
-  if (GetQuicReloadableFlag(quic_loss_removes_from_inflight)) {
-    EXPECT_EQ(9 * kDefaultLength, manager_.GetBytesInFlight());
-  }
+  EXPECT_EQ(9 * kDefaultLength, manager_.GetBytesInFlight());
   EXPECT_TRUE(manager_.HasUnackedCryptoPackets());
 
   // Now ack the two crypto packets and the speculatively encrypted request,
   // and ensure the first four crypto packets get abandoned, but not lost.
-  if (GetQuicReloadableFlag(quic_loss_removes_from_inflight)) {
-    // Crypto packets remain in flight, so any that aren't acked will be lost.
-    uint64_t acked[] = {3, 4, 5, 8, 9};
-    uint64_t lost[] = {1, 2, 6};
-    ExpectAcksAndLosses(true, acked, QUIC_ARRAYSIZE(acked), lost,
-                        QUIC_ARRAYSIZE(lost));
-    if (manager_.session_decides_what_to_write()) {
-      EXPECT_CALL(notifier_, OnFrameLost(_)).Times(3);
-    }
-  } else {
-    uint64_t acked[] = {3, 4, 5, 8, 9};
-    ExpectAcksAndLosses(true, acked, QUIC_ARRAYSIZE(acked), nullptr, 0);
+  // Crypto packets remain in flight, so any that aren't acked will be lost.
+  uint64_t acked[] = {3, 4, 5, 8, 9};
+  uint64_t lost[] = {1, 2, 6};
+  ExpectAcksAndLosses(true, acked, QUIC_ARRAYSIZE(acked), lost,
+                      QUIC_ARRAYSIZE(lost));
+  if (manager_.session_decides_what_to_write()) {
+    EXPECT_CALL(notifier_, OnFrameLost(_)).Times(3);
   }
   if (manager_.session_decides_what_to_write()) {
     EXPECT_CALL(notifier_, HasUnackedCryptoData())
@@ -1297,13 +1288,8 @@
                                    ENCRYPTION_INITIAL));
 
   EXPECT_FALSE(manager_.HasUnackedCryptoPackets());
-  if (GetQuicReloadableFlag(quic_loss_removes_from_inflight)) {
-    uint64_t unacked[] = {1, 3};
-    VerifyUnackedPackets(unacked, QUIC_ARRAYSIZE(unacked));
-  } else {
-    uint64_t unacked[] = {3};
-    VerifyUnackedPackets(unacked, QUIC_ARRAYSIZE(unacked));
-  }
+  uint64_t unacked[] = {1, 3};
+  VerifyUnackedPackets(unacked, QUIC_ARRAYSIZE(unacked));
 }
 
 TEST_P(QuicSentPacketManagerTest, CryptoHandshakeTimeoutUnsentDataPacket) {