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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 prr_.OnPacketSent(bytes); | 168 prr_.OnPacketSent(bytes); |
169 } | 169 } |
170 DCHECK_LT(largest_sent_packet_number_, packet_number); | 170 DCHECK_LT(largest_sent_packet_number_, packet_number); |
171 largest_sent_packet_number_ = packet_number; | 171 largest_sent_packet_number_ = packet_number; |
172 hybrid_slow_start_.OnPacketSent(packet_number); | 172 hybrid_slow_start_.OnPacketSent(packet_number); |
173 return true; | 173 return true; |
174 } | 174 } |
175 | 175 |
176 QuicTime::Delta TcpCubicSenderBase::TimeUntilSend( | 176 QuicTime::Delta TcpCubicSenderBase::TimeUntilSend( |
177 QuicTime /* now */, | 177 QuicTime /* now */, |
178 QuicByteCount bytes_in_flight, | 178 QuicByteCount bytes_in_flight) const { |
179 HasRetransmittableData has_retransmittable_data) const { | |
180 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) { | |
181 QUIC_BUG << "TimeUntilSend's has_retransmittable_data argument deprecated."; | |
182 // For TCP we can always send an ACK immediately. | |
183 return QuicTime::Delta::Zero(); | |
184 } | |
185 if (InRecovery()) { | 179 if (InRecovery()) { |
186 // PRR is used when in recovery. | 180 // PRR is used when in recovery. |
187 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, | 181 return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight, |
188 GetSlowStartThreshold()); | 182 GetSlowStartThreshold()); |
189 } | 183 } |
190 if (GetCongestionWindow() > bytes_in_flight) { | 184 if (GetCongestionWindow() > bytes_in_flight) { |
191 return QuicTime::Delta::Zero(); | 185 return QuicTime::Delta::Zero(); |
192 } | 186 } |
193 if (min4_mode_ && bytes_in_flight < 4 * kDefaultTCPMSS) { | 187 if (min4_mode_ && bytes_in_flight < 4 * kDefaultTCPMSS) { |
194 return QuicTime::Delta::Zero(); | 188 return QuicTime::Delta::Zero(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 void TcpCubicSenderBase::OnConnectionMigration() { | 252 void TcpCubicSenderBase::OnConnectionMigration() { |
259 hybrid_slow_start_.Restart(); | 253 hybrid_slow_start_.Restart(); |
260 prr_ = PrrSender(); | 254 prr_ = PrrSender(); |
261 largest_sent_packet_number_ = 0; | 255 largest_sent_packet_number_ = 0; |
262 largest_acked_packet_number_ = 0; | 256 largest_acked_packet_number_ = 0; |
263 largest_sent_at_last_cutback_ = 0; | 257 largest_sent_at_last_cutback_ = 0; |
264 last_cutback_exited_slowstart_ = false; | 258 last_cutback_exited_slowstart_ = false; |
265 } | 259 } |
266 | 260 |
267 } // namespace net | 261 } // namespace net |
OLD | NEW |