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 that 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 pacing rate to schedule packets. | 6 // It uses the underlying sender's pacing rate to schedule packets. |
7 // It also takes into consideration the expected granularity of the underlying | 7 // It also takes into consideration the expected granularity of the underlying |
8 // alarm to ensure that alarms are not set too aggressively, and err towards | 8 // alarm to ensure that alarms are not set too aggressively, and err towards |
9 // sending packets too early instead of too late. | 9 // sending packets too early instead of too late. |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 QuicByteCount bytes_in_flight) const override; | 60 QuicByteCount bytes_in_flight) const override; |
61 QuicBandwidth PacingRate(QuicByteCount bytes_in_flight) const override; | 61 QuicBandwidth PacingRate(QuicByteCount bytes_in_flight) const override; |
62 QuicBandwidth BandwidthEstimate() const override; | 62 QuicBandwidth BandwidthEstimate() const override; |
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 std::string GetDebugState() const override; | 69 std::string GetDebugState() const override; |
| 70 void OnApplicationLimited(QuicByteCount bytes_in_flight) override; |
70 // End implementation of SendAlgorithmInterface. | 71 // End implementation of SendAlgorithmInterface. |
71 | 72 |
72 private: | 73 private: |
73 std::unique_ptr<SendAlgorithmInterface> sender_; // Underlying sender. | 74 std::unique_ptr<SendAlgorithmInterface> sender_; // Underlying sender. |
74 // The estimated system alarm granularity. | 75 // The estimated system alarm granularity. |
75 const QuicTime::Delta alarm_granularity_; | 76 const QuicTime::Delta alarm_granularity_; |
76 // Configured maximum size of the burst coming out of quiescence. The burst | 77 // Configured maximum size of the burst coming out of quiescence. The burst |
77 // is never larger than the current CWND in packets. | 78 // is never larger than the current CWND in packets. |
78 const uint32_t initial_packet_burst_; | 79 const uint32_t initial_packet_burst_; |
79 // If not QuicBandidth::Zero, the maximum rate the PacingSender will use. | 80 // If not QuicBandidth::Zero, the maximum rate the PacingSender will use. |
80 QuicBandwidth max_pacing_rate_; | 81 QuicBandwidth max_pacing_rate_; |
81 | 82 |
82 // Number of unpaced packets to be sent before packets are delayed. | 83 // Number of unpaced packets to be sent before packets are delayed. |
83 uint32_t burst_tokens_; | 84 uint32_t burst_tokens_; |
84 // Send time of the last packet considered delayed. | 85 // Send time of the last packet considered delayed. |
85 QuicTime last_delayed_packet_sent_time_; | 86 QuicTime last_delayed_packet_sent_time_; |
86 QuicTime ideal_next_packet_send_time_; // When can the next packet be sent. | 87 QuicTime ideal_next_packet_send_time_; // When can the next packet be sent. |
87 mutable bool was_last_send_delayed_; // True when the last send was delayed. | 88 mutable bool was_last_send_delayed_; // True when the last send was delayed. |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(PacingSender); | 90 DISALLOW_COPY_AND_ASSIGN(PacingSender); |
90 }; | 91 }; |
91 | 92 |
92 } // namespace net | 93 } // namespace net |
93 | 94 |
94 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ | 95 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ |
OLD | NEW |