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

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

Issue 126513003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 10
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } else { 270 } else {
271 congestion_window_ = std::min( 271 congestion_window_ = std::min(
272 max_tcp_congestion_window_, 272 max_tcp_congestion_window_,
273 cubic_.CongestionWindowAfterAck(congestion_window_, delay_min_)); 273 cubic_.CongestionWindowAfterAck(congestion_window_, delay_min_));
274 DVLOG(1) << "Cubic; congestion window:" << congestion_window_; 274 DVLOG(1) << "Cubic; congestion window:" << congestion_window_;
275 } 275 }
276 } 276 }
277 } 277 }
278 } 278 }
279 279
280 void TcpCubicSender::OnRetransmissionTimeout() { 280 void TcpCubicSender::OnRetransmissionTimeout(bool packets_retransmitted) {
281 cubic_.Reset(); 281 bytes_in_flight_ = 0;
282 congestion_window_ = kMinimumCongestionWindow; 282 if (packets_retransmitted) {
283 cubic_.Reset();
284 congestion_window_ = kMinimumCongestionWindow;
285 }
283 } 286 }
284 287
285 void TcpCubicSender::AckAccounting(QuicTime::Delta rtt) { 288 void TcpCubicSender::AckAccounting(QuicTime::Delta rtt) {
286 if (rtt.IsInfinite() || rtt.IsZero()) { 289 if (rtt.IsInfinite() || rtt.IsZero()) {
287 DVLOG(1) << "Ignoring rtt, because it's " 290 DVLOG(1) << "Ignoring rtt, because it's "
288 << (rtt.IsZero() ? "Zero" : "Infinite"); 291 << (rtt.IsZero() ? "Zero" : "Infinite");
289 return; 292 return;
290 } 293 }
291 // RTT can't be negative. 294 // RTT can't be negative.
292 DCHECK_LT(0, rtt.ToMicroseconds()); 295 DCHECK_LT(0, rtt.ToMicroseconds());
(...skipping 29 matching lines...) Expand all
322 hybrid_slow_start_.Reset(end_sequence_number_); 325 hybrid_slow_start_.Reset(end_sequence_number_);
323 } 326 }
324 hybrid_slow_start_.Update(rtt, delay_min_); 327 hybrid_slow_start_.Update(rtt, delay_min_);
325 if (hybrid_slow_start_.Exit()) { 328 if (hybrid_slow_start_.Exit()) {
326 slowstart_threshold_ = congestion_window_; 329 slowstart_threshold_ = congestion_window_;
327 } 330 }
328 } 331 }
329 } 332 }
330 333
331 } // namespace net 334 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.h ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698