| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/core/congestion_control/pacing_sender.h" | 5 #include "net/quic/core/congestion_control/pacing_sender.h" |
| 6 | 6 |
| 7 #include <string> | |
| 8 | |
| 9 #include "net/quic/core/quic_flags.h" | |
| 10 | |
| 11 | |
| 12 namespace net { | 7 namespace net { |
| 13 namespace { | 8 namespace { |
| 14 | 9 |
| 15 // The estimated system alarm granularity. | 10 // The estimated system alarm granularity. |
| 16 static const QuicTime::Delta kAlarmGranularity = | 11 static const QuicTime::Delta kAlarmGranularity = |
| 17 QuicTime::Delta::FromMilliseconds(1); | 12 QuicTime::Delta::FromMilliseconds(1); |
| 18 | 13 |
| 19 // Configured maximum size of the burst coming out of quiescence. The burst | 14 // Configured maximum size of the burst coming out of quiescence. The burst |
| 20 // is never larger than the current CWND in packets. | 15 // is never larger than the current CWND in packets. |
| 21 static const uint32_t kInitialUnpacedBurst = 10; | 16 static const uint32_t kInitialUnpacedBurst = 10; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 DCHECK(sender_ != nullptr); | 140 DCHECK(sender_ != nullptr); |
| 146 if (!max_pacing_rate_.IsZero()) { | 141 if (!max_pacing_rate_.IsZero()) { |
| 147 return QuicBandwidth::FromBitsPerSecond( | 142 return QuicBandwidth::FromBitsPerSecond( |
| 148 std::min(max_pacing_rate_.ToBitsPerSecond(), | 143 std::min(max_pacing_rate_.ToBitsPerSecond(), |
| 149 sender_->PacingRate(bytes_in_flight).ToBitsPerSecond())); | 144 sender_->PacingRate(bytes_in_flight).ToBitsPerSecond())); |
| 150 } | 145 } |
| 151 return sender_->PacingRate(bytes_in_flight); | 146 return sender_->PacingRate(bytes_in_flight); |
| 152 } | 147 } |
| 153 | 148 |
| 154 } // namespace net | 149 } // namespace net |
| OLD | NEW |