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 #include "net/quic/quic_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/quic/quic_connection_stats.h" | 9 #include "net/quic/quic_connection_stats.h" |
10 #include "net/quic/quic_utils_chromium.h" | 10 #include "net/quic/quic_utils_chromium.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 == IS_HANDSHAKE) { | 177 == IS_HANDSHAKE) { |
178 --pending_crypto_packet_count_; | 178 --pending_crypto_packet_count_; |
179 } | 179 } |
180 delete transmission_info->retransmittable_frames; | 180 delete transmission_info->retransmittable_frames; |
181 transmission_info->retransmittable_frames = NULL; | 181 transmission_info->retransmittable_frames = NULL; |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 void QuicUnackedPacketMap::IncreaseLargestObserved( | 185 void QuicUnackedPacketMap::IncreaseLargestObserved( |
186 QuicPacketSequenceNumber largest_observed) { | 186 QuicPacketSequenceNumber largest_observed) { |
187 DCHECK_LT(largest_observed_, largest_observed); | 187 DCHECK_LE(largest_observed_, largest_observed); |
188 largest_observed_ = largest_observed; | 188 largest_observed_ = largest_observed; |
189 UnackedPacketMap::iterator it = unacked_packets_.begin(); | 189 UnackedPacketMap::iterator it = unacked_packets_.begin(); |
190 while (it != unacked_packets_.end() && it->first <= largest_observed_) { | 190 while (it != unacked_packets_.end() && it->first <= largest_observed_) { |
191 if (!IsPacketUseless(it)) { | 191 if (!IsPacketUseless(it)) { |
192 ++it; | 192 ++it; |
193 continue; | 193 continue; |
194 } | 194 } |
195 delete it->second.all_transmissions; | 195 delete it->second.all_transmissions; |
196 QuicPacketSequenceNumber sequence_number = it->first; | 196 QuicPacketSequenceNumber sequence_number = it->first; |
197 ++it; | 197 ++it; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } | 345 } |
346 DCHECK(!it->second.in_flight); | 346 DCHECK(!it->second.in_flight); |
347 DCHECK_NE(0u, it->second.bytes_sent); | 347 DCHECK_NE(0u, it->second.bytes_sent); |
348 DCHECK(it->second.sent_time.IsInitialized()); | 348 DCHECK(it->second.sent_time.IsInitialized()); |
349 | 349 |
350 bytes_in_flight_ += it->second.bytes_sent; | 350 bytes_in_flight_ += it->second.bytes_sent; |
351 it->second.in_flight = true; | 351 it->second.in_flight = true; |
352 } | 352 } |
353 | 353 |
354 } // namespace net | 354 } // namespace net |
OLD | NEW |