Chromium Code Reviews| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 bool QuicSentPacketManager::MaybeUpdateRTT( | 713 bool QuicSentPacketManager::MaybeUpdateRTT( |
| 714 const QuicAckFrame& ack_frame, | 714 const QuicAckFrame& ack_frame, |
| 715 const QuicTime& ack_receive_time) { | 715 const QuicTime& ack_receive_time) { |
| 716 if (!unacked_packets_.IsUnacked(ack_frame.largest_observed)) { | 716 if (!unacked_packets_.IsUnacked(ack_frame.largest_observed)) { |
| 717 return false; | 717 return false; |
| 718 } | 718 } |
| 719 // We calculate the RTT based on the highest ACKed sequence number, the lower | 719 // We calculate the RTT based on the highest ACKed sequence number, the lower |
| 720 // sequence numbers will include the ACK aggregation delay. | 720 // sequence numbers will include the ACK aggregation delay. |
| 721 const TransmissionInfo& transmission_info = | 721 const TransmissionInfo& transmission_info = |
| 722 unacked_packets_.GetTransmissionInfo(ack_frame.largest_observed); | 722 unacked_packets_.GetTransmissionInfo(ack_frame.largest_observed); |
| 723 // Don't update the RTT if it hasn't been sent. | 723 // Ensure the packet has a valid sent time. |
| 724 if (transmission_info.sent_time == QuicTime::Zero()) { | 724 if (transmission_info.sent_time == QuicTime::Zero()) { |
| 725 LOG(DFATAL) << "Acked packet has zero sent time, largest_observed:" | |
|
ramant (doing other things)
2014/09/15 19:56:44
rch, ian: should we make this DLOG(DFATAL) in chro
Ryan Hamilton
2014/09/15 21:44:54
I don't have strong feelings about LOG(DFATAL) vs
ramant (doing other things)
2014/09/15 21:47:50
Sounds great.
| |
| 726 << ack_frame.largest_observed; | |
| 725 return false; | 727 return false; |
| 726 } | 728 } |
| 727 | 729 |
| 728 QuicTime::Delta send_delta = | 730 QuicTime::Delta send_delta = |
| 729 ack_receive_time.Subtract(transmission_info.sent_time); | 731 ack_receive_time.Subtract(transmission_info.sent_time); |
| 730 rtt_stats_.UpdateRtt( | 732 rtt_stats_.UpdateRtt( |
| 731 send_delta, ack_frame.delta_time_largest_observed, ack_receive_time); | 733 send_delta, ack_frame.delta_time_largest_observed, ack_receive_time); |
| 732 return true; | 734 return true; |
| 733 } | 735 } |
| 734 | 736 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 875 | 877 |
| 876 // Set up a pacing sender with a 5 millisecond alarm granularity. | 878 // Set up a pacing sender with a 5 millisecond alarm granularity. |
| 877 using_pacing_ = true; | 879 using_pacing_ = true; |
| 878 send_algorithm_.reset( | 880 send_algorithm_.reset( |
| 879 new PacingSender(send_algorithm_.release(), | 881 new PacingSender(send_algorithm_.release(), |
| 880 QuicTime::Delta::FromMilliseconds(5), | 882 QuicTime::Delta::FromMilliseconds(5), |
| 881 kInitialUnpacedBurst)); | 883 kInitialUnpacedBurst)); |
| 882 } | 884 } |
| 883 | 885 |
| 884 } // namespace net | 886 } // namespace net |
| OLD | NEW |