| 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, |
| 11 uint32 initial_packet_burst) | 11 uint32 initial_packet_burst) |
| 12 : sender_(sender), | 12 : sender_(sender), |
| 13 alarm_granularity_(alarm_granularity), | 13 alarm_granularity_(alarm_granularity), |
| 14 initial_packet_burst_(initial_packet_burst), | 14 initial_packet_burst_(initial_packet_burst), |
| 15 burst_tokens_(initial_packet_burst), | 15 burst_tokens_(initial_packet_burst), |
| 16 last_delayed_packet_sent_time_(QuicTime::Zero()), | 16 last_delayed_packet_sent_time_(QuicTime::Zero()), |
| 17 next_packet_send_time_(QuicTime::Zero()), | 17 next_packet_send_time_(QuicTime::Zero()), |
| 18 was_last_send_delayed_(false) { | 18 was_last_send_delayed_(false) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 PacingSender::~PacingSender() {} | 21 PacingSender::~PacingSender() {} |
| 22 | 22 |
| 23 void PacingSender::SetFromConfig(const QuicConfig& config, | 23 void PacingSender::SetFromConfig(const QuicConfig& config, |
| 24 bool is_server, | 24 bool is_server, |
| 25 bool using_pacing) { | 25 bool using_pacing) { |
| 26 DCHECK(using_pacing); | 26 DCHECK(using_pacing); |
| 27 sender_->SetFromConfig(config, is_server, using_pacing); | 27 sender_->SetFromConfig(config, is_server, using_pacing); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void PacingSender::ResumeConnectionState( |
| 31 const CachedNetworkParameters& cached_network_params) { |
| 32 sender_->ResumeConnectionState(cached_network_params); |
| 33 } |
| 34 |
| 30 void PacingSender::SetNumEmulatedConnections(int num_connections) { | 35 void PacingSender::SetNumEmulatedConnections(int num_connections) { |
| 31 sender_->SetNumEmulatedConnections(num_connections); | 36 sender_->SetNumEmulatedConnections(num_connections); |
| 32 } | 37 } |
| 33 | 38 |
| 34 void PacingSender::OnCongestionEvent(bool rtt_updated, | 39 void PacingSender::OnCongestionEvent(bool rtt_updated, |
| 35 QuicByteCount bytes_in_flight, | 40 QuicByteCount bytes_in_flight, |
| 36 const CongestionVector& acked_packets, | 41 const CongestionVector& acked_packets, |
| 37 const CongestionVector& lost_packets) { | 42 const CongestionVector& lost_packets) { |
| 38 sender_->OnCongestionEvent( | 43 sender_->OnCongestionEvent( |
| 39 rtt_updated, bytes_in_flight, acked_packets, lost_packets); | 44 rtt_updated, bytes_in_flight, acked_packets, lost_packets); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 172 |
| 168 QuicByteCount PacingSender::GetSlowStartThreshold() const { | 173 QuicByteCount PacingSender::GetSlowStartThreshold() const { |
| 169 return sender_->GetSlowStartThreshold(); | 174 return sender_->GetSlowStartThreshold(); |
| 170 } | 175 } |
| 171 | 176 |
| 172 CongestionControlType PacingSender::GetCongestionControlType() const { | 177 CongestionControlType PacingSender::GetCongestionControlType() const { |
| 173 return sender_->GetCongestionControlType(); | 178 return sender_->GetCongestionControlType(); |
| 174 } | 179 } |
| 175 | 180 |
| 176 } // namespace net | 181 } // namespace net |
| OLD | NEW |