| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Indicates an update to the congestion state, caused either by an incoming | 44 // Indicates an update to the congestion state, caused either by an incoming |
| 45 // ack or loss event timeout. |rtt_updated| indicates whether a new | 45 // ack or loss event timeout. |rtt_updated| indicates whether a new |
| 46 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight | 46 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight |
| 47 // prior to the congestion event. |acked_packets| and |lost_packets| are | 47 // prior to the congestion event. |acked_packets| and |lost_packets| are |
| 48 // any packets considered acked or lost as a result of the congestion event. | 48 // any packets considered acked or lost as a result of the congestion event. |
| 49 virtual void OnCongestionEvent(bool rtt_updated, | 49 virtual void OnCongestionEvent(bool rtt_updated, |
| 50 QuicByteCount bytes_in_flight, | 50 QuicByteCount bytes_in_flight, |
| 51 const CongestionMap& acked_packets, | 51 const CongestionMap& acked_packets, |
| 52 const CongestionMap& lost_packets) = 0; | 52 const CongestionMap& lost_packets) = 0; |
| 53 | 53 |
| 54 // Inform that we sent x bytes to the wire, and if that was a retransmission. | 54 // Inform that we sent |bytes| to the wire, and if the packet is |
| 55 // Returns true if the packet should be tracked by the congestion manager, | 55 // retransmittable. Returns true if the packet should be tracked by the |
| 56 // false otherwise. This is used by implementations such as tcp_cubic_sender | 56 // congestion manager and included in bytes_in_flight, false otherwise. |
| 57 // that do not count outgoing ACK packets against the congestion window. | 57 // |bytes_in_flight| is the number of bytes in flight before the packet was |
| 58 // sent. |
| 58 // Note: this function must be called for every packet sent to the wire. | 59 // Note: this function must be called for every packet sent to the wire. |
| 59 virtual bool OnPacketSent(QuicTime sent_time, | 60 virtual bool OnPacketSent(QuicTime sent_time, |
| 60 QuicByteCount bytes_in_flight, | 61 QuicByteCount bytes_in_flight, |
| 61 QuicPacketSequenceNumber sequence_number, | 62 QuicPacketSequenceNumber sequence_number, |
| 62 QuicByteCount bytes, | 63 QuicByteCount bytes, |
| 63 HasRetransmittableData is_retransmittable) = 0; | 64 HasRetransmittableData is_retransmittable) = 0; |
| 64 | 65 |
| 65 // Called when the retransmission timeout fires. Neither OnPacketAbandoned | 66 // Called when the retransmission timeout fires. Neither OnPacketAbandoned |
| 66 // nor OnPacketLost will be called for these packets. | 67 // nor OnPacketLost will be called for these packets. |
| 67 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; | 68 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 83 | 84 |
| 84 // Returns the size of the current congestion window in bytes. Note, this is | 85 // Returns the size of the current congestion window in bytes. Note, this is |
| 85 // not the *available* window. Some send algorithms may not use a congestion | 86 // not the *available* window. Some send algorithms may not use a congestion |
| 86 // window and will return 0. | 87 // window and will return 0. |
| 87 virtual QuicByteCount GetCongestionWindow() const = 0; | 88 virtual QuicByteCount GetCongestionWindow() const = 0; |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace net | 91 } // namespace net |
| 91 | 92 |
| 92 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 93 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |