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_sent_packet_manager.h" | 5 #include "net/quic/core/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/quic/chromium/quic_utils_chromium.h" | 10 #include "net/quic/chromium/quic_utils_chromium.h" |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 return delay; | 774 return delay; |
775 } | 775 } |
776 | 776 |
777 const QuicTime QuicSentPacketManager::GetRetransmissionTime() const { | 777 const QuicTime QuicSentPacketManager::GetRetransmissionTime() const { |
778 // Don't set the timer if there is nothing to retransmit or we've already | 778 // Don't set the timer if there is nothing to retransmit or we've already |
779 // queued a tlp transmission and it hasn't been sent yet. | 779 // queued a tlp transmission and it hasn't been sent yet. |
780 if (!unacked_packets_.HasInFlightPackets() || | 780 if (!unacked_packets_.HasInFlightPackets() || |
781 pending_timer_transmission_count_ > 0) { | 781 pending_timer_transmission_count_ > 0) { |
782 return QuicTime::Zero(); | 782 return QuicTime::Zero(); |
783 } | 783 } |
784 if (FLAGS_quic_reloadable_flag_quic_more_conservative_retransmission_alarm && | 784 if (!unacked_packets_.HasUnackedRetransmittableFrames()) { |
785 !unacked_packets_.HasUnackedRetransmittableFrames()) { | |
786 return QuicTime::Zero(); | 785 return QuicTime::Zero(); |
787 } | 786 } |
788 switch (GetRetransmissionMode()) { | 787 switch (GetRetransmissionMode()) { |
789 case HANDSHAKE_MODE: | 788 case HANDSHAKE_MODE: |
790 return clock_->ApproximateNow() + GetCryptoRetransmissionDelay(); | 789 return clock_->ApproximateNow() + GetCryptoRetransmissionDelay(); |
791 case LOSS_MODE: | 790 case LOSS_MODE: |
792 return loss_algorithm_->GetLossTimeout(); | 791 return loss_algorithm_->GetLossTimeout(); |
793 case TLP_MODE: { | 792 case TLP_MODE: { |
794 // TODO(ianswett): When CWND is available, it would be preferable to | 793 // TODO(ianswett): When CWND is available, it would be preferable to |
795 // set the timer based on the earliest retransmittable packet. | 794 // set the timer based on the earliest retransmittable packet. |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 990 |
992 void QuicSentPacketManager::OnApplicationLimited() { | 991 void QuicSentPacketManager::OnApplicationLimited() { |
993 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); | 992 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); |
994 } | 993 } |
995 | 994 |
996 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { | 995 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { |
997 return send_algorithm_.get(); | 996 return send_algorithm_.get(); |
998 } | 997 } |
999 | 998 |
1000 } // namespace net | 999 } // namespace net |
OLD | NEW |