OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_received_packet_manager.h" | 5 #include "net/quic/quic_received_packet_manager.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/base/linked_hash_map.h" | 9 #include "net/base/linked_hash_map.h" |
10 #include "net/quic/quic_connection_stats.h" | 10 #include "net/quic/quic_connection_stats.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 if (sequence_number > received_info_.largest_observed) { | 172 if (sequence_number > received_info_.largest_observed) { |
173 received_info_.largest_observed = sequence_number; | 173 received_info_.largest_observed = sequence_number; |
174 time_largest_observed_ = receipt_time; | 174 time_largest_observed_ = receipt_time; |
175 } | 175 } |
176 entropy_tracker_.RecordPacketEntropyHash(sequence_number, | 176 entropy_tracker_.RecordPacketEntropyHash(sequence_number, |
177 header.entropy_hash); | 177 header.entropy_hash); |
178 | 178 |
179 receive_algorithm_->RecordIncomingPacket( | 179 receive_algorithm_->RecordIncomingPacket( |
180 bytes, sequence_number, receipt_time); | 180 bytes, sequence_number, receipt_time); |
| 181 |
| 182 received_info_.revived_packets.erase(sequence_number); |
181 } | 183 } |
182 | 184 |
183 void QuicReceivedPacketManager::RecordPacketRevived( | 185 void QuicReceivedPacketManager::RecordPacketRevived( |
184 QuicPacketSequenceNumber sequence_number) { | 186 QuicPacketSequenceNumber sequence_number) { |
185 LOG_IF(DFATAL, !IsAwaitingPacket(sequence_number)); | 187 LOG_IF(DFATAL, !IsAwaitingPacket(sequence_number)); |
186 received_info_.revived_packets.insert(sequence_number); | 188 received_info_.revived_packets.insert(sequence_number); |
187 } | 189 } |
188 | 190 |
189 bool QuicReceivedPacketManager::IsMissing( | 191 bool QuicReceivedPacketManager::IsMissing( |
190 QuicPacketSequenceNumber sequence_number) { | 192 QuicPacketSequenceNumber sequence_number) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 return !received_info_.missing_packets.empty(); | 279 return !received_info_.missing_packets.empty(); |
278 } | 280 } |
279 | 281 |
280 bool QuicReceivedPacketManager::HasNewMissingPackets() { | 282 bool QuicReceivedPacketManager::HasNewMissingPackets() { |
281 return HasMissingPackets() && | 283 return HasMissingPackets() && |
282 (received_info_.largest_observed - | 284 (received_info_.largest_observed - |
283 *received_info_.missing_packets.rbegin()) <= kMaxPacketsAfterNewMissing; | 285 *received_info_.missing_packets.rbegin()) <= kMaxPacketsAfterNewMissing; |
284 } | 286 } |
285 | 287 |
286 } // namespace net | 288 } // namespace net |
OLD | NEW |