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/congestion_control/tcp_loss_algorithm.h" | 5 #include "net/quic/congestion_control/tcp_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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Uses nack counts to decide when packets are lost. | 25 // Uses nack counts to decide when packets are lost. |
26 SequenceNumberSet TCPLossAlgorithm::DetectLostPackets( | 26 SequenceNumberSet TCPLossAlgorithm::DetectLostPackets( |
27 const QuicUnackedPacketMap& unacked_packets, | 27 const QuicUnackedPacketMap& unacked_packets, |
28 const QuicTime& time, | 28 const QuicTime& time, |
29 QuicPacketSequenceNumber largest_observed, | 29 QuicPacketSequenceNumber largest_observed, |
30 const RttStats& rtt_stats) { | 30 const RttStats& rtt_stats) { |
31 SequenceNumberSet lost_packets; | 31 SequenceNumberSet lost_packets; |
32 loss_detection_timeout_ = QuicTime::Zero(); | 32 loss_detection_timeout_ = QuicTime::Zero(); |
33 QuicTime::Delta loss_delay = | 33 QuicTime::Delta loss_delay = |
34 rtt_stats.SmoothedRtt().Multiply(kEarlyRetransmitLossDelayMultiplier); | 34 rtt_stats.smoothed_rtt().Multiply(kEarlyRetransmitLossDelayMultiplier); |
35 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); | 35 QuicPacketSequenceNumber sequence_number = unacked_packets.GetLeastUnacked(); |
36 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); | 36 for (QuicUnackedPacketMap::const_iterator it = unacked_packets.begin(); |
37 it != unacked_packets.end() && sequence_number <= largest_observed; | 37 it != unacked_packets.end() && sequence_number <= largest_observed; |
38 ++it, ++sequence_number) { | 38 ++it, ++sequence_number) { |
39 if (!it->in_flight) { | 39 if (!it->in_flight) { |
40 continue; | 40 continue; |
41 } | 41 } |
42 | 42 |
43 LOG_IF(DFATAL, it->nack_count == 0) | 43 LOG_IF(DFATAL, it->nack_count == 0) |
44 << "All packets less than largest observed should have been nacked." | 44 << "All packets less than largest observed should have been nacked." |
(...skipping 23 matching lines...) Expand all Loading... |
68 } | 68 } |
69 | 69 |
70 return lost_packets; | 70 return lost_packets; |
71 } | 71 } |
72 | 72 |
73 QuicTime TCPLossAlgorithm::GetLossTimeout() const { | 73 QuicTime TCPLossAlgorithm::GetLossTimeout() const { |
74 return loss_detection_timeout_; | 74 return loss_detection_timeout_; |
75 } | 75 } |
76 | 76 |
77 } // namespace net | 77 } // namespace net |
OLD | NEW |