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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 // Since we will not retransmit this, we need to remove it from | 720 // Since we will not retransmit this, we need to remove it from |
721 // unacked_packets_. This is either the current transmission of | 721 // unacked_packets_. This is either the current transmission of |
722 // a packet whose previous transmission has been acked or a packet that | 722 // a packet whose previous transmission has been acked or a packet that |
723 // has been TLP retransmitted. | 723 // has been TLP retransmitted. |
724 unacked_packets_.RemoveFromInFlight(pair.first); | 724 unacked_packets_.RemoveFromInFlight(pair.first); |
725 } | 725 } |
726 } | 726 } |
727 } | 727 } |
728 | 728 |
729 bool QuicSentPacketManager::MaybeUpdateRTT(const QuicAckFrame& ack_frame, | 729 bool QuicSentPacketManager::MaybeUpdateRTT(const QuicAckFrame& ack_frame, |
730 const QuicTime& ack_receive_time) { | 730 QuicTime ack_receive_time) { |
731 // We rely on ack_delay_time to compute an RTT estimate, so we | 731 // We rely on ack_delay_time to compute an RTT estimate, so we |
732 // only update rtt when the largest observed gets acked. | 732 // only update rtt when the largest observed gets acked. |
733 // NOTE: If ack is a truncated ack, then the largest observed is in fact | 733 // NOTE: If ack is a truncated ack, then the largest observed is in fact |
734 // unacked, and may cause an RTT sample to be taken. | 734 // unacked, and may cause an RTT sample to be taken. |
735 if (!unacked_packets_.IsUnacked(ack_frame.largest_observed)) { | 735 if (!unacked_packets_.IsUnacked(ack_frame.largest_observed)) { |
736 return false; | 736 return false; |
737 } | 737 } |
738 // We calculate the RTT based on the highest ACKed packet number, the lower | 738 // We calculate the RTT based on the highest ACKed packet number, the lower |
739 // packet numbers will include the ACK aggregation delay. | 739 // packet numbers will include the ACK aggregation delay. |
740 const TransmissionInfo& transmission_info = | 740 const TransmissionInfo& transmission_info = |
(...skipping 220 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 |