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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 758 } |
759 | 759 |
760 QuicTime::Delta QuicSentPacketManager::TimeUntilSend( | 760 QuicTime::Delta QuicSentPacketManager::TimeUntilSend( |
761 QuicTime now, | 761 QuicTime now, |
762 HasRetransmittableData retransmittable) { | 762 HasRetransmittableData retransmittable) { |
763 // The TLP logic is entirely contained within QuicSentPacketManager, so the | 763 // The TLP logic is entirely contained within QuicSentPacketManager, so the |
764 // send algorithm does not need to be consulted. | 764 // send algorithm does not need to be consulted. |
765 if (pending_timer_transmission_count_ > 0) { | 765 if (pending_timer_transmission_count_ > 0) { |
766 return QuicTime::Delta::Zero(); | 766 return QuicTime::Delta::Zero(); |
767 } | 767 } |
768 return send_algorithm_->TimeUntilSend(now, unacked_packets_.bytes_in_flight(), | 768 return send_algorithm_->TimeUntilSend(now, |
769 retransmittable); | 769 unacked_packets_.bytes_in_flight()); |
770 } | 770 } |
771 | 771 |
772 // Uses a 25ms delayed ack timer. Also helps with better signaling | 772 // Uses a 25ms delayed ack timer. Also helps with better signaling |
773 // in low-bandwidth (< ~384 kbps), where an ack is sent per packet. | 773 // in low-bandwidth (< ~384 kbps), where an ack is sent per packet. |
774 // Ensures that the Delayed Ack timer is always set to a value lesser | 774 // Ensures that the Delayed Ack timer is always set to a value lesser |
775 // than the retransmission timer's minimum value (MinRTO). We want the | 775 // than the retransmission timer's minimum value (MinRTO). We want the |
776 // delayed ack to get back to the QUIC peer before the sender's | 776 // delayed ack to get back to the QUIC peer before the sender's |
777 // retransmission timer triggers. Since we do not know the | 777 // retransmission timer triggers. Since we do not know the |
778 // reverse-path one-way delay, we assume equal delays for forward and | 778 // reverse-path one-way delay, we assume equal delays for forward and |
779 // reverse paths, and ensure that the timer is set to less than half | 779 // reverse paths, and ensure that the timer is set to less than half |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( | 961 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( |
962 QuicPacketNumber packet_number) { | 962 QuicPacketNumber packet_number) { |
963 return unacked_packets_.GetMutableTransmissionInfo(packet_number); | 963 return unacked_packets_.GetMutableTransmissionInfo(packet_number); |
964 } | 964 } |
965 | 965 |
966 void QuicSentPacketManager::RemoveObsoletePackets() { | 966 void QuicSentPacketManager::RemoveObsoletePackets() { |
967 unacked_packets_.RemoveObsoletePackets(); | 967 unacked_packets_.RemoveObsoletePackets(); |
968 } | 968 } |
969 | 969 |
970 } // namespace net | 970 } // namespace net |
OLD | NEW |