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.h" | 9 #include "base/metrics/histogram.h" |
10 #include "net/quic/congestion_control/prr_sender.h" | 10 #include "net/quic/congestion_control/prr_sender.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 congestion_window_count_ = 0; | 198 congestion_window_count_ = 0; |
199 DVLOG(1) << "Incoming loss; congestion window: " << congestion_window_ | 199 DVLOG(1) << "Incoming loss; congestion window: " << congestion_window_ |
200 << " slowstart threshold: " << slowstart_threshold_; | 200 << " slowstart threshold: " << slowstart_threshold_; |
201 } | 201 } |
202 | 202 |
203 bool TcpCubicSender::OnPacketSent(QuicTime /*sent_time*/, | 203 bool TcpCubicSender::OnPacketSent(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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 hybrid_slow_start_.Restart(); | 364 hybrid_slow_start_.Restart(); |
361 slowstart_threshold_ = congestion_window_ / 2; | 365 slowstart_threshold_ = congestion_window_ / 2; |
362 congestion_window_ = min_congestion_window_; | 366 congestion_window_ = min_congestion_window_; |
363 } | 367 } |
364 | 368 |
365 CongestionControlType TcpCubicSender::GetCongestionControlType() const { | 369 CongestionControlType TcpCubicSender::GetCongestionControlType() const { |
366 return reno_ ? kReno : kCubic; | 370 return reno_ ? kReno : kCubic; |
367 } | 371 } |
368 | 372 |
369 } // namespace net | 373 } // namespace net |
OLD | NEW |