| 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 // A send algorithm which adds pacing on top of an another send algorithm. | 5 // A send algorithm that adds pacing on top of an another send algorithm. |
| 6 // It uses the underlying sender's bandwidth estimate to determine the | 6 // It uses the underlying sender's pacing rate to schedule packets. |
| 7 // pacing rate to be used. It also takes into consideration the expected | 7 // It also takes into consideration the expected granularity of the underlying |
| 8 // resolution of the underlying alarm mechanism to ensure that alarms are | 8 // alarm to ensure that alarms are not set too aggressively, and err towards |
| 9 // not set too aggressively, and to smooth out variations. | 9 // sending packets too early instead of too late. |
| 10 | 10 |
| 11 #ifndef NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ | 11 #ifndef NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ |
| 12 #define NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ | 12 #define NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "net/quic/congestion_control/send_algorithm_interface.h" | 18 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 19 #include "net/quic/crypto/cached_network_parameters.h" | 19 #include "net/quic/crypto/cached_network_parameters.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 QuicTime::Delta RetransmissionDelay() const override; | 63 QuicTime::Delta RetransmissionDelay() const override; |
| 64 QuicByteCount GetCongestionWindow() const override; | 64 QuicByteCount GetCongestionWindow() const override; |
| 65 bool InSlowStart() const override; | 65 bool InSlowStart() const override; |
| 66 bool InRecovery() const override; | 66 bool InRecovery() const override; |
| 67 QuicByteCount GetSlowStartThreshold() const override; | 67 QuicByteCount GetSlowStartThreshold() const override; |
| 68 CongestionControlType GetCongestionControlType() const override; | 68 CongestionControlType GetCongestionControlType() const override; |
| 69 // End implementation of SendAlgorithmInterface. | 69 // End implementation of SendAlgorithmInterface. |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender. | 72 scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender. |
| 73 QuicTime::Delta alarm_granularity_; | 73 // The estimated system alarm granularity. |
| 74 uint32 initial_packet_burst_; | 74 const QuicTime::Delta alarm_granularity_; |
| 75 mutable uint32 burst_tokens_; | 75 // Configured size of the burst coming out of quiescence. |
| 76 const uint32 initial_packet_burst_; |
| 77 // Number of unpaced packets to be sent before packets are delayed. |
| 78 uint32 burst_tokens_; |
| 76 // Send time of the last packet considered delayed. | 79 // Send time of the last packet considered delayed. |
| 77 QuicTime last_delayed_packet_sent_time_; | 80 QuicTime last_delayed_packet_sent_time_; |
| 78 QuicTime next_packet_send_time_; // When can the next packet be sent. | 81 QuicTime ideal_next_packet_send_time_; // When can the next packet be sent. |
| 79 mutable bool was_last_send_delayed_; // True when the last send was delayed. | 82 mutable bool was_last_send_delayed_; // True when the last send was delayed. |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(PacingSender); | 84 DISALLOW_COPY_AND_ASSIGN(PacingSender); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 } // namespace net | 87 } // namespace net |
| 85 | 88 |
| 86 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ | 89 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ |
| OLD | NEW |