Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: net/quic/congestion_control/pacing_sender.cc

Issue 2064543002: Add a new rate based sending connection option which uses the pacing rate to keep the bytes_in_flig… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@124273380
Patch Set: Rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/pacing_sender.h ('k') | net/quic/congestion_control/pacing_sender_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/pacing_sender.cc
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc
index d1a00c70b6af9e6d4d869dcd444ba9abbe861f86..e18183f4dd6f4fb947e2db25beee09161e572efb 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -88,9 +88,10 @@ bool PacingSender::OnPacketSent(
ideal_next_packet_send_time_ = QuicTime::Zero();
return in_flight;
}
- // The next packet should be sent as soon as the current packets has been
- // transferred.
- QuicTime::Delta delay = PacingRate().TransferTime(bytes);
+ // The next packet should be sent as soon as the current packet has been
+ // transferred. PacingRate is based on bytes in flight including this packet.
+ QuicTime::Delta delay =
+ PacingRate(bytes_in_flight + bytes).TransferTime(bytes);
// If the last send was delayed, and the alarm took a long time to get
// invoked, allow the connection to make up for lost time.
if (was_last_send_delayed_) {
@@ -154,13 +155,13 @@ QuicTime::Delta PacingSender::TimeUntilSend(
return QuicTime::Delta::Zero();
}
-QuicBandwidth PacingSender::PacingRate() const {
+QuicBandwidth PacingSender::PacingRate(QuicByteCount bytes_in_flight) const {
if (!max_pacing_rate_.IsZero()) {
return QuicBandwidth::FromBitsPerSecond(
min(max_pacing_rate_.ToBitsPerSecond(),
- sender_->PacingRate().ToBitsPerSecond()));
+ sender_->PacingRate(bytes_in_flight).ToBitsPerSecond()));
}
- return sender_->PacingRate();
+ return sender_->PacingRate(bytes_in_flight);
}
QuicBandwidth PacingSender::BandwidthEstimate() const {
« no previous file with comments | « net/quic/congestion_control/pacing_sender.h ('k') | net/quic/congestion_control/pacing_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698