Deprecate gfe2_reloadable_flag_quic_fix_arm_pto_for_application_data.

PiperOrigin-RevId: 345455252
Change-Id: I04437cf0eda91c2423ad65bacd75e4be9b7ee53d
diff --git a/quic/core/quic_flags_list.h b/quic/core/quic_flags_list.h
index a19d821..e5b2fa9 100644
--- a/quic/core/quic_flags_list.h
+++ b/quic/core/quic_flags_list.h
@@ -37,7 +37,6 @@
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_enable_server_on_wire_ping, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_encrypted_control_frames, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_extract_x509_subject_using_certificate_view, true)
-QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_arm_pto_for_application_data, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_missing_initial_keys2, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_out_of_order_sending2, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_pto_pending_timer_count, true)
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index 5927b14..d3e9a82 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -112,7 +112,6 @@
       handshake_packet_acked_(false),
       zero_rtt_packet_acked_(false),
       one_rtt_packet_acked_(false),
-      one_rtt_packet_sent_(false),
       first_pto_srtt_multiplier_(0),
       use_standard_deviation_for_pto_(false),
       pto_multiplier_without_rtt_samples_(3),
@@ -600,7 +599,8 @@
   for (int8_t i = 0; i < NUM_PACKET_NUMBER_SPACES; ++i) {
     const QuicTime sent_time = unacked_packets_.GetLastInFlightPacketSentTime(
         static_cast<PacketNumberSpace>(i));
-    if (!ShouldArmPtoForApplicationData() && i == APPLICATION_DATA) {
+    if (!handshake_finished_ && i == APPLICATION_DATA) {
+      // Do not arm PTO for application data until handshake gets confirmed.
       continue;
     }
     if (!sent_time.IsInitialized() || (earliest_sent_time.IsInitialized() &&
@@ -614,24 +614,6 @@
   return earliest_sent_time;
 }
 
-bool QuicSentPacketManager::ShouldArmPtoForApplicationData() const {
-  DCHECK(supports_multiple_packet_number_spaces());
-  if (GetQuicReloadableFlag(quic_fix_arm_pto_for_application_data)) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_fix_arm_pto_for_application_data);
-    // Do not arm PTO for application data until handshake gets confirmed.
-    return handshake_finished_;
-  }
-  // Application data must be ignored before handshake completes (1-RTT key
-  // is available). Not arming PTO for application data to prioritize the
-  // completion of handshake. On the server side, handshake_finished_
-  // indicates handshake complete (and confirmed). On the client side,
-  // one_rtt_packet_sent_ indicates handshake complete (while handshake
-  // confirmation will happen later).
-  return handshake_finished_ ||
-         (unacked_packets_.perspective() == Perspective::IS_CLIENT &&
-          one_rtt_packet_sent_);
-}
-
 void QuicSentPacketManager::MarkForRetransmission(
     QuicPacketNumber packet_number,
     TransmissionType transmission_type) {
@@ -829,10 +811,6 @@
                                   has_retransmittable_data);
   }
 
-  if (packet.encryption_level == ENCRYPTION_FORWARD_SECURE) {
-    one_rtt_packet_sent_ = true;
-  }
-
   // Deallocate message data in QuicMessageFrame immediately after packet
   // sent.
   if (packet.has_message) {
@@ -895,7 +873,7 @@
     case PTO_MODE:
       QUIC_DVLOG(1) << ENDPOINT << "PTO mode";
       ++stats_->pto_count;
-      if (handshake_mode_disabled_ && !ShouldArmPtoForApplicationData()) {
+      if (handshake_mode_disabled_ && !handshake_finished_) {
         ++stats_->crypto_retransmit_count;
       }
       ++consecutive_pto_count_;
diff --git a/quic/core/quic_sent_packet_manager.h b/quic/core/quic_sent_packet_manager.h
index 2dba799..67c3c51 100644
--- a/quic/core/quic_sent_packet_manager.h
+++ b/quic/core/quic_sent_packet_manager.h
@@ -551,10 +551,6 @@
   // timeout.
   bool ShouldAddMaxAckDelay(PacketNumberSpace space) const;
 
-  // Returns true if application data should be used to arm PTO. Only used when
-  // multiple packet number space is enabled.
-  bool ShouldArmPtoForApplicationData() const;
-
   // A helper function to return total delay of |num_timeouts| retransmission
   // timeout with TLP and RTO mode.
   QuicTime::Delta GetNConsecutiveRetransmissionTimeoutDelay(
@@ -718,9 +714,6 @@
   // True if any 1-RTT packet gets acknowledged.
   bool one_rtt_packet_acked_;
 
-  // True if any 1-RTT packet gets sent.
-  bool one_rtt_packet_sent_;
-
   // If > 0, arm the 1st PTO with max of earliest in flight sent time + PTO
   // delay and multiplier * srtt from last in flight packet.
   float first_pto_srtt_multiplier_;
diff --git a/quic/core/quic_sent_packet_manager_test.cc b/quic/core/quic_sent_packet_manager_test.cc
index e087211..f6d6f6d 100644
--- a/quic/core/quic_sent_packet_manager_test.cc
+++ b/quic/core/quic_sent_packet_manager_test.cc
@@ -3318,7 +3318,6 @@
   // Send packet 6 in 1-RTT.
   clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(10));
   SendDataPacket(6, ENCRYPTION_FORWARD_SECURE);
-  const QuicTime packet6_sent_time = clock_.Now();
   // Verify PTO timeout is now based on packet 5.
   EXPECT_EQ(packet5_sent_time + expected_pto_delay * 2,
             manager_.GetRetransmissionTime());
@@ -3328,21 +3327,11 @@
   const QuicTime packet7_sent_time = clock_.Now();
   SendDataPacket(7, ENCRYPTION_HANDSHAKE);
 
-  if (GetQuicReloadableFlag(quic_fix_arm_pto_for_application_data)) {
-    expected_pto_delay =
-        srtt + GetPtoRttvarMultiplier() * rtt_stats->mean_deviation();
-    // Verify PTO timeout is now based on packet 7.
-    EXPECT_EQ(packet7_sent_time + expected_pto_delay * 2,
-              manager_.GetRetransmissionTime());
-
-  } else {
-    expected_pto_delay =
-        srtt + GetPtoRttvarMultiplier() * rtt_stats->mean_deviation() +
-        QuicTime::Delta::FromMilliseconds(kDefaultDelayedAckTimeMs);
-    // Verify PTO timeout is now based on packet 6.
-    EXPECT_EQ(packet6_sent_time + expected_pto_delay * 2,
-              manager_.GetRetransmissionTime());
-  }
+  expected_pto_delay =
+      srtt + GetPtoRttvarMultiplier() * rtt_stats->mean_deviation();
+  // Verify PTO timeout is now based on packet 7.
+  EXPECT_EQ(packet7_sent_time + expected_pto_delay * 2,
+            manager_.GetRetransmissionTime());
 
   // Neuter handshake key.
   manager_.SetHandshakeConfirmed();