| 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_bytes_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_bytes_sender.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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 ++stats_->tcp_loss_events; | 177 ++stats_->tcp_loss_events; |
| 178 last_cutback_exited_slowstart_ = InSlowStart(); | 178 last_cutback_exited_slowstart_ = InSlowStart(); |
| 179 if (InSlowStart()) { | 179 if (InSlowStart()) { |
| 180 ++stats_->slowstart_packets_lost; | 180 ++stats_->slowstart_packets_lost; |
| 181 } | 181 } |
| 182 | 182 |
| 183 prr_.OnPacketLost(bytes_in_flight); | 183 prr_.OnPacketLost(bytes_in_flight); |
| 184 | 184 |
| 185 // TODO(jri): Separate out all of slow start into a separate class. | 185 // TODO(jri): Separate out all of slow start into a separate class. |
| 186 if (slow_start_large_reduction_) { | 186 if (slow_start_large_reduction_ && InSlowStart()) { |
| 187 DCHECK_LT(kDefaultTCPMSS, congestion_window_); | 187 DCHECK_LT(kDefaultTCPMSS, congestion_window_); |
| 188 congestion_window_ = congestion_window_ - kDefaultTCPMSS; | 188 congestion_window_ = congestion_window_ - kDefaultTCPMSS; |
| 189 } else if (reno_) { | 189 } else if (reno_) { |
| 190 congestion_window_ = congestion_window_ * RenoBeta(); | 190 congestion_window_ = congestion_window_ * RenoBeta(); |
| 191 } else { | 191 } else { |
| 192 congestion_window_ = | 192 congestion_window_ = |
| 193 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); | 193 cubic_.CongestionWindowAfterPacketLoss(congestion_window_); |
| 194 } | 194 } |
| 195 // Enforce TCP's minimum congestion window of 2*MSS. | 195 // Enforce TCP's minimum congestion window of 2*MSS. |
| 196 if (congestion_window_ < min_congestion_window_) { | 196 if (congestion_window_ < min_congestion_window_) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 largest_sent_packet_number_ = 0; | 380 largest_sent_packet_number_ = 0; |
| 381 largest_acked_packet_number_ = 0; | 381 largest_acked_packet_number_ = 0; |
| 382 largest_sent_at_last_cutback_ = 0; | 382 largest_sent_at_last_cutback_ = 0; |
| 383 congestion_window_ = initial_tcp_congestion_window_; | 383 congestion_window_ = initial_tcp_congestion_window_; |
| 384 max_congestion_window_ = initial_max_tcp_congestion_window_; | 384 max_congestion_window_ = initial_max_tcp_congestion_window_; |
| 385 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 385 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
| 386 last_cutback_exited_slowstart_ = false; | 386 last_cutback_exited_slowstart_ = false; |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace net | 389 } // namespace net |
| OLD | NEW |