gfe-relnote: (n/a) Add a Bbr2Sender::GetTargetBytesInflight function and use it in Bbr2ProbeBwMode. Refactor only, no behavior change.

PiperOrigin-RevId: 286216495
Change-Id: Ia9185ff0bc707973ed11908aa33d6f4dcce731ea
diff --git a/quic/core/congestion_control/bbr2_sender.cc b/quic/core/congestion_control/bbr2_sender.cc
index 3e707f3..d795ad1 100644
--- a/quic/core/congestion_control/bbr2_sender.cc
+++ b/quic/core/congestion_control/bbr2_sender.cc
@@ -312,6 +312,11 @@
                 << ", CWND: " << GetCongestionWindow();
 }
 
+QuicByteCount Bbr2Sender::GetTargetBytesInflight() const {
+  QuicByteCount bdp = model_.BDP(model_.BandwidthEstimate());
+  return std::min(bdp, GetCongestionWindow());
+}
+
 void Bbr2Sender::PopulateConnectionStats(QuicConnectionStats* stats) const {
   stats->num_ack_aggregation_epochs = model_.num_ack_aggregation_epochs();
 }