Add a QUIC BBR2 connection option 'B2HR' to use 15% inflight_hi headroom instead of the value specified by flag --quic_bbr2_default_inflight_hi_headroom.

PiperOrigin-RevId: 332922417
Change-Id: Ic0a8744553ef2a5625e1bcb09f9a6e8a573a1926
diff --git a/quic/core/congestion_control/bbr2_sender.cc b/quic/core/congestion_control/bbr2_sender.cc
index 94cfc1f..fe32835 100644
--- a/quic/core/congestion_control/bbr2_sender.cc
+++ b/quic/core/congestion_control/bbr2_sender.cc
@@ -13,6 +13,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_bandwidth.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
 
 namespace quic {
@@ -129,6 +130,11 @@
     QUIC_RELOADABLE_FLAG_COUNT(quic_bbr2_limit_inflight_hi);
     params_.limit_inflight_hi_by_cwnd = true;
   }
+  if (GetQuicReloadableFlag(quic_bbr2_use_tcp_inflight_hi_headroom) &&
+      config.HasClientRequestedIndependentOption(kB2HR, perspective)) {
+    QUIC_RELOADABLE_FLAG_COUNT(quic_bbr2_use_tcp_inflight_hi_headroom);
+    params_.inflight_hi_headroom = 0.15;
+  }
 
   ApplyConnectionOptions(config.ClientRequestedIndependentOptions(perspective));
 }
diff --git a/quic/core/crypto/crypto_protocol.h b/quic/core/crypto/crypto_protocol.h
index 07f2bae..bf3a97c 100644
--- a/quic/core/crypto/crypto_protocol.h
+++ b/quic/core/crypto/crypto_protocol.h
@@ -126,6 +126,7 @@
 const QuicTag kB2LO = TAG('B', '2', 'L', 'O');   // Ignore inflight_lo in BBR2
 const QuicTag kB2HI = TAG('B', '2', 'H', 'I');   // Limit inflight_hi reduction
                                                  // based on CWND.
+const QuicTag kB2HR = TAG('B', '2', 'H', 'R');   // 15% inflight_hi headroom.
 const QuicTag kBSAO = TAG('B', 'S', 'A', 'O');   // Avoid Overestimation in
                                                  // Bandwidth Sampler with ack
                                                  // aggregation