| 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 11 matching lines...) Expand all Loading... |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class RttStats; | 24 class RttStats; |
| 25 | 25 |
| 26 class NET_EXPORT_PRIVATE SendAlgorithmInterface { | 26 class NET_EXPORT_PRIVATE SendAlgorithmInterface { |
| 27 public: | 27 public: |
| 28 // A sorted vector of packets. | 28 // A sorted vector of packets. |
| 29 typedef std::vector<std::pair<QuicPacketSequenceNumber, TransmissionInfo>> | 29 typedef std::vector<std::pair<QuicPacketSequenceNumber, TransmissionInfo>> |
| 30 CongestionVector; | 30 CongestionVector; |
| 31 | 31 |
| 32 static SendAlgorithmInterface* Create(const QuicClock* clock, | 32 static SendAlgorithmInterface* Create( |
| 33 const RttStats* rtt_stats, | 33 const QuicClock* clock, |
| 34 CongestionControlType type, | 34 const RttStats* rtt_stats, |
| 35 QuicConnectionStats* stats); | 35 CongestionControlType type, |
| 36 QuicConnectionStats* stats, |
| 37 QuicPacketCount initial_congestion_window); |
| 36 | 38 |
| 37 virtual ~SendAlgorithmInterface() {} | 39 virtual ~SendAlgorithmInterface() {} |
| 38 | 40 |
| 39 virtual void SetFromConfig(const QuicConfig& config, bool is_server) = 0; | 41 virtual void SetFromConfig( |
| 42 const QuicConfig& config, bool is_server, bool using_pacing) = 0; |
| 40 | 43 |
| 41 // Sets the number of connections to emulate when doing congestion control, | 44 // Sets the number of connections to emulate when doing congestion control, |
| 42 // particularly for congestion avoidance. Can be set any time. | 45 // particularly for congestion avoidance. Can be set any time. |
| 43 virtual void SetNumEmulatedConnections(int num_connections) = 0; | 46 virtual void SetNumEmulatedConnections(int num_connections) = 0; |
| 44 | 47 |
| 45 // Indicates an update to the congestion state, caused either by an incoming | 48 // Indicates an update to the congestion state, caused either by an incoming |
| 46 // ack or loss event timeout. |rtt_updated| indicates whether a new | 49 // ack or loss event timeout. |rtt_updated| indicates whether a new |
| 47 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight | 50 // latest_rtt sample has been taken, |byte_in_flight| the bytes in flight |
| 48 // prior to the congestion event. |acked_packets| and |lost_packets| are | 51 // prior to the congestion event. |acked_packets| and |lost_packets| are |
| 49 // any packets considered acked or lost as a result of the congestion event. | 52 // any packets considered acked or lost as a result of the congestion event. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // aka ssthresh. Some send algorithms do not define a slow start | 111 // aka ssthresh. Some send algorithms do not define a slow start |
| 109 // threshold and will return 0. | 112 // threshold and will return 0. |
| 110 virtual QuicByteCount GetSlowStartThreshold() const = 0; | 113 virtual QuicByteCount GetSlowStartThreshold() const = 0; |
| 111 | 114 |
| 112 virtual CongestionControlType GetCongestionControlType() const = 0; | 115 virtual CongestionControlType GetCongestionControlType() const = 0; |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 } // namespace net | 118 } // namespace net |
| 116 | 119 |
| 117 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 120 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
| OLD | NEW |