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

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

Issue 990533002: Land Recent QUIC Changes until 03/06/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/reliable_quic_stream.h » ('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 #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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 LOG_IF(DFATAL, it->sent_time == QuicTime::Zero()) 320 LOG_IF(DFATAL, it->sent_time == QuicTime::Zero())
321 << "Sent time can never be zero for a packet in flight."; 321 << "Sent time can never be zero for a packet in flight.";
322 return it->sent_time; 322 return it->sent_time;
323 } 323 }
324 ++it; 324 ++it;
325 } 325 }
326 LOG(DFATAL) << "GetLastPacketSentTime requires in flight packets."; 326 LOG(DFATAL) << "GetLastPacketSentTime requires in flight packets.";
327 return QuicTime::Zero(); 327 return QuicTime::Zero();
328 } 328 }
329 329
330 QuicTime QuicUnackedPacketMap::GetFirstInFlightPacketSentTime() const {
331 UnackedPacketMap::const_iterator it = unacked_packets_.begin();
332 while (it != unacked_packets_.end() && !it->in_flight) {
333 ++it;
334 }
335 if (it == unacked_packets_.end()) {
336 LOG(DFATAL) << "GetFirstInFlightPacketSentTime requires in flight packets.";
337 return QuicTime::Zero();
338 }
339 return it->sent_time;
340 }
341
342 size_t QuicUnackedPacketMap::GetNumUnackedPacketsDebugOnly() const { 330 size_t QuicUnackedPacketMap::GetNumUnackedPacketsDebugOnly() const {
343 size_t unacked_packet_count = 0; 331 size_t unacked_packet_count = 0;
344 QuicPacketSequenceNumber sequence_number = least_unacked_; 332 QuicPacketSequenceNumber sequence_number = least_unacked_;
345 for (UnackedPacketMap::const_iterator it = unacked_packets_.begin(); 333 for (UnackedPacketMap::const_iterator it = unacked_packets_.begin();
346 it != unacked_packets_.end(); ++it, ++sequence_number) { 334 it != unacked_packets_.end(); ++it, ++sequence_number) {
347 if (!IsPacketUseless(sequence_number, *it)) { 335 if (!IsPacketUseless(sequence_number, *it)) {
348 ++unacked_packet_count; 336 ++unacked_packet_count;
349 } 337 }
350 } 338 }
351 return unacked_packet_count; 339 return unacked_packet_count;
(...skipping 25 matching lines...) Expand all
377 } 365 }
378 } 366 }
379 return false; 367 return false;
380 } 368 }
381 369
382 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const { 370 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const {
383 return least_unacked_; 371 return least_unacked_;
384 } 372 }
385 373
386 } // namespace net 374 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698