Index: net/quic/congestion_control/inter_arrival_sender.cc |
diff --git a/net/quic/congestion_control/inter_arrival_sender.cc b/net/quic/congestion_control/inter_arrival_sender.cc |
index 1b86b639501e7d9014af7e879565e7d337564640..b0698ac80a94889f0e385804a95d5c56e637490e 100644 |
--- a/net/quic/congestion_control/inter_arrival_sender.cc |
+++ b/net/quic/congestion_control/inter_arrival_sender.cc |
@@ -216,27 +216,10 @@ bool InterArrivalSender::ProbingPhase(QuicTime feedback_receive_time) { |
void InterArrivalSender::OnPacketAcked( |
QuicPacketSequenceNumber /*acked_sequence_number*/, |
- QuicByteCount acked_bytes, |
- QuicTime::Delta rtt) { |
- // RTT can't be negative. |
- DCHECK_LE(0, rtt.ToMicroseconds()); |
- |
+ QuicByteCount acked_bytes) { |
if (probing_) { |
probe_->OnAcknowledgedPacket(acked_bytes); |
} |
- |
- if (rtt.IsInfinite()) { |
- return; |
- } |
- |
- if (smoothed_rtt_.IsZero()) { |
- smoothed_rtt_ = rtt; |
- } else { |
- smoothed_rtt_ = QuicTime::Delta::FromMicroseconds( |
- kOneMinusAlpha * smoothed_rtt_.ToMicroseconds() + |
- kAlpha * rtt.ToMicroseconds()); |
- } |
- state_machine_->set_rtt(smoothed_rtt_); |
} |
void InterArrivalSender::OnPacketLost( |
@@ -337,6 +320,24 @@ QuicBandwidth InterArrivalSender::BandwidthEstimate() const { |
return current_bandwidth_; |
} |
+void InterArrivalSender::UpdateRtt(QuicTime::Delta rtt) { |
+ // RTT can't be negative. |
+ DCHECK_LE(0, rtt.ToMicroseconds()); |
+ |
+ if (rtt.IsInfinite()) { |
+ return; |
+ } |
+ |
+ if (smoothed_rtt_.IsZero()) { |
+ smoothed_rtt_ = rtt; |
+ } else { |
+ smoothed_rtt_ = QuicTime::Delta::FromMicroseconds( |
+ kOneMinusAlpha * smoothed_rtt_.ToMicroseconds() + |
+ kAlpha * rtt.ToMicroseconds()); |
+ } |
+ state_machine_->set_rtt(smoothed_rtt_); |
+} |
+ |
QuicTime::Delta InterArrivalSender::SmoothedRtt() const { |
if (smoothed_rtt_.IsZero()) { |
return QuicTime::Delta::FromMilliseconds(kInitialRttMs); |