Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: net/quic/quic_unacked_packet_map.h

Issue 551223002: Discard old packets from the QuicSentPacketManager which are only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_flaky_test_74798317
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_unacked_packet_map.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_unacked_packet_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698