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

Side by Side Diff: net/quic/congestion_control/time_loss_algorithm.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
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/congestion_control/time_loss_algorithm.h" 5 #include "net/quic/congestion_control/time_loss_algorithm.h"
6 6
7 #include "net/quic/congestion_control/rtt_stats.h" 7 #include "net/quic/congestion_control/rtt_stats.h"
8 #include "net/quic/quic_protocol.h" 8 #include "net/quic/quic_protocol.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 28 matching lines...) Expand all
39 QuicTime::Delta::Max(rtt_stats.smoothed_rtt(), rtt_stats.latest_rtt()) 39 QuicTime::Delta::Max(rtt_stats.smoothed_rtt(), rtt_stats.latest_rtt())
40 .Multiply(kLossDelayMultiplier)); 40 .Multiply(kLossDelayMultiplier));
41 41
42 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); 42 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked();
43 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); 43 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin();
44 it != unacked_packets.end() && sequence_number <= largest_observed; 44 it != unacked_packets.end() && sequence_number <= largest_observed;
45 ++it, ++sequence_number) { 45 ++it, ++sequence_number) {
46 if (!it->in_flight) { 46 if (!it->in_flight) {
47 continue; 47 continue;
48 } 48 }
49 LOG_IF(DFATAL, it->nack_count == 0) 49 LOG_IF(DFATAL, it->nack_count == 0 && it->sent_time.IsInitialized())
50 << "All packets less than largest observed should have been nacked."; 50 << "All packets less than largest observed should have been nacked."
51 << "sequence_number:" << sequence_number
52 << " largest_observed:" << largest_observed;
51 53
52 // Packets are sent in order, so break when we haven't waited long enough 54 // Packets are sent in order, so break when we haven't waited long enough
53 // to lose any more packets and leave the loss_time_ set for the timeout. 55 // to lose any more packets and leave the loss_time_ set for the timeout.
54 QuicTime when_lost = it->sent_time.Add(loss_delay); 56 QuicTime when_lost = it->sent_time.Add(loss_delay);
55 if (time < when_lost) { 57 if (time < when_lost) {
56 loss_detection_timeout_ = when_lost; 58 loss_detection_timeout_ = when_lost;
57 break; 59 break;
58 } 60 }
59 lost_packets.insert(sequence_number); 61 lost_packets.insert(sequence_number);
60 } 62 }
61 63
62 return lost_packets; 64 return lost_packets;
63 } 65 }
64 66
65 // loss_time_ is updated in DetectLostPackets, which must be called every time 67 // loss_time_ is updated in DetectLostPackets, which must be called every time
66 // an ack is received or the timeout expires. 68 // an ack is received or the timeout expires.
67 QuicTime TimeLossAlgorithm::GetLossTimeout() const { 69 QuicTime TimeLossAlgorithm::GetLossTimeout() const {
68 return loss_detection_timeout_; 70 return loss_detection_timeout_;
69 } 71 }
70 72
71 } // namespace net 73 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm_test.cc ('k') | net/quic/congestion_control/time_loss_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698