| 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_packets.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender_packets.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "net/quic/congestion_control/prr_sender.h" | 10 #include "net/quic/congestion_control/prr_sender.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 ++stats_->slowstart_packets_lost; | 118 ++stats_->slowstart_packets_lost; |
| 119 } | 119 } |
| 120 | 120 |
| 121 if (!no_prr_) { | 121 if (!no_prr_) { |
| 122 prr_.OnPacketLost(bytes_in_flight); | 122 prr_.OnPacketLost(bytes_in_flight); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // TODO(jri): Separate out all of slow start into a separate class. | 125 // TODO(jri): Separate out all of slow start into a separate class. |
| 126 if (slow_start_large_reduction_ && InSlowStart()) { | 126 if (slow_start_large_reduction_ && InSlowStart()) { |
| 127 DCHECK_LT(1u, congestion_window_); | 127 DCHECK_LT(1u, congestion_window_); |
| 128 if (FLAGS_quic_sslr_limit_reduction && | 128 if (congestion_window_ >= 2 * initial_tcp_congestion_window_) { |
| 129 congestion_window_ >= 2 * initial_tcp_congestion_window_) { | |
| 130 min_slow_start_exit_window_ = congestion_window_ / 2; | 129 min_slow_start_exit_window_ = congestion_window_ / 2; |
| 131 } | 130 } |
| 132 congestion_window_ = congestion_window_ - 1; | 131 congestion_window_ = congestion_window_ - 1; |
| 133 } else if (reno_) { | 132 } else if (reno_) { |
| 134 congestion_window_ = congestion_window_ * RenoBeta(); | 133 congestion_window_ = congestion_window_ * RenoBeta(); |
| 135 } else { | 134 } else { |
| 136 congestion_window_ = | 135 congestion_window_ = |
| 137 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); | 136 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); |
| 138 } | 137 } |
| 139 // Enforce a minimum congestion window. | 138 // Enforce a minimum congestion window. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 congestion_window_ = initial_tcp_congestion_window_; | 215 congestion_window_ = initial_tcp_congestion_window_; |
| 217 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 216 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
| 218 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_; | 217 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_; |
| 219 } | 218 } |
| 220 | 219 |
| 221 CongestionControlType TcpCubicSenderPackets::GetCongestionControlType() const { | 220 CongestionControlType TcpCubicSenderPackets::GetCongestionControlType() const { |
| 222 return reno_ ? kReno : kCubic; | 221 return reno_ ? kReno : kCubic; |
| 223 } | 222 } |
| 224 | 223 |
| 225 } // namespace net | 224 } // namespace net |
| OLD | NEW |