OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // Interface which gets callbacks from the QuicSentPacketManager when | 63 // Interface which gets callbacks from the QuicSentPacketManager when |
64 // network-related state changes. Implementations must not mutate the | 64 // network-related state changes. Implementations must not mutate the |
65 // state of the packet manager as a result of these callbacks. | 65 // state of the packet manager as a result of these callbacks. |
66 class NET_EXPORT_PRIVATE NetworkChangeVisitor { | 66 class NET_EXPORT_PRIVATE NetworkChangeVisitor { |
67 public: | 67 public: |
68 virtual ~NetworkChangeVisitor() {} | 68 virtual ~NetworkChangeVisitor() {} |
69 | 69 |
70 // Called when congestion window may have changed. | 70 // Called when congestion window may have changed. |
71 virtual void OnCongestionWindowChange() = 0; | 71 virtual void OnCongestionWindowChange() = 0; |
72 // TODO(jri): Add OnRttStatsChange() to this class as well. | 72 |
| 73 // Called when RTT may have changed, including when an RTT is read from |
| 74 // the config. |
| 75 virtual void OnRttChange() = 0; |
73 }; | 76 }; |
74 | 77 |
75 // Struct to store the pending retransmission information. | 78 // Struct to store the pending retransmission information. |
76 struct PendingRetransmission { | 79 struct PendingRetransmission { |
77 PendingRetransmission(QuicPacketSequenceNumber sequence_number, | 80 PendingRetransmission(QuicPacketSequenceNumber sequence_number, |
78 TransmissionType transmission_type, | 81 TransmissionType transmission_type, |
79 const RetransmittableFrames& retransmittable_frames, | 82 const RetransmittableFrames& retransmittable_frames, |
80 QuicSequenceNumberLength sequence_number_length) | 83 QuicSequenceNumberLength sequence_number_length) |
81 : sequence_number(sequence_number), | 84 : sequence_number(sequence_number), |
82 transmission_type(transmission_type), | 85 transmission_type(transmission_type), |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 139 |
137 // Returns true if the unacked packet |sequence_number| has retransmittable | 140 // Returns true if the unacked packet |sequence_number| has retransmittable |
138 // frames. This will only return false if the packet has been acked, if a | 141 // frames. This will only return false if the packet has been acked, if a |
139 // previous transmission of this packet was ACK'd, or if this packet has been | 142 // previous transmission of this packet was ACK'd, or if this packet has been |
140 // retransmitted as with different sequence number. | 143 // retransmitted as with different sequence number. |
141 bool HasRetransmittableFrames(QuicPacketSequenceNumber sequence_number) const; | 144 bool HasRetransmittableFrames(QuicPacketSequenceNumber sequence_number) const; |
142 | 145 |
143 // Returns true if there are pending retransmissions. | 146 // Returns true if there are pending retransmissions. |
144 bool HasPendingRetransmissions() const; | 147 bool HasPendingRetransmissions() const; |
145 | 148 |
146 // Retrieves the next pending retransmission. | 149 // Retrieves the next pending retransmission. You must ensure that |
| 150 // there are pending retransmissions prior to calling this function. |
147 PendingRetransmission NextPendingRetransmission(); | 151 PendingRetransmission NextPendingRetransmission(); |
148 | 152 |
149 bool HasUnackedPackets() const; | 153 bool HasUnackedPackets() const; |
150 | 154 |
151 // Returns the smallest sequence number of a serialized packet which has not | 155 // Returns the smallest sequence number of a serialized packet which has not |
152 // been acked by the peer. | 156 // been acked by the peer. |
153 QuicPacketSequenceNumber GetLeastUnacked() const; | 157 QuicPacketSequenceNumber GetLeastUnacked() const; |
154 | 158 |
155 // Called when a congestion feedback frame is received from peer. | 159 // Called when a congestion feedback frame is received from peer. |
156 virtual void OnIncomingQuicCongestionFeedbackFrame( | 160 virtual void OnIncomingQuicCongestionFeedbackFrame( |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // Records bandwidth from server to client in normal operation, over periods | 409 // Records bandwidth from server to client in normal operation, over periods |
406 // of time with no loss events. | 410 // of time with no loss events. |
407 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 411 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
408 | 412 |
409 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 413 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
410 }; | 414 }; |
411 | 415 |
412 } // namespace net | 416 } // namespace net |
413 | 417 |
414 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 418 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
OLD | NEW |