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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 ++stats_->slowstart_packets_lost; | 116 ++stats_->slowstart_packets_lost; |
117 } | 117 } |
118 | 118 |
119 if (!no_prr_) { | 119 if (!no_prr_) { |
120 prr_.OnPacketLost(bytes_in_flight); | 120 prr_.OnPacketLost(bytes_in_flight); |
121 } | 121 } |
122 | 122 |
123 // TODO(jri): Separate out all of slow start into a separate class. | 123 // TODO(jri): Separate out all of slow start into a separate class. |
124 if (slow_start_large_reduction_ && InSlowStart()) { | 124 if (slow_start_large_reduction_ && InSlowStart()) { |
125 DCHECK_LT(kDefaultTCPMSS, congestion_window_); | 125 DCHECK_LT(kDefaultTCPMSS, congestion_window_); |
126 if (FLAGS_quic_sslr_limit_reduction && | 126 if (congestion_window_ >= 2 * initial_tcp_congestion_window_) { |
127 congestion_window_ >= 2 * initial_tcp_congestion_window_) { | |
128 min_slow_start_exit_window_ = congestion_window_ / 2; | 127 min_slow_start_exit_window_ = congestion_window_ / 2; |
129 } | 128 } |
130 congestion_window_ = congestion_window_ - kDefaultTCPMSS; | 129 congestion_window_ = congestion_window_ - kDefaultTCPMSS; |
131 } else if (reno_) { | 130 } else if (reno_) { |
132 congestion_window_ = congestion_window_ * RenoBeta(); | 131 congestion_window_ = congestion_window_ * RenoBeta(); |
133 } else { | 132 } else { |
134 congestion_window_ = | 133 congestion_window_ = |
135 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); | 134 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); |
136 } | 135 } |
137 if (congestion_window_ < min_congestion_window_) { | 136 if (congestion_window_ < min_congestion_window_) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 congestion_window_ = initial_tcp_congestion_window_; | 214 congestion_window_ = initial_tcp_congestion_window_; |
216 max_congestion_window_ = initial_max_tcp_congestion_window_; | 215 max_congestion_window_ = initial_max_tcp_congestion_window_; |
217 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 216 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
218 } | 217 } |
219 | 218 |
220 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { | 219 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { |
221 return reno_ ? kRenoBytes : kCubicBytes; | 220 return reno_ ? kRenoBytes : kCubicBytes; |
222 } | 221 } |
223 | 222 |
224 } // namespace net | 223 } // namespace net |
OLD | NEW |