| 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 // Returns true if the packet should be tracked by the congestion manager, | 75 // Returns true if the packet should be tracked by the congestion manager, |
| 76 // false otherwise. This is used by implementations such as tcp_cubic_sender | 76 // false otherwise. This is used by implementations such as tcp_cubic_sender |
| 77 // that do not count outgoing ACK packets against the congestion window. | 77 // that do not count outgoing ACK packets against the congestion window. |
| 78 // Note: this function must be called for every packet sent to the wire. | 78 // Note: this function must be called for every packet sent to the wire. |
| 79 virtual bool OnPacketSent(QuicTime sent_time, | 79 virtual bool OnPacketSent(QuicTime sent_time, |
| 80 QuicPacketSequenceNumber sequence_number, | 80 QuicPacketSequenceNumber sequence_number, |
| 81 QuicByteCount bytes, | 81 QuicByteCount bytes, |
| 82 TransmissionType transmission_type, | 82 TransmissionType transmission_type, |
| 83 HasRetransmittableData is_retransmittable) = 0; | 83 HasRetransmittableData is_retransmittable) = 0; |
| 84 | 84 |
| 85 // Called when the retransmission timeout fires. | 85 // Called when the retransmission timeout fires. Neither OnPacketAbandoned |
| 86 virtual void OnRetransmissionTimeout() = 0; | 86 // nor OnPacketLost will be called for these packets. |
| 87 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; |
| 87 | 88 |
| 88 // Called when a packet is timed out. | 89 // Called when a packet is timed out. |
| 89 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, | 90 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, |
| 90 QuicByteCount abandoned_bytes) = 0; | 91 QuicByteCount abandoned_bytes) = 0; |
| 91 | 92 |
| 92 // Calculate the time until we can send the next packet. | 93 // Calculate the time until we can send the next packet. |
| 93 virtual QuicTime::Delta TimeUntilSend( | 94 virtual QuicTime::Delta TimeUntilSend( |
| 94 QuicTime now, | 95 QuicTime now, |
| 95 TransmissionType transmission_type, | 96 TransmissionType transmission_type, |
| 96 HasRetransmittableData has_retransmittable_data, | 97 HasRetransmittableData has_retransmittable_data, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 110 | 111 |
| 111 // Returns the size of the current congestion window in bytes. Note, this is | 112 // Returns the size of the current congestion window in bytes. Note, this is |
| 112 // not the *available* window. Some send algorithms may not use a congestion | 113 // not the *available* window. Some send algorithms may not use a congestion |
| 113 // window and will return 0. | 114 // window and will return 0. |
| 114 virtual QuicByteCount GetCongestionWindow() const = 0; | 115 virtual QuicByteCount GetCongestionWindow() const = 0; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace net | 118 } // namespace net |
| 118 | 119 |
| 119 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 120 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |