| 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_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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 largest_sent_packet_number_ = packet_number; | 224 largest_sent_packet_number_ = packet_number; |
| 225 hybrid_slow_start_.OnPacketSent(packet_number); | 225 hybrid_slow_start_.OnPacketSent(packet_number); |
| 226 return true; | 226 return true; |
| 227 } | 227 } |
| 228 | 228 |
| 229 QuicTime::Delta TcpCubicSender::TimeUntilSend( | 229 QuicTime::Delta TcpCubicSender::TimeUntilSend( |
| 230 QuicTime /* now */, | 230 QuicTime /* now */, |
| 231 QuicByteCount bytes_in_flight, | 231 QuicByteCount bytes_in_flight, |
| 232 HasRetransmittableData has_retransmittable_data) const { | 232 HasRetransmittableData has_retransmittable_data) const { |
| 233 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { | 233 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { |
| 234 DCHECK(!FLAGS_quic_respect_send_alarm2); |
| 234 // For TCP we can always send an ACK immediately. | 235 // For TCP we can always send an ACK immediately. |
| 235 return QuicTime::Delta::Zero(); | 236 return QuicTime::Delta::Zero(); |
| 236 } | 237 } |
| 237 if (InRecovery()) { | 238 if (InRecovery()) { |
| 238 // PRR is used when in recovery. | 239 // PRR is used when in recovery. |
| 239 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, | 240 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, |
| 240 slowstart_threshold_ * kDefaultTCPMSS); | 241 slowstart_threshold_ * kDefaultTCPMSS); |
| 241 } | 242 } |
| 242 if (GetCongestionWindow() > bytes_in_flight) { | 243 if (GetCongestionWindow() > bytes_in_flight) { |
| 243 return QuicTime::Delta::Zero(); | 244 return QuicTime::Delta::Zero(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 375 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
| 375 last_cutback_exited_slowstart_ = false; | 376 last_cutback_exited_slowstart_ = false; |
| 376 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_; | 377 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_; |
| 377 } | 378 } |
| 378 | 379 |
| 379 CongestionControlType TcpCubicSender::GetCongestionControlType() const { | 380 CongestionControlType TcpCubicSender::GetCongestionControlType() const { |
| 380 return reno_ ? kReno : kCubic; | 381 return reno_ ? kReno : kCubic; |
| 381 } | 382 } |
| 382 | 383 |
| 383 } // namespace net | 384 } // namespace net |
| OLD | NEW |