OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The pure virtual class for send side congestion control algorithm. | 5 // The pure virtual class for send side congestion control algorithm. |
6 | 6 |
7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // Called when the last retransmission timeout was spurious. | 76 // Called when the last retransmission timeout was spurious. |
77 virtual void RevertRetransmissionTimeout() = 0; | 77 virtual void RevertRetransmissionTimeout() = 0; |
78 | 78 |
79 // Calculate the time until we can send the next packet. | 79 // Calculate the time until we can send the next packet. |
80 virtual QuicTime::Delta TimeUntilSend( | 80 virtual QuicTime::Delta TimeUntilSend( |
81 QuicTime now, | 81 QuicTime now, |
82 QuicByteCount bytes_in_flight, | 82 QuicByteCount bytes_in_flight, |
83 HasRetransmittableData has_retransmittable_data) const = 0; | 83 HasRetransmittableData has_retransmittable_data) const = 0; |
84 | 84 |
| 85 // The pacing rate of the send algorithm. May be zero if the rate is unknown. |
85 virtual QuicBandwidth PacingRate() const = 0; | 86 virtual QuicBandwidth PacingRate() const = 0; |
86 | 87 |
87 // What's the current estimated bandwidth in bytes per second. | 88 // What's the current estimated bandwidth in bytes per second. |
88 // Returns 0 when it does not have an estimate. | 89 // Returns 0 when it does not have an estimate. |
89 virtual QuicBandwidth BandwidthEstimate() const = 0; | 90 virtual QuicBandwidth BandwidthEstimate() const = 0; |
90 | 91 |
91 // Returns true if the current bandwidth estimate is reliable. | 92 // Returns true if the current bandwidth estimate is reliable. |
92 virtual bool HasReliableBandwidthEstimate() const = 0; | 93 virtual bool HasReliableBandwidthEstimate() const = 0; |
93 | 94 |
94 // Get the send algorithm specific retransmission delay, called RTO in TCP, | 95 // Get the send algorithm specific retransmission delay, called RTO in TCP, |
(...skipping 17 matching lines...) Expand all Loading... |
112 // aka ssthresh. Some send algorithms do not define a slow start | 113 // aka ssthresh. Some send algorithms do not define a slow start |
113 // threshold and will return 0. | 114 // threshold and will return 0. |
114 virtual QuicByteCount GetSlowStartThreshold() const = 0; | 115 virtual QuicByteCount GetSlowStartThreshold() const = 0; |
115 | 116 |
116 virtual CongestionControlType GetCongestionControlType() const = 0; | 117 virtual CongestionControlType GetCongestionControlType() const = 0; |
117 }; | 118 }; |
118 | 119 |
119 } // namespace net | 120 } // namespace net |
120 | 121 |
121 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 122 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |