OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |