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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual bool OnPacketSent(QuicTime sent_time, | 68 virtual bool OnPacketSent(QuicTime sent_time, |
69 QuicByteCount bytes_in_flight, | 69 QuicByteCount bytes_in_flight, |
70 QuicPacketNumber packet_number, | 70 QuicPacketNumber packet_number, |
71 QuicByteCount bytes, | 71 QuicByteCount bytes, |
72 HasRetransmittableData is_retransmittable) = 0; | 72 HasRetransmittableData is_retransmittable) = 0; |
73 | 73 |
74 // Called when the retransmission timeout fires. Neither OnPacketAbandoned | 74 // Called when the retransmission timeout fires. Neither OnPacketAbandoned |
75 // nor OnPacketLost will be called for these packets. | 75 // nor OnPacketLost will be called for these packets. |
76 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; | 76 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; |
77 | 77 |
| 78 // Called when connection migrates and cwnd needs to be reset. |
| 79 virtual void OnConnectionMigration() = 0; |
| 80 |
78 // Calculate the time until we can send the next packet. | 81 // Calculate the time until we can send the next packet. |
79 virtual QuicTime::Delta TimeUntilSend( | 82 virtual QuicTime::Delta TimeUntilSend( |
80 QuicTime now, | 83 QuicTime now, |
81 QuicByteCount bytes_in_flight, | 84 QuicByteCount bytes_in_flight, |
82 HasRetransmittableData has_retransmittable_data) const = 0; | 85 HasRetransmittableData has_retransmittable_data) const = 0; |
83 | 86 |
84 // The pacing rate of the send algorithm. May be zero if the rate is unknown. | 87 // The pacing rate of the send algorithm. May be zero if the rate is unknown. |
85 virtual QuicBandwidth PacingRate() const = 0; | 88 virtual QuicBandwidth PacingRate() const = 0; |
86 | 89 |
87 // What's the current estimated bandwidth in bytes per second. | 90 // What's the current estimated bandwidth in bytes per second. |
(...skipping 27 matching lines...) Expand all Loading... |
115 // Called by the Session when we get a bandwidth estimate from the client. | 118 // Called by the Session when we get a bandwidth estimate from the client. |
116 // Uses the max bandwidth in the params if |max_bandwidth_resumption| is true. | 119 // Uses the max bandwidth in the params if |max_bandwidth_resumption| is true. |
117 virtual void ResumeConnectionState( | 120 virtual void ResumeConnectionState( |
118 const CachedNetworkParameters& cached_network_params, | 121 const CachedNetworkParameters& cached_network_params, |
119 bool max_bandwidth_resumption) = 0; | 122 bool max_bandwidth_resumption) = 0; |
120 }; | 123 }; |
121 | 124 |
122 } // namespace net | 125 } // namespace net |
123 | 126 |
124 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 127 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |