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/core/quic_received_packet_manager.h" | 5 #include "net/quic/core/quic_received_packet_manager.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 ack_frame_.ack_delay_time = approximate_now < time_largest_observed_ | 233 ack_frame_.ack_delay_time = approximate_now < time_largest_observed_ |
234 ? QuicTime::Delta::Zero() | 234 ? QuicTime::Delta::Zero() |
235 : approximate_now - time_largest_observed_; | 235 : approximate_now - time_largest_observed_; |
236 } | 236 } |
237 | 237 |
238 // Clear all packet times if any are too far from largest observed. | 238 // Clear all packet times if any are too far from largest observed. |
239 // It's expected this is extremely rare. | 239 // It's expected this is extremely rare. |
240 for (PacketTimeVector::iterator it = ack_frame_.received_packet_times.begin(); | 240 for (PacketTimeVector::iterator it = ack_frame_.received_packet_times.begin(); |
241 it != ack_frame_.received_packet_times.end();) { | 241 it != ack_frame_.received_packet_times.end();) { |
242 if (ack_frame_.largest_observed - it->first >= | 242 if (ack_frame_.largest_observed - it->first >= |
243 numeric_limits<uint8_t>::max()) { | 243 std::numeric_limits<uint8_t>::max()) { |
244 it = ack_frame_.received_packet_times.erase(it); | 244 it = ack_frame_.received_packet_times.erase(it); |
245 } else { | 245 } else { |
246 ++it; | 246 ++it; |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 return QuicFrame(&ack_frame_); | 250 return QuicFrame(&ack_frame_); |
251 } | 251 } |
252 | 252 |
253 QuicPacketEntropyHash QuicReceivedPacketManager::EntropyHash( | 253 QuicPacketEntropyHash QuicReceivedPacketManager::EntropyHash( |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 bool QuicReceivedPacketManager::ack_frame_updated() const { | 317 bool QuicReceivedPacketManager::ack_frame_updated() const { |
318 return ack_frame_updated_; | 318 return ack_frame_updated_; |
319 } | 319 } |
320 | 320 |
321 QuicPacketNumber QuicReceivedPacketManager::GetLargestObserved() const { | 321 QuicPacketNumber QuicReceivedPacketManager::GetLargestObserved() const { |
322 return ack_frame_.largest_observed; | 322 return ack_frame_.largest_observed; |
323 } | 323 } |
324 | 324 |
325 } // namespace net | 325 } // namespace net |
OLD | NEW |