| 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 has_valid_rtt_(false) { | 19 has_valid_rtt_(false) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 PacingSender::~PacingSender() {} | 22 PacingSender::~PacingSender() {} |
| 23 | 23 |
| 24 void PacingSender::SetFromConfig(const QuicConfig& config, bool is_server) { | 24 void PacingSender::SetFromConfig(const QuicConfig& config, bool is_server) { |
| 25 // TODO(ianswett): Consider using the suggested RTT for pacing an initial | 25 // TODO(ianswett): Consider using the suggested RTT for pacing an initial |
| 26 // response. | 26 // response. |
| 27 sender_->SetFromConfig(config, is_server); | 27 sender_->SetFromConfig(config, is_server); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void PacingSender::SetNumEmulatedConnections(int num_connections) { |
| 31 sender_->SetNumEmulatedConnections(num_connections); |
| 32 } |
| 33 |
| 30 void PacingSender::OnIncomingQuicCongestionFeedbackFrame( | 34 void PacingSender::OnIncomingQuicCongestionFeedbackFrame( |
| 31 const QuicCongestionFeedbackFrame& feedback, | 35 const QuicCongestionFeedbackFrame& feedback, |
| 32 QuicTime feedback_receive_time) { | 36 QuicTime feedback_receive_time) { |
| 33 sender_->OnIncomingQuicCongestionFeedbackFrame( | 37 sender_->OnIncomingQuicCongestionFeedbackFrame( |
| 34 feedback, feedback_receive_time); | 38 feedback, feedback_receive_time); |
| 35 } | 39 } |
| 36 | 40 |
| 37 void PacingSender::OnCongestionEvent(bool rtt_updated, | 41 void PacingSender::OnCongestionEvent(bool rtt_updated, |
| 38 QuicByteCount bytes_in_flight, | 42 QuicByteCount bytes_in_flight, |
| 39 const CongestionVector& acked_packets, | 43 const CongestionVector& acked_packets, |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 180 |
| 177 QuicByteCount PacingSender::GetSlowStartThreshold() const { | 181 QuicByteCount PacingSender::GetSlowStartThreshold() const { |
| 178 return sender_->GetSlowStartThreshold(); | 182 return sender_->GetSlowStartThreshold(); |
| 179 } | 183 } |
| 180 | 184 |
| 181 CongestionControlType PacingSender::GetCongestionControlType() const { | 185 CongestionControlType PacingSender::GetCongestionControlType() const { |
| 182 return sender_->GetCongestionControlType(); | 186 return sender_->GetCongestionControlType(); |
| 183 } | 187 } |
| 184 | 188 |
| 185 } // namespace net | 189 } // namespace net |
| OLD | NEW |