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/congestion_control/pacing_sender.h" | 5 #include "net/quic/congestion_control/pacing_sender.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 PacingSender::PacingSender(SendAlgorithmInterface* sender, | 9 PacingSender::PacingSender(SendAlgorithmInterface* sender, |
10 QuicTime::Delta alarm_granularity, | 10 QuicTime::Delta alarm_granularity, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ideal_next_packet_send_time_ = QuicTime::Max( | 94 ideal_next_packet_send_time_ = QuicTime::Max( |
95 ideal_next_packet_send_time_.Add(delay), sent_time.Add(delay)); | 95 ideal_next_packet_send_time_.Add(delay), sent_time.Add(delay)); |
96 } | 96 } |
97 return in_flight; | 97 return in_flight; |
98 } | 98 } |
99 | 99 |
100 void PacingSender::OnRetransmissionTimeout(bool packets_retransmitted) { | 100 void PacingSender::OnRetransmissionTimeout(bool packets_retransmitted) { |
101 sender_->OnRetransmissionTimeout(packets_retransmitted); | 101 sender_->OnRetransmissionTimeout(packets_retransmitted); |
102 } | 102 } |
103 | 103 |
104 void PacingSender::RevertRetransmissionTimeout() { | |
105 sender_->RevertRetransmissionTimeout(); | |
106 } | |
107 | |
108 QuicTime::Delta PacingSender::TimeUntilSend( | 104 QuicTime::Delta PacingSender::TimeUntilSend( |
109 QuicTime now, | 105 QuicTime now, |
110 QuicByteCount bytes_in_flight, | 106 QuicByteCount bytes_in_flight, |
111 HasRetransmittableData has_retransmittable_data) const { | 107 HasRetransmittableData has_retransmittable_data) const { |
112 QuicTime::Delta time_until_send = | 108 QuicTime::Delta time_until_send = |
113 sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data); | 109 sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data); |
114 if (burst_tokens_ > 0 || bytes_in_flight == 0) { | 110 if (burst_tokens_ > 0 || bytes_in_flight == 0) { |
115 // Don't pace if we have burst tokens available or leaving quiescence. | 111 // Don't pace if we have burst tokens available or leaving quiescence. |
116 return time_until_send; | 112 return time_until_send; |
117 } | 113 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 166 |
171 QuicByteCount PacingSender::GetSlowStartThreshold() const { | 167 QuicByteCount PacingSender::GetSlowStartThreshold() const { |
172 return sender_->GetSlowStartThreshold(); | 168 return sender_->GetSlowStartThreshold(); |
173 } | 169 } |
174 | 170 |
175 CongestionControlType PacingSender::GetCongestionControlType() const { | 171 CongestionControlType PacingSender::GetCongestionControlType() const { |
176 return sender_->GetCongestionControlType(); | 172 return sender_->GetCongestionControlType(); |
177 } | 173 } |
178 | 174 |
179 } // namespace net | 175 } // namespace net |
OLD | NEW |