| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual bool OnPacketSent(QuicTime sent_time, | 60 virtual bool OnPacketSent(QuicTime sent_time, |
| 61 QuicByteCount bytes_in_flight, | 61 QuicByteCount bytes_in_flight, |
| 62 QuicPacketSequenceNumber sequence_number, | 62 QuicPacketSequenceNumber sequence_number, |
| 63 QuicByteCount bytes, | 63 QuicByteCount bytes, |
| 64 HasRetransmittableData is_retransmittable) = 0; | 64 HasRetransmittableData is_retransmittable) = 0; |
| 65 | 65 |
| 66 // Called when the retransmission timeout fires. Neither OnPacketAbandoned | 66 // Called when the retransmission timeout fires. Neither OnPacketAbandoned |
| 67 // nor OnPacketLost will be called for these packets. | 67 // nor OnPacketLost will be called for these packets. |
| 68 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; | 68 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; |
| 69 | 69 |
| 70 // Called when the last retransmission timeout was spurious. |
| 71 virtual void RevertRetransmissionTimeout() = 0; |
| 72 |
| 70 // Calculate the time until we can send the next packet. | 73 // Calculate the time until we can send the next packet. |
| 71 virtual QuicTime::Delta TimeUntilSend( | 74 virtual QuicTime::Delta TimeUntilSend( |
| 72 QuicTime now, | 75 QuicTime now, |
| 73 QuicByteCount bytes_in_flight, | 76 QuicByteCount bytes_in_flight, |
| 74 HasRetransmittableData has_retransmittable_data) const = 0; | 77 HasRetransmittableData has_retransmittable_data) const = 0; |
| 75 | 78 |
| 76 // What's the current estimated bandwidth in bytes per second. | 79 // What's the current estimated bandwidth in bytes per second. |
| 77 // Returns 0 when it does not have an estimate. | 80 // Returns 0 when it does not have an estimate. |
| 78 virtual QuicBandwidth BandwidthEstimate() const = 0; | 81 virtual QuicBandwidth BandwidthEstimate() const = 0; |
| 79 | 82 |
| 80 // Get the send algorithm specific retransmission delay, called RTO in TCP, | 83 // Get the send algorithm specific retransmission delay, called RTO in TCP, |
| 81 // Note 1: the caller is responsible for sanity checking this value. | 84 // Note 1: the caller is responsible for sanity checking this value. |
| 82 // Note 2: this will return zero if we don't have enough data for an estimate. | 85 // Note 2: this will return zero if we don't have enough data for an estimate. |
| 83 virtual QuicTime::Delta RetransmissionDelay() const = 0; | 86 virtual QuicTime::Delta RetransmissionDelay() const = 0; |
| 84 | 87 |
| 85 // Returns the size of the current congestion window in bytes. Note, this is | 88 // Returns the size of the current congestion window in bytes. Note, this is |
| 86 // not the *available* window. Some send algorithms may not use a congestion | 89 // not the *available* window. Some send algorithms may not use a congestion |
| 87 // window and will return 0. | 90 // window and will return 0. |
| 88 virtual QuicByteCount GetCongestionWindow() const = 0; | 91 virtual QuicByteCount GetCongestionWindow() const = 0; |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace net | 94 } // namespace net |
| 92 | 95 |
| 93 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 96 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |