| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Called when connection migrates and cwnd needs to be reset. | 79 // Called when connection migrates and cwnd needs to be reset. |
| 80 virtual void OnConnectionMigration() = 0; | 80 virtual void OnConnectionMigration() = 0; |
| 81 | 81 |
| 82 // Calculate the time until we can send the next packet. | 82 // Calculate the time until we can send the next packet. |
| 83 virtual QuicTime::Delta TimeUntilSend( | 83 virtual QuicTime::Delta TimeUntilSend( |
| 84 QuicTime now, | 84 QuicTime now, |
| 85 QuicByteCount bytes_in_flight) const = 0; | 85 QuicByteCount bytes_in_flight) const = 0; |
| 86 | 86 |
| 87 // 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. |
| 88 virtual QuicBandwidth PacingRate() const = 0; | 88 virtual QuicBandwidth PacingRate(QuicByteCount bytes_in_flight) const = 0; |
| 89 | 89 |
| 90 // What's the current estimated bandwidth in bytes per second. | 90 // What's the current estimated bandwidth in bytes per second. |
| 91 // Returns 0 when it does not have an estimate. | 91 // Returns 0 when it does not have an estimate. |
| 92 virtual QuicBandwidth BandwidthEstimate() const = 0; | 92 virtual QuicBandwidth BandwidthEstimate() const = 0; |
| 93 | 93 |
| 94 // Get the send algorithm specific retransmission delay, called RTO in TCP, | 94 // Get the send algorithm specific retransmission delay, called RTO in TCP, |
| 95 // Note 1: the caller is responsible for sanity checking this value. | 95 // Note 1: the caller is responsible for sanity checking this value. |
| 96 // Note 2: this will return zero if we don't have enough data for an estimate. | 96 // Note 2: this will return zero if we don't have enough data for an estimate. |
| 97 virtual QuicTime::Delta RetransmissionDelay() const = 0; | 97 virtual QuicTime::Delta RetransmissionDelay() const = 0; |
| 98 | 98 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 118 // 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. |
| 119 // 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. |
| 120 virtual void ResumeConnectionState( | 120 virtual void ResumeConnectionState( |
| 121 const CachedNetworkParameters& cached_network_params, | 121 const CachedNetworkParameters& cached_network_params, |
| 122 bool max_bandwidth_resumption) = 0; | 122 bool max_bandwidth_resumption) = 0; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace net | 125 } // namespace net |
| 126 | 126 |
| 127 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 127 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |