OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_bytes.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "net/quic/congestion_control/prr_sender.h" | 9 #include "net/quic/congestion_control/prr_sender.h" |
10 #include "net/quic/congestion_control/rtt_stats.h" | 10 #include "net/quic/congestion_control/rtt_stats.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 TcpCubicSenderBytes::~TcpCubicSenderBytes() {} | 48 TcpCubicSenderBytes::~TcpCubicSenderBytes() {} |
49 | 49 |
50 void TcpCubicSenderBytes::SetCongestionWindowFromBandwidthAndRtt( | 50 void TcpCubicSenderBytes::SetCongestionWindowFromBandwidthAndRtt( |
51 QuicBandwidth bandwidth, | 51 QuicBandwidth bandwidth, |
52 QuicTime::Delta rtt) { | 52 QuicTime::Delta rtt) { |
53 QuicByteCount new_congestion_window = bandwidth.ToBytesPerPeriod(rtt); | 53 QuicByteCount new_congestion_window = bandwidth.ToBytesPerPeriod(rtt); |
54 if (FLAGS_quic_no_lower_bw_resumption_limit) { | 54 if (FLAGS_quic_no_lower_bw_resumption_limit) { |
55 // Limit new CWND if needed. | 55 // Limit new CWND if needed. |
56 congestion_window_ = | 56 congestion_window_ = |
57 max(min_congestion_window_, | 57 max(min_congestion_window_, |
58 min(new_congestion_window, kMaxCongestionWindow * kDefaultTCPMSS)); | 58 min(new_congestion_window, |
| 59 kMaxResumptionCongestionWindow * kDefaultTCPMSS)); |
59 } else { | 60 } else { |
60 congestion_window_ = | 61 congestion_window_ = |
61 max(min(new_congestion_window, kMaxCongestionWindow * kDefaultTCPMSS), | 62 max(min(new_congestion_window, |
| 63 kMaxResumptionCongestionWindow * kDefaultTCPMSS), |
62 kMinCongestionWindowForBandwidthResumption * kDefaultTCPMSS); | 64 kMinCongestionWindowForBandwidthResumption * kDefaultTCPMSS); |
63 } | 65 } |
64 } | 66 } |
65 | 67 |
66 void TcpCubicSenderBytes::SetCongestionWindowInPackets( | 68 void TcpCubicSenderBytes::SetCongestionWindowInPackets( |
67 QuicPacketCount congestion_window) { | 69 QuicPacketCount congestion_window) { |
68 congestion_window_ = congestion_window * kDefaultTCPMSS; | 70 congestion_window_ = congestion_window * kDefaultTCPMSS; |
69 } | 71 } |
70 | 72 |
71 void TcpCubicSenderBytes::SetMinCongestionWindowInPackets( | 73 void TcpCubicSenderBytes::SetMinCongestionWindowInPackets( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 congestion_window_ = initial_tcp_congestion_window_; | 212 congestion_window_ = initial_tcp_congestion_window_; |
211 max_congestion_window_ = initial_max_tcp_congestion_window_; | 213 max_congestion_window_ = initial_max_tcp_congestion_window_; |
212 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 214 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
213 } | 215 } |
214 | 216 |
215 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { | 217 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { |
216 return reno_ ? kRenoBytes : kCubicBytes; | 218 return reno_ ? kRenoBytes : kCubicBytes; |
217 } | 219 } |
218 | 220 |
219 } // namespace net | 221 } // namespace net |
OLD | NEW |