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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 QuicByteCount acked_bytes, | 51 QuicByteCount acked_bytes, |
52 QuicTime::Delta rtt) = 0; | 52 QuicTime::Delta rtt) = 0; |
53 | 53 |
54 virtual void OnIncomingLoss(QuicTime ack_receive_time) = 0; | 54 virtual void OnIncomingLoss(QuicTime ack_receive_time) = 0; |
55 | 55 |
56 // Inform that we sent x bytes to the wire, and if that was a retransmission. | 56 // Inform that we sent x bytes to the wire, and if that was a retransmission. |
57 // Note: this function must be called for every packet sent to the wire. | 57 // Note: this function must be called for every packet sent to the wire. |
58 virtual void SentPacket(QuicTime sent_time, | 58 virtual void SentPacket(QuicTime sent_time, |
59 QuicPacketSequenceNumber sequence_number, | 59 QuicPacketSequenceNumber sequence_number, |
60 QuicByteCount bytes, | 60 QuicByteCount bytes, |
61 bool is_retransmission, | 61 bool is_retransmission) = 0; |
62 bool has_retransmittable_data) = 0; | 62 |
| 63 // Called when a packet is timed out. |
| 64 virtual void AbandoningPacket(QuicPacketSequenceNumber sequence_number, |
| 65 QuicByteCount abandoned_bytes) = 0; |
63 | 66 |
64 // Calculate the time until we can send the next packet. | 67 // Calculate the time until we can send the next packet. |
65 virtual QuicTime::Delta TimeUntilSend(QuicTime now, | 68 virtual QuicTime::Delta TimeUntilSend(QuicTime now, |
66 bool is_retransmission) = 0; | 69 bool is_retransmission, |
| 70 bool has_retransmittable_data) = 0; |
67 | 71 |
68 // What's the current estimated bandwidth in bytes per second. | 72 // What's the current estimated bandwidth in bytes per second. |
69 // Returns 0 when it does not have an estimate. | 73 // Returns 0 when it does not have an estimate. |
70 virtual QuicBandwidth BandwidthEstimate() = 0; | 74 virtual QuicBandwidth BandwidthEstimate() = 0; |
| 75 |
| 76 // TODO(satyamshekhar): Monitor MinRtt. |
| 77 virtual QuicTime::Delta SmoothedRtt() = 0; |
71 }; | 78 }; |
72 | 79 |
73 } // namespace net | 80 } // namespace net |
74 | 81 |
75 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ | 82 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ |
OLD | NEW |