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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 // set the timer based on the earliest retransmittable packet. | 841 // set the timer based on the earliest retransmittable packet. |
842 // Base the updated timer on the send time of the last packet. | 842 // Base the updated timer on the send time of the last packet. |
843 const QuicTime sent_time = unacked_packets_.GetLastPacketSentTime(); | 843 const QuicTime sent_time = unacked_packets_.GetLastPacketSentTime(); |
844 const QuicTime tlp_time = sent_time.Add(GetTailLossProbeDelay()); | 844 const QuicTime tlp_time = sent_time.Add(GetTailLossProbeDelay()); |
845 // Ensure the TLP timer never gets set to a time in the past. | 845 // Ensure the TLP timer never gets set to a time in the past. |
846 return QuicTime::Max(clock_->ApproximateNow(), tlp_time); | 846 return QuicTime::Max(clock_->ApproximateNow(), tlp_time); |
847 } | 847 } |
848 case RTO_MODE: { | 848 case RTO_MODE: { |
849 // The RTO is based on the first outstanding packet. | 849 // The RTO is based on the first outstanding packet. |
850 const QuicTime sent_time = | 850 const QuicTime sent_time = |
851 unacked_packets_.GetFirstInFlightPacketSentTime(); | 851 FLAGS_quic_rto_uses_last_sent |
| 852 ? unacked_packets_.GetLastPacketSentTime() |
| 853 : unacked_packets_.GetFirstInFlightPacketSentTime(); |
852 QuicTime rto_time = sent_time.Add(GetRetransmissionDelay()); | 854 QuicTime rto_time = sent_time.Add(GetRetransmissionDelay()); |
853 // Wait for TLP packets to be acked before an RTO fires. | 855 // Wait for TLP packets to be acked before an RTO fires. |
854 QuicTime tlp_time = | 856 QuicTime tlp_time = |
855 unacked_packets_.GetLastPacketSentTime().Add(GetTailLossProbeDelay()); | 857 unacked_packets_.GetLastPacketSentTime().Add(GetTailLossProbeDelay()); |
856 return QuicTime::Max(tlp_time, rto_time); | 858 return QuicTime::Max(tlp_time, rto_time); |
857 } | 859 } |
858 } | 860 } |
859 DCHECK(false); | 861 DCHECK(false); |
860 return QuicTime::Zero(); | 862 return QuicTime::Zero(); |
861 } | 863 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 953 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
952 // the default granularity of the Linux kernel's FQ qdisc. | 954 // the default granularity of the Linux kernel's FQ qdisc. |
953 using_pacing_ = true; | 955 using_pacing_ = true; |
954 send_algorithm_.reset( | 956 send_algorithm_.reset( |
955 new PacingSender(send_algorithm_.release(), | 957 new PacingSender(send_algorithm_.release(), |
956 QuicTime::Delta::FromMilliseconds(1), | 958 QuicTime::Delta::FromMilliseconds(1), |
957 kInitialUnpacedBurst)); | 959 kInitialUnpacedBurst)); |
958 } | 960 } |
959 | 961 |
960 } // namespace net | 962 } // namespace net |
OLD | NEW |