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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Remove any packets no longer needed for retransmission, congestion, or | 132 // Remove any packets no longer needed for retransmission, congestion, or |
133 // RTT measurement purposes. | 133 // RTT measurement purposes. |
134 void RemoveObsoletePackets(); | 134 void RemoveObsoletePackets(); |
135 | 135 |
136 private: | 136 private: |
137 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); | 137 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); |
138 | 138 |
139 // Returns true if the packet no longer has a purpose in the map. | 139 // Returns true if the packet no longer has a purpose in the map. |
140 bool IsPacketUseless(QuicPacketSequenceNumber sequence_number, | 140 bool IsPacketUseless(QuicPacketSequenceNumber sequence_number, |
141 const TransmissionInfo& info) const; | 141 const TransmissionInfo& info) const; |
| 142 // Returns true if the packet is useless or it's only purpose is RTT |
| 143 // measurement, and it's old enough that is unlikely to ever happen. |
| 144 bool IsPacketRemovable(QuicPacketSequenceNumber sequence_number, |
| 145 const TransmissionInfo& info) const; |
142 | 146 |
143 QuicPacketSequenceNumber largest_sent_packet_; | 147 QuicPacketSequenceNumber largest_sent_packet_; |
144 QuicPacketSequenceNumber largest_observed_; | 148 QuicPacketSequenceNumber largest_observed_; |
145 | 149 |
146 // Newly serialized retransmittable and fec packets are added to this map, | 150 // Newly serialized retransmittable and fec packets are added to this map, |
147 // which contains owning pointers to any contained frames. If a packet is | 151 // which contains owning pointers to any contained frames. If a packet is |
148 // retransmitted, this map will contain entries for both the old and the new | 152 // retransmitted, this map will contain entries for both the old and the new |
149 // packet. The old packet's retransmittable frames entry will be NULL, while | 153 // packet. The old packet's retransmittable frames entry will be NULL, while |
150 // the new packet's entry will contain the frames to retransmit. | 154 // the new packet's entry will contain the frames to retransmit. |
151 // If the old packet is acked before the new packet, then the old entry will | 155 // If the old packet is acked before the new packet, then the old entry will |
152 // be removed from the map and the new entry's retransmittable frames will be | 156 // be removed from the map and the new entry's retransmittable frames will be |
153 // set to NULL. | 157 // set to NULL. |
154 UnackedPacketMap unacked_packets_; | 158 UnackedPacketMap unacked_packets_; |
155 // The packet at the 0th index of unacked_packets_. | 159 // The packet at the 0th index of unacked_packets_. |
156 QuicPacketSequenceNumber least_unacked_; | 160 QuicPacketSequenceNumber least_unacked_; |
157 | 161 |
158 size_t bytes_in_flight_; | 162 size_t bytes_in_flight_; |
159 // Number of retransmittable crypto handshake packets. | 163 // Number of retransmittable crypto handshake packets. |
160 size_t pending_crypto_packet_count_; | 164 size_t pending_crypto_packet_count_; |
161 | 165 |
162 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); | 166 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |
163 }; | 167 }; |
164 | 168 |
165 } // namespace net | 169 } // namespace net |
166 | 170 |
167 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 171 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
OLD | NEW |