| 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 virtual QuicBandwidth PacingRate() const = 0; |
| 86 |
| 85 // What's the current estimated bandwidth in bytes per second. | 87 // What's the current estimated bandwidth in bytes per second. |
| 86 // Returns 0 when it does not have an estimate. | 88 // Returns 0 when it does not have an estimate. |
| 87 virtual QuicBandwidth BandwidthEstimate() const = 0; | 89 virtual QuicBandwidth BandwidthEstimate() const = 0; |
| 88 | 90 |
| 89 // Returns true if the current bandwidth estimate is reliable. | 91 // Returns true if the current bandwidth estimate is reliable. |
| 90 virtual bool HasReliableBandwidthEstimate() const = 0; | 92 virtual bool HasReliableBandwidthEstimate() const = 0; |
| 91 | 93 |
| 92 // Get the send algorithm specific retransmission delay, called RTO in TCP, | 94 // Get the send algorithm specific retransmission delay, called RTO in TCP, |
| 93 // Note 1: the caller is responsible for sanity checking this value. | 95 // Note 1: the caller is responsible for sanity checking this value. |
| 94 // Note 2: this will return zero if we don't have enough data for an estimate. | 96 // Note 2: this will return zero if we don't have enough data for an estimate. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 110 // aka ssthresh. Some send algorithms do not define a slow start | 112 // aka ssthresh. Some send algorithms do not define a slow start |
| 111 // threshold and will return 0. | 113 // threshold and will return 0. |
| 112 virtual QuicByteCount GetSlowStartThreshold() const = 0; | 114 virtual QuicByteCount GetSlowStartThreshold() const = 0; |
| 113 | 115 |
| 114 virtual CongestionControlType GetCongestionControlType() const = 0; | 116 virtual CongestionControlType GetCongestionControlType() const = 0; |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 } // namespace net | 119 } // namespace net |
| 118 | 120 |
| 119 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 121 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |