OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UNACKED_PACKET_MAP_H_ | 5 #ifndef NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
6 #define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 6 #define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 QuicTime::Delta delta_largest_observed); | 51 QuicTime::Delta delta_largest_observed); |
52 | 52 |
53 // Notifies all the AckListeners attached to |newest_transmission|. | 53 // Notifies all the AckListeners attached to |newest_transmission|. |
54 void NotifyAndClearListeners(QuicPacketNumber newest_transmission, | 54 void NotifyAndClearListeners(QuicPacketNumber newest_transmission, |
55 QuicTime::Delta delta_largest_observed); | 55 QuicTime::Delta delta_largest_observed); |
56 | 56 |
57 // Marks |info| as no longer in flight. | 57 // Marks |info| as no longer in flight. |
58 void RemoveFromInFlight(TransmissionInfo* info); | 58 void RemoveFromInFlight(TransmissionInfo* info); |
59 | 59 |
60 // Marks |packet_number| as no longer in flight. | 60 // Marks |packet_number| as no longer in flight. |
61 // TODO(ianswett): Remove this test-only method. | |
62 void RemoveFromInFlight(QuicPacketNumber packet_number); | 61 void RemoveFromInFlight(QuicPacketNumber packet_number); |
63 | 62 |
| 63 // Marks |packet_number| as in flight. Must not be unackable. |
| 64 void RestoreToInFlight(QuicPacketNumber packet_number); |
| 65 |
64 // No longer retransmit data for |stream_id|. | 66 // No longer retransmit data for |stream_id|. |
65 void CancelRetransmissionsForStream(QuicStreamId stream_id); | 67 void CancelRetransmissionsForStream(QuicStreamId stream_id); |
66 | 68 |
67 // Returns true if the unacked packet |packet_number| has retransmittable | 69 // Returns true if the unacked packet |packet_number| has retransmittable |
68 // frames. This will return false if the packet has been acked, if a | 70 // frames. This will return false if the packet has been acked, if a |
69 // previous transmission of this packet was ACK'd, or if this packet has been | 71 // previous transmission of this packet was ACK'd, or if this packet has been |
70 // retransmitted as with different packet number, or if the packet never | 72 // retransmitted as with different packet number, or if the packet never |
71 // had any retransmittable packets in the first place. | 73 // had any retransmittable packets in the first place. |
72 bool HasRetransmittableFrames(QuicPacketNumber packet_number) const; | 74 bool HasRetransmittableFrames(QuicPacketNumber packet_number) const; |
73 | 75 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 129 |
128 // Removes any retransmittable frames from this transmission or an associated | 130 // Removes any retransmittable frames from this transmission or an associated |
129 // transmission. It removes now useless transmissions, and disconnects any | 131 // transmission. It removes now useless transmissions, and disconnects any |
130 // other packets from other transmissions. | 132 // other packets from other transmissions. |
131 void RemoveRetransmittability(TransmissionInfo* info); | 133 void RemoveRetransmittability(TransmissionInfo* info); |
132 | 134 |
133 // Looks up the TransmissionInfo by |packet_number| and calls | 135 // Looks up the TransmissionInfo by |packet_number| and calls |
134 // RemoveRetransmittability. | 136 // RemoveRetransmittability. |
135 void RemoveRetransmittability(QuicPacketNumber packet_number); | 137 void RemoveRetransmittability(QuicPacketNumber packet_number); |
136 | 138 |
137 // Removes any other retransmissions and marks all transmissions unackable. | |
138 void RemoveAckability(TransmissionInfo* info); | |
139 | |
140 // Increases the largest observed. Any packets less or equal to | 139 // Increases the largest observed. Any packets less or equal to |
141 // |largest_acked_packet| are discarded if they are only for the RTT purposes. | 140 // |largest_acked_packet| are discarded if they are only for the RTT purposes. |
142 void IncreaseLargestObserved(QuicPacketNumber largest_observed); | 141 void IncreaseLargestObserved(QuicPacketNumber largest_observed); |
143 | 142 |
144 // Remove any packets no longer needed for retransmission, congestion, or | 143 // Remove any packets no longer needed for retransmission, congestion, or |
145 // RTT measurement purposes. | 144 // RTT measurement purposes. |
146 void RemoveObsoletePackets(); | 145 void RemoveObsoletePackets(); |
147 | 146 |
148 private: | 147 private: |
149 // Called when a packet is retransmitted with a new packet number. | 148 // Called when a packet is retransmitted with a new packet number. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 QuicByteCount bytes_in_flight_; | 189 QuicByteCount bytes_in_flight_; |
191 // Number of retransmittable crypto handshake packets. | 190 // Number of retransmittable crypto handshake packets. |
192 size_t pending_crypto_packet_count_; | 191 size_t pending_crypto_packet_count_; |
193 | 192 |
194 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); | 193 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |
195 }; | 194 }; |
196 | 195 |
197 } // namespace net | 196 } // namespace net |
198 | 197 |
199 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 198 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
OLD | NEW |