Replace last_sample_is_app_limited with congestion_event.last_packet_send_state.is_app_limited in QUIC BBR2, resolving a flag deprecation TODO.

PiperOrigin-RevId: 403954644
diff --git a/quic/core/congestion_control/bbr2_misc.cc b/quic/core/congestion_control/bbr2_misc.cc
index b67b7df..7bc09ae 100644
--- a/quic/core/congestion_control/bbr2_misc.cc
+++ b/quic/core/congestion_control/bbr2_misc.cc
@@ -109,8 +109,6 @@
 
   if (sample.last_packet_send_state.is_valid) {
     congestion_event->last_packet_send_state = sample.last_packet_send_state;
-    congestion_event->last_sample_is_app_limited =
-        sample.last_packet_send_state.is_app_limited;
   }
 
   // Avoid updating |max_bandwidth_filter_| if a) this is a loss-only event, or
@@ -402,7 +400,7 @@
     const Bbr2CongestionEvent& congestion_event) {
   QUICHE_DCHECK(!full_bandwidth_reached_);
   QUICHE_DCHECK(congestion_event.end_of_round_trip);
-  if (congestion_event.last_sample_is_app_limited) {
+  if (congestion_event.last_packet_send_state.is_app_limited) {
     return APP_LIMITED;
   }
 
diff --git a/quic/core/congestion_control/bbr2_misc.h b/quic/core/congestion_control/bbr2_misc.h
index d017b55..648e4df 100644
--- a/quic/core/congestion_control/bbr2_misc.h
+++ b/quic/core/congestion_control/bbr2_misc.h
@@ -312,12 +312,6 @@
   // Whether acked_packets indicates the end of a round trip.
   bool end_of_round_trip = false;
 
-  // TODO(wub): After deprecating --quic_one_bw_sample_per_ack_event, use
-  // last_packet_send_state.is_app_limited instead of this field.
-  // Whether the last bandwidth sample from acked_packets is app limited.
-  // false if acked_packets is empty.
-  bool last_sample_is_app_limited = false;
-
   // When the event happened, whether the sender is probing for bandwidth.
   bool is_probing_for_bandwidth = false;
 
diff --git a/quic/core/congestion_control/bbr2_probe_bw.cc b/quic/core/congestion_control/bbr2_probe_bw.cc
index fbc7769..579bdba 100644
--- a/quic/core/congestion_control/bbr2_probe_bw.cc
+++ b/quic/core/congestion_control/bbr2_probe_bw.cc
@@ -115,7 +115,7 @@
   if (cycle_.rounds_in_phase == 1 && congestion_event.end_of_round_trip) {
     cycle_.is_sample_from_probing = false;
 
-    if (!congestion_event.last_sample_is_app_limited) {
+    if (!congestion_event.last_packet_send_state.is_app_limited) {
       QUIC_DVLOG(2)
           << sender_
           << " Advancing max bw filter after one round in PROBE_DOWN.";
@@ -370,7 +370,7 @@
     // Don't continue adding bytes to probe_up_acked if the sender was not
     // app-limited after being inflight_hi limited at least once.
     if (!cycle_.probe_up_app_limited_since_inflight_hi_limited_ ||
-        congestion_event.last_sample_is_app_limited) {
+        congestion_event.last_packet_send_state.is_app_limited) {
       cycle_.probe_up_app_limited_since_inflight_hi_limited_ = false;
       if (congestion_event.prior_bytes_in_flight <
           congestion_event.prior_cwnd) {
diff --git a/quic/core/congestion_control/bbr2_sender.cc b/quic/core/congestion_control/bbr2_sender.cc
index 1e27649..23e15b8 100644
--- a/quic/core/congestion_control/bbr2_sender.cc
+++ b/quic/core/congestion_control/bbr2_sender.cc
@@ -335,7 +335,8 @@
 
   model_.OnCongestionEventFinish(unacked_packets_->GetLeastUnacked(),
                                  congestion_event);
-  last_sample_is_app_limited_ = congestion_event.last_sample_is_app_limited;
+  last_sample_is_app_limited_ =
+      congestion_event.last_packet_send_state.is_app_limited;
   if (congestion_event.bytes_in_flight == 0 &&
       params().avoid_unnecessary_probe_rtt) {
     OnEnterQuiescence(event_time);
diff --git a/quic/core/congestion_control/bbr2_startup.cc b/quic/core/congestion_control/bbr2_startup.cc
index f882c02..c276f36 100644
--- a/quic/core/congestion_control/bbr2_startup.cc
+++ b/quic/core/congestion_control/bbr2_startup.cc
@@ -62,7 +62,7 @@
   if (Params().decrease_startup_pacing_at_end_of_round) {
     QUICHE_DCHECK_GT(model_->pacing_gain(), 0);
     if (congestion_event.end_of_round_trip &&
-        !congestion_event.last_sample_is_app_limited) {
+        !congestion_event.last_packet_send_state.is_app_limited) {
       // Multiply by startup_pacing_gain, so if the bandwidth doubles,
       // the pacing gain will be the full startup_pacing_gain.
       if (max_bw_at_round_beginning_ > QuicBandwidth::Zero()) {