| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 largest_sent_packet_number_ = packet_number; | 211 largest_sent_packet_number_ = packet_number; |
| 212 hybrid_slow_start_.OnPacketSent(packet_number); | 212 hybrid_slow_start_.OnPacketSent(packet_number); |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 QuicTime::Delta TcpCubicBytesSender::TimeUntilSend( | 216 QuicTime::Delta TcpCubicBytesSender::TimeUntilSend( |
| 217 QuicTime /* now */, | 217 QuicTime /* now */, |
| 218 QuicByteCount bytes_in_flight, | 218 QuicByteCount bytes_in_flight, |
| 219 HasRetransmittableData has_retransmittable_data) const { | 219 HasRetransmittableData has_retransmittable_data) const { |
| 220 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { | 220 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { |
| 221 DCHECK(!FLAGS_quic_respect_send_alarm2); |
| 221 // For TCP we can always send an ACK immediately. | 222 // For TCP we can always send an ACK immediately. |
| 222 return QuicTime::Delta::Zero(); | 223 return QuicTime::Delta::Zero(); |
| 223 } | 224 } |
| 224 if (InRecovery()) { | 225 if (InRecovery()) { |
| 225 // PRR is used when in recovery. | 226 // PRR is used when in recovery. |
| 226 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, | 227 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, |
| 227 slowstart_threshold_); | 228 slowstart_threshold_); |
| 228 } | 229 } |
| 229 if (GetCongestionWindow() > bytes_in_flight) { | 230 if (GetCongestionWindow() > bytes_in_flight) { |
| 230 return QuicTime::Delta::Zero(); | 231 return QuicTime::Delta::Zero(); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 largest_sent_packet_number_ = 0; | 364 largest_sent_packet_number_ = 0; |
| 364 largest_acked_packet_number_ = 0; | 365 largest_acked_packet_number_ = 0; |
| 365 largest_sent_at_last_cutback_ = 0; | 366 largest_sent_at_last_cutback_ = 0; |
| 366 congestion_window_ = initial_tcp_congestion_window_; | 367 congestion_window_ = initial_tcp_congestion_window_; |
| 367 max_congestion_window_ = initial_max_tcp_congestion_window_; | 368 max_congestion_window_ = initial_max_tcp_congestion_window_; |
| 368 slowstart_threshold_ = initial_max_tcp_congestion_window_; | 369 slowstart_threshold_ = initial_max_tcp_congestion_window_; |
| 369 last_cutback_exited_slowstart_ = false; | 370 last_cutback_exited_slowstart_ = false; |
| 370 } | 371 } |
| 371 | 372 |
| 372 } // namespace net | 373 } // namespace net |
| OLD | NEW |