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 16 matching lines...) Expand all Loading... |
27 const int kInitialRttMs = 100; // At a typical RTT 100 ms. | 27 const int kInitialRttMs = 100; // At a typical RTT 100 ms. |
28 const float kAlpha = 0.125f; | 28 const float kAlpha = 0.125f; |
29 const float kOneMinusAlpha = (1 - kAlpha); | 29 const float kOneMinusAlpha = (1 - kAlpha); |
30 const float kBeta = 0.25f; | 30 const float kBeta = 0.25f; |
31 const float kOneMinusBeta = (1 - kBeta); | 31 const float kOneMinusBeta = (1 - kBeta); |
32 }; // namespace | 32 }; // namespace |
33 | 33 |
34 TcpCubicSender::TcpCubicSender( | 34 TcpCubicSender::TcpCubicSender( |
35 const QuicClock* clock, | 35 const QuicClock* clock, |
36 bool reno, | 36 bool reno, |
37 QuicTcpCongestionWindow max_tcp_congestion_window) | 37 QuicTcpCongestionWindow max_tcp_congestion_window, |
| 38 QuicConnectionStats* stats) |
38 : hybrid_slow_start_(clock), | 39 : hybrid_slow_start_(clock), |
39 cubic_(clock), | 40 cubic_(clock, stats), |
40 reno_(reno), | 41 reno_(reno), |
41 congestion_window_count_(0), | 42 congestion_window_count_(0), |
42 receive_window_(kDefaultReceiveWindow), | 43 receive_window_(kDefaultReceiveWindow), |
43 bytes_in_flight_(0), | 44 bytes_in_flight_(0), |
44 prr_out_(0), | 45 prr_out_(0), |
45 prr_delivered_(0), | 46 prr_delivered_(0), |
46 ack_count_since_loss_(0), | 47 ack_count_since_loss_(0), |
47 bytes_in_flight_before_loss_(0), | 48 bytes_in_flight_before_loss_(0), |
48 update_end_sequence_number_(true), | 49 update_end_sequence_number_(true), |
49 end_sequence_number_(0), | 50 end_sequence_number_(0), |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 hybrid_slow_start_.Reset(end_sequence_number_); | 363 hybrid_slow_start_.Reset(end_sequence_number_); |
363 } | 364 } |
364 hybrid_slow_start_.Update(rtt, delay_min_); | 365 hybrid_slow_start_.Update(rtt, delay_min_); |
365 if (hybrid_slow_start_.Exit()) { | 366 if (hybrid_slow_start_.Exit()) { |
366 slowstart_threshold_ = congestion_window_; | 367 slowstart_threshold_ = congestion_window_; |
367 } | 368 } |
368 } | 369 } |
369 } | 370 } |
370 | 371 |
371 } // namespace net | 372 } // namespace net |
OLD | NEW |