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_CORE_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 7 #ifndef NET_QUIC_CORE_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
8 #define NET_QUIC_CORE_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 8 #define NET_QUIC_CORE_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 HasRetransmittableData is_retransmittable) = 0; | 75 HasRetransmittableData is_retransmittable) = 0; |
76 | 76 |
77 // Called when the retransmission timeout fires. Neither OnPacketAbandoned | 77 // Called when the retransmission timeout fires. Neither OnPacketAbandoned |
78 // nor OnPacketLost will be called for these packets. | 78 // nor OnPacketLost will be called for these packets. |
79 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; | 79 virtual void OnRetransmissionTimeout(bool packets_retransmitted) = 0; |
80 | 80 |
81 // Called when connection migrates and cwnd needs to be reset. | 81 // Called when connection migrates and cwnd needs to be reset. |
82 virtual void OnConnectionMigration() = 0; | 82 virtual void OnConnectionMigration() = 0; |
83 | 83 |
84 // Calculate the time until we can send the next packet. | 84 // Calculate the time until we can send the next packet. |
85 virtual QuicTime::Delta TimeUntilSend( | 85 virtual QuicTime::Delta TimeUntilSend(QuicTime now, |
86 QuicTime now, | 86 QuicByteCount bytes_in_flight) = 0; |
87 QuicByteCount bytes_in_flight) const = 0; | |
88 | 87 |
89 // The pacing rate of the send algorithm. May be zero if the rate is unknown. | 88 // The pacing rate of the send algorithm. May be zero if the rate is unknown. |
90 virtual QuicBandwidth PacingRate(QuicByteCount bytes_in_flight) const = 0; | 89 virtual QuicBandwidth PacingRate(QuicByteCount bytes_in_flight) const = 0; |
91 | 90 |
92 // What's the current estimated bandwidth in bytes per second. | 91 // What's the current estimated bandwidth in bytes per second. |
93 // Returns 0 when it does not have an estimate. | 92 // Returns 0 when it does not have an estimate. |
94 virtual QuicBandwidth BandwidthEstimate() const = 0; | 93 virtual QuicBandwidth BandwidthEstimate() const = 0; |
95 | 94 |
96 // Returns the size of the current congestion window in bytes. Note, this is | 95 // Returns the size of the current congestion window in bytes. Note, this is |
97 // not the *available* window. Some send algorithms may not use a congestion | 96 // not the *available* window. Some send algorithms may not use a congestion |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // connection would not be blocked by the congestion control if it actually | 132 // connection would not be blocked by the congestion control if it actually |
134 // tried to send data. If the congestion control algorithm needs to exclude | 133 // tried to send data. If the congestion control algorithm needs to exclude |
135 // such cases, it should use the internal state it uses for congestion control | 134 // such cases, it should use the internal state it uses for congestion control |
136 // for that. | 135 // for that. |
137 virtual void OnApplicationLimited(QuicByteCount bytes_in_flight) = 0; | 136 virtual void OnApplicationLimited(QuicByteCount bytes_in_flight) = 0; |
138 }; | 137 }; |
139 | 138 |
140 } // namespace net | 139 } // namespace net |
141 | 140 |
142 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 141 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |