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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 DVLOG(1) << "Incoming loss; congestion window: " << congestion_window_ | 198 DVLOG(1) << "Incoming loss; congestion window: " << congestion_window_ |
199 << " slowstart threshold: " << slowstart_threshold_; | 199 << " slowstart threshold: " << slowstart_threshold_; |
200 } | 200 } |
201 | 201 |
202 bool TcpCubicBytesSender::OnPacketSent( | 202 bool TcpCubicBytesSender::OnPacketSent( |
203 QuicTime /*sent_time*/, | 203 QuicTime /*sent_time*/, |
204 QuicByteCount /*bytes_in_flight*/, | 204 QuicByteCount /*bytes_in_flight*/, |
205 QuicPacketSequenceNumber sequence_number, | 205 QuicPacketSequenceNumber sequence_number, |
206 QuicByteCount bytes, | 206 QuicByteCount bytes, |
207 HasRetransmittableData is_retransmittable) { | 207 HasRetransmittableData is_retransmittable) { |
| 208 if (InSlowStart()) { |
| 209 ++(stats_->slowstart_packets_sent); |
| 210 } |
| 211 |
208 // Only update bytes_in_flight_ for data packets. | 212 // Only update bytes_in_flight_ for data packets. |
209 if (is_retransmittable != HAS_RETRANSMITTABLE_DATA) { | 213 if (is_retransmittable != HAS_RETRANSMITTABLE_DATA) { |
210 return false; | 214 return false; |
211 } | 215 } |
212 if (InRecovery()) { | 216 if (InRecovery()) { |
213 // PRR is used when in recovery. | 217 // PRR is used when in recovery. |
214 prr_.OnPacketSent(bytes); | 218 prr_.OnPacketSent(bytes); |
215 } | 219 } |
216 DCHECK_LT(largest_sent_sequence_number_, sequence_number); | 220 DCHECK_LT(largest_sent_sequence_number_, sequence_number); |
217 largest_sent_sequence_number_ = sequence_number; | 221 largest_sent_sequence_number_ = sequence_number; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 hybrid_slow_start_.Restart(); | 359 hybrid_slow_start_.Restart(); |
356 slowstart_threshold_ = congestion_window_ / 2; | 360 slowstart_threshold_ = congestion_window_ / 2; |
357 congestion_window_ = min_congestion_window_; | 361 congestion_window_ = min_congestion_window_; |
358 } | 362 } |
359 | 363 |
360 CongestionControlType TcpCubicBytesSender::GetCongestionControlType() const { | 364 CongestionControlType TcpCubicBytesSender::GetCongestionControlType() const { |
361 return reno_ ? kRenoBytes : kCubicBytes; | 365 return reno_ ? kRenoBytes : kCubicBytes; |
362 } | 366 } |
363 | 367 |
364 } // namespace net | 368 } // namespace net |
OLD | NEW |