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

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender.cc

Issue 972033002: Change QUIC's PrrSender::TimeUntilSend to accept bytes instead of packets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Discard_acks_87419283
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « net/quic/congestion_control/prr_sender_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/congestion_control/tcp_cubic_sender.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "net/quic/congestion_control/prr_sender.h" 10 #include "net/quic/congestion_control/prr_sender.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 QuicTime /* now */, 208 QuicTime /* now */,
209 QuicByteCount bytes_in_flight, 209 QuicByteCount bytes_in_flight,
210 HasRetransmittableData has_retransmittable_data) const { 210 HasRetransmittableData has_retransmittable_data) const {
211 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { 211 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) {
212 // For TCP we can always send an ACK immediately. 212 // For TCP we can always send an ACK immediately.
213 return QuicTime::Delta::Zero(); 213 return QuicTime::Delta::Zero();
214 } 214 }
215 if (InRecovery()) { 215 if (InRecovery()) {
216 // PRR is used when in recovery. 216 // PRR is used when in recovery.
217 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, 217 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight,
218 slowstart_threshold_); 218 slowstart_threshold_ * kMaxSegmentSize);
219 } 219 }
220 if (GetCongestionWindow() > bytes_in_flight) { 220 if (GetCongestionWindow() > bytes_in_flight) {
221 return QuicTime::Delta::Zero(); 221 return QuicTime::Delta::Zero();
222 } 222 }
223 return QuicTime::Delta::Infinite(); 223 return QuicTime::Delta::Infinite();
224 } 224 }
225 225
226 QuicBandwidth TcpCubicSender::PacingRate() const { 226 QuicBandwidth TcpCubicSender::PacingRate() const {
227 // We pace at twice the rate of the underlying sender's bandwidth estimate 227 // We pace at twice the rate of the underlying sender's bandwidth estimate
228 // during slow start and 1.25x during congestion avoidance to ensure pacing 228 // during slow start and 1.25x during congestion avoidance to ensure pacing
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 hybrid_slow_start_.Restart(); 338 hybrid_slow_start_.Restart();
339 slowstart_threshold_ = congestion_window_ / 2; 339 slowstart_threshold_ = congestion_window_ / 2;
340 congestion_window_ = kMinimumCongestionWindow; 340 congestion_window_ = kMinimumCongestionWindow;
341 } 341 }
342 342
343 CongestionControlType TcpCubicSender::GetCongestionControlType() const { 343 CongestionControlType TcpCubicSender::GetCongestionControlType() const {
344 return reno_ ? kReno : kCubic; 344 return reno_ ? kReno : kCubic;
345 } 345 }
346 346
347 } // namespace net 347 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/prr_sender_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698