Index: net/quic/core/congestion_control/bbr_sender.cc |
diff --git a/net/quic/core/congestion_control/bbr_sender.cc b/net/quic/core/congestion_control/bbr_sender.cc |
index fb02690df2c09e47daeb4051b413be3b429cfa45..3f3714ef14c8ace3d0a3af5d543f2d4f6a202c51 100644 |
--- a/net/quic/core/congestion_control/bbr_sender.cc |
+++ b/net/quic/core/congestion_control/bbr_sender.cc |
@@ -119,7 +119,8 @@ BbrSender::BbrSender(const RttStats* rtt_stats, |
recovery_state_(NOT_IN_RECOVERY), |
end_recovery_at_(0), |
recovery_window_(max_congestion_window_), |
- bytes_recently_acked_(0) { |
+ bytes_recently_acked_(0), |
+ rate_based_recovery_(false) { |
EnterStartupMode(); |
} |
@@ -204,7 +205,7 @@ QuicByteCount BbrSender::GetCongestionWindow() const { |
return kMinimumCongestionWindow; |
} |
- if (InRecovery()) { |
+ if (InRecovery() && !rate_based_recovery_) { |
return std::min(congestion_window_, recovery_window_); |
} |
@@ -227,6 +228,10 @@ void BbrSender::SetFromConfig(const QuicConfig& config, |
if (config.HasClientRequestedIndependentOption(k2RTT, perspective)) { |
num_startup_rtts_ = 2; |
} |
+ if (FLAGS_quic_reloadable_flag_quic_bbr_rate_recovery && |
+ config.HasClientRequestedIndependentOption(kBBRR, perspective)) { |
+ rate_based_recovery_ = true; |
+ } |
} |
void BbrSender::ResumeConnectionState( |
@@ -610,6 +615,10 @@ void BbrSender::CalculatePacingRate() { |
} |
QuicBandwidth target_rate = pacing_gain_ * BandwidthEstimate(); |
+ if (rate_based_recovery_ && InRecovery()) { |
+ QUIC_FLAG_COUNT(quic_reloadable_flag_quic_bbr_rate_recovery); |
+ pacing_rate_ = pacing_gain_ * max_bandwidth_.GetThirdBest(); |
+ } |
if (is_at_full_bandwidth_) { |
pacing_rate_ = target_rate; |
return; |
@@ -680,6 +689,9 @@ void BbrSender::CalculateCongestionWindow(QuicByteCount bytes_acked) { |
void BbrSender::CalculateRecoveryWindow(QuicByteCount bytes_acked, |
QuicByteCount bytes_lost) { |
+ if (rate_based_recovery_) { |
+ return; |
+ } |
if (FLAGS_quic_reloadable_flag_quic_bbr_fix_conservation2) { |
if (recovery_state_ == NOT_IN_RECOVERY) { |
return; |