Internal QUICHE change
PiperOrigin-RevId: 278896047
Change-Id: I0b9f74930e2fd6a50a5a15ba5ddb1227be5f2a89
diff --git a/quic/core/congestion_control/bbr2_sender.cc b/quic/core/congestion_control/bbr2_sender.cc
index e8009aa..f176ff6 100644
--- a/quic/core/congestion_control/bbr2_sender.cc
+++ b/quic/core/congestion_control/bbr2_sender.cc
@@ -114,6 +114,11 @@
return params_.cwnd_limits;
}
+void Bbr2Sender::AdjustNetworkParameters(const NetworkParams& params) {
+ AdjustNetworkParameters(params.bandwidth, params.rtt,
+ params.allow_cwnd_to_decrease);
+}
+
void Bbr2Sender::AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) {
diff --git a/quic/core/congestion_control/bbr2_sender.h b/quic/core/congestion_control/bbr2_sender.h
index 74efc89..6d0f338 100644
--- a/quic/core/congestion_control/bbr2_sender.h
+++ b/quic/core/congestion_control/bbr2_sender.h
@@ -47,6 +47,7 @@
void SetFromConfig(const QuicConfig& config,
Perspective perspective) override;
+ void AdjustNetworkParameters(const NetworkParams& params) override;
void AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) override;
diff --git a/quic/core/congestion_control/bbr_sender.cc b/quic/core/congestion_control/bbr_sender.cc
index 1ba6b42..b9a259a 100644
--- a/quic/core/congestion_control/bbr_sender.cc
+++ b/quic/core/congestion_control/bbr_sender.cc
@@ -324,6 +324,11 @@
}
}
+void BbrSender::AdjustNetworkParameters(const NetworkParams& params) {
+ AdjustNetworkParameters(params.bandwidth, params.rtt,
+ params.allow_cwnd_to_decrease);
+}
+
void BbrSender::AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) {
diff --git a/quic/core/congestion_control/bbr_sender.h b/quic/core/congestion_control/bbr_sender.h
index b4baa2f..a128797 100644
--- a/quic/core/congestion_control/bbr_sender.h
+++ b/quic/core/congestion_control/bbr_sender.h
@@ -105,6 +105,7 @@
void SetFromConfig(const QuicConfig& config,
Perspective perspective) override;
+ void AdjustNetworkParameters(const NetworkParams& params) override;
void AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) override;
diff --git a/quic/core/congestion_control/send_algorithm_interface.h b/quic/core/congestion_control/send_algorithm_interface.h
index 4f84f13..cde23b1 100644
--- a/quic/core/congestion_control/send_algorithm_interface.h
+++ b/quic/core/congestion_control/send_algorithm_interface.h
@@ -31,6 +31,20 @@
class QUIC_EXPORT_PRIVATE SendAlgorithmInterface {
public:
+ // Network Params for AdjustNetworkParameters.
+ struct QUIC_NO_EXPORT NetworkParams {
+ NetworkParams()
+ : bandwidth(QuicBandwidth::Zero()),
+ rtt(QuicTime::Delta::Zero()),
+ allow_cwnd_to_decrease(false) {}
+ NetworkParams(NetworkParams&& params) = default;
+ NetworkParams& operator=(NetworkParams&& params) = default;
+
+ QuicBandwidth bandwidth;
+ QuicTime::Delta rtt;
+ bool allow_cwnd_to_decrease;
+ };
+
static SendAlgorithmInterface* Create(
const QuicClock* clock,
const RttStats* rtt_stats,
@@ -115,6 +129,9 @@
// Notifies the congestion control algorithm of an external network
// measurement or prediction. Either |bandwidth| or |rtt| may be zero if no
// sample is available.
+ virtual void AdjustNetworkParameters(const NetworkParams& params) = 0;
+ // TODO(b/143891040): Replace old interface with the new one that uses
+ // NetworkParams.
virtual void AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) = 0;
diff --git a/quic/core/congestion_control/tcp_cubic_sender_bytes.cc b/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
index 28f284e..c26656f 100644
--- a/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
+++ b/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
@@ -105,6 +105,10 @@
}
}
+void TcpCubicSenderBytes::AdjustNetworkParameters(const NetworkParams& params) {
+ AdjustNetworkParameters(params.bandwidth, params.rtt,
+ params.allow_cwnd_to_decrease);
+}
void TcpCubicSenderBytes::AdjustNetworkParameters(
QuicBandwidth bandwidth,
QuicTime::Delta rtt,
diff --git a/quic/core/congestion_control/tcp_cubic_sender_bytes.h b/quic/core/congestion_control/tcp_cubic_sender_bytes.h
index 50f7981..c78d5d8 100644
--- a/quic/core/congestion_control/tcp_cubic_sender_bytes.h
+++ b/quic/core/congestion_control/tcp_cubic_sender_bytes.h
@@ -46,6 +46,7 @@
// Start implementation of SendAlgorithmInterface.
void SetFromConfig(const QuicConfig& config,
Perspective perspective) override;
+ void AdjustNetworkParameters(const NetworkParams& params) override;
void AdjustNetworkParameters(QuicBandwidth bandwidth,
QuicTime::Delta rtt,
bool allow_cwnd_to_decrease) override;