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

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

Issue 2130103002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 e18183f4dd6f4fb947e2db25beee09161e572efb..7f366c93cd1d75d955f680c9f88d8b18150bfc59 100644
--- a/net/quic/congestion_control/pacing_sender.cc
+++ b/net/quic/congestion_control/pacing_sender.cc
@@ -40,10 +40,6 @@ void PacingSender::SetNumEmulatedConnections(int num_connections) {
sender_->SetNumEmulatedConnections(num_connections);
}
-void PacingSender::SetMaxCongestionWindow(QuicByteCount max_congestion_window) {
- sender_->SetMaxCongestionWindow(max_congestion_window);
-}
-
void PacingSender::SetMaxPacingRate(QuicBandwidth max_pacing_rate) {
max_pacing_rate_ = max_pacing_rate;
}
@@ -95,12 +91,12 @@ bool PacingSender::OnPacketSent(
// 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_) {
- ideal_next_packet_send_time_ = ideal_next_packet_send_time_.Add(delay);
+ ideal_next_packet_send_time_ = ideal_next_packet_send_time_ + delay;
// The send was application limited if it takes longer than the
// pacing delay between sent packets.
const bool application_limited =
last_delayed_packet_sent_time_.IsInitialized() &&
- sent_time > last_delayed_packet_sent_time_.Add(delay);
+ sent_time > last_delayed_packet_sent_time_ + delay;
const bool making_up_for_lost_time =
ideal_next_packet_send_time_ <= sent_time;
// As long as we're making up time and not application limited,
@@ -113,8 +109,8 @@ bool PacingSender::OnPacketSent(
last_delayed_packet_sent_time_ = QuicTime::Zero();
}
} else {
- ideal_next_packet_send_time_ = QuicTime::Max(
- ideal_next_packet_send_time_.Add(delay), sent_time.Add(delay));
+ ideal_next_packet_send_time_ =
+ QuicTime::Max(ideal_next_packet_send_time_ + delay, sent_time + delay);
}
return in_flight;
}
@@ -144,11 +140,11 @@ QuicTime::Delta PacingSender::TimeUntilSend(
}
// If the next send time is within the alarm granularity, send immediately.
- if (ideal_next_packet_send_time_ > now.Add(alarm_granularity_)) {
+ if (ideal_next_packet_send_time_ > now + alarm_granularity_) {
DVLOG(1) << "Delaying packet: "
- << ideal_next_packet_send_time_.Subtract(now).ToMicroseconds();
+ << (ideal_next_packet_send_time_ - now).ToMicroseconds();
was_last_send_delayed_ = true;
- return ideal_next_packet_send_time_.Subtract(now);
+ return ideal_next_packet_send_time_ - now;
}
DVLOG(1) << "Sending packet now";
« 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