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 <deque> | 8 #include <deque> |
9 | 9 |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Returns the sum of bytes from all packets in flight. | 70 // Returns the sum of bytes from all packets in flight. |
71 QuicByteCount bytes_in_flight() const { | 71 QuicByteCount bytes_in_flight() const { |
72 return bytes_in_flight_; | 72 return bytes_in_flight_; |
73 } | 73 } |
74 | 74 |
75 // Returns the smallest sequence number of a serialized packet which has not | 75 // Returns the smallest sequence number of a serialized packet which has not |
76 // been acked by the peer. If there are no unacked packets, returns 0. | 76 // been acked by the peer. If there are no unacked packets, returns 0. |
77 QuicPacketSequenceNumber GetLeastUnacked() const; | 77 QuicPacketSequenceNumber GetLeastUnacked() const; |
78 | 78 |
79 // Restores the in flight status for a packet that was previously sent. | |
80 void RestoreInFlight(QuicPacketSequenceNumber sequence_number); | |
81 | |
82 // Clears all previous transmissions in order to make room in the ack frame | 79 // Clears all previous transmissions in order to make room in the ack frame |
83 // for newly acked packets. | 80 // for newly acked packets. |
84 void ClearAllPreviousRetransmissions(); | 81 void ClearAllPreviousRetransmissions(); |
85 | 82 |
86 typedef std::deque<TransmissionInfo> UnackedPacketMap; | 83 typedef std::deque<TransmissionInfo> UnackedPacketMap; |
87 | 84 |
88 typedef UnackedPacketMap::const_iterator const_iterator; | 85 typedef UnackedPacketMap::const_iterator const_iterator; |
89 | 86 |
90 const_iterator begin() const { return unacked_packets_.begin(); } | 87 const_iterator begin() const { return unacked_packets_.begin(); } |
91 const_iterator end() const { return unacked_packets_.end(); } | 88 const_iterator end() const { return unacked_packets_.end(); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 TransmissionType transmission_type, | 136 TransmissionType transmission_type, |
140 TransmissionInfo* info); | 137 TransmissionInfo* info); |
141 | 138 |
142 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); | 139 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); |
143 | 140 |
144 // Returns true if packet may be useful for an RTT measurement. | 141 // Returns true if packet may be useful for an RTT measurement. |
145 bool IsPacketUsefulForMeasuringRtt(QuicPacketSequenceNumber sequence_number, | 142 bool IsPacketUsefulForMeasuringRtt(QuicPacketSequenceNumber sequence_number, |
146 const TransmissionInfo& info) const; | 143 const TransmissionInfo& info) const; |
147 | 144 |
148 // Returns true if packet may be useful for congestion control purposes. | 145 // Returns true if packet may be useful for congestion control purposes. |
149 bool IsPacketUsefulForCongestionControl( | 146 bool IsPacketUsefulForCongestionControl(const TransmissionInfo& info) const; |
150 QuicPacketSequenceNumber sequence_number, | |
151 const TransmissionInfo& info) const; | |
152 | 147 |
153 // Returns true if packet may be associated with retransmittable data | 148 // Returns true if packet may be associated with retransmittable data |
154 // directly or through retransmissions. | 149 // directly or through retransmissions. |
155 bool IsPacketUsefulForRetransmittableData( | 150 bool IsPacketUsefulForRetransmittableData(const TransmissionInfo& info) const; |
156 QuicPacketSequenceNumber sequence_number, | |
157 const TransmissionInfo& info) const; | |
158 | 151 |
159 // Returns true if the packet no longer has a purpose in the map. | 152 // Returns true if the packet no longer has a purpose in the map. |
160 bool IsPacketUseless(QuicPacketSequenceNumber sequence_number, | 153 bool IsPacketUseless(QuicPacketSequenceNumber sequence_number, |
161 const TransmissionInfo& info) const; | 154 const TransmissionInfo& info) const; |
162 | 155 |
163 // Returns true if the packet is useless or it's only purpose is RTT | 156 // Returns true if the packet is useless or it's only purpose is RTT |
164 // measurement, and it's old enough that is unlikely to ever happen. | 157 // measurement, and it's old enough that is unlikely to ever happen. |
165 bool IsPacketRemovable(QuicPacketSequenceNumber sequence_number, | 158 bool IsPacketRemovable(QuicPacketSequenceNumber sequence_number, |
166 const TransmissionInfo& info) const; | 159 const TransmissionInfo& info) const; |
167 | 160 |
(...skipping 15 matching lines...) Expand all Loading... |
183 QuicByteCount bytes_in_flight_; | 176 QuicByteCount bytes_in_flight_; |
184 // Number of retransmittable crypto handshake packets. | 177 // Number of retransmittable crypto handshake packets. |
185 size_t pending_crypto_packet_count_; | 178 size_t pending_crypto_packet_count_; |
186 | 179 |
187 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); | 180 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |
188 }; | 181 }; |
189 | 182 |
190 } // namespace net | 183 } // namespace net |
191 | 184 |
192 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 185 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
OLD | NEW |