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 typedef std::map<QuicPacketSequenceNumber, TransmissionInfo> CongestionMap; | 28 typedef std::map<QuicPacketSequenceNumber, TransmissionInfo> CongestionMap; |
29 | 29 |
30 static SendAlgorithmInterface* Create(const QuicClock* clock, | 30 static SendAlgorithmInterface* Create(const QuicClock* clock, |
31 const RttStats* rtt_stats, | 31 const RttStats* rtt_stats, |
32 CongestionFeedbackType type, | 32 CongestionControlType type, |
33 QuicConnectionStats* stats); | 33 QuicConnectionStats* stats); |
34 | 34 |
35 virtual ~SendAlgorithmInterface() {} | 35 virtual ~SendAlgorithmInterface() {} |
36 | 36 |
37 virtual void SetFromConfig(const QuicConfig& config, bool is_server) = 0; | 37 virtual void SetFromConfig(const QuicConfig& config, bool is_server) = 0; |
38 | 38 |
39 // Called when we receive congestion feedback from remote peer. | 39 // Called when we receive congestion feedback from remote peer. |
40 virtual void OnIncomingQuicCongestionFeedbackFrame( | 40 virtual void OnIncomingQuicCongestionFeedbackFrame( |
41 const QuicCongestionFeedbackFrame& feedback, | 41 const QuicCongestionFeedbackFrame& feedback, |
42 QuicTime feedback_receive_time) = 0; | 42 QuicTime feedback_receive_time) = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 virtual QuicByteCount GetCongestionWindow() const = 0; | 94 virtual QuicByteCount GetCongestionWindow() const = 0; |
95 | 95 |
96 // Whether the send algorithm is currently in slow start. When true, the | 96 // Whether the send algorithm is currently in slow start. When true, the |
97 // BandwidthEstimate is expected to be too low. | 97 // BandwidthEstimate is expected to be too low. |
98 virtual bool InSlowStart() const = 0; | 98 virtual bool InSlowStart() const = 0; |
99 | 99 |
100 // Returns the size of the slow start congestion window in bytes, | 100 // Returns the size of the slow start congestion window in bytes, |
101 // aka ssthresh. Some send algorithms do not define a slow start | 101 // aka ssthresh. Some send algorithms do not define a slow start |
102 // threshold and will return 0. | 102 // threshold and will return 0. |
103 virtual QuicByteCount GetSlowStartThreshold() const = 0; | 103 virtual QuicByteCount GetSlowStartThreshold() const = 0; |
| 104 |
| 105 virtual CongestionControlType GetCongestionControlType() const = 0; |
104 }; | 106 }; |
105 | 107 |
106 } // namespace net | 108 } // namespace net |
107 | 109 |
108 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 110 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |