| Index: net/quic/congestion_control/rtt_stats.cc
|
| diff --git a/net/quic/congestion_control/rtt_stats.cc b/net/quic/congestion_control/rtt_stats.cc
|
| index 4809f1ad510786c1c540e891c36e8193028cb44a..9d31caaa3889d7528508c6e2c6990c7a2abd337d 100644
|
| --- a/net/quic/congestion_control/rtt_stats.cc
|
| +++ b/net/quic/congestion_control/rtt_stats.cc
|
| @@ -46,10 +46,9 @@ void RttStats::SampleNewWindowedMinRtt(uint32_t num_samples) {
|
| }
|
|
|
| void RttStats::ExpireSmoothedMetrics() {
|
| - mean_deviation_ =
|
| - max(mean_deviation_,
|
| - QuicTime::Delta::FromMicroseconds(
|
| - std::abs(smoothed_rtt_.Subtract(latest_rtt_).ToMicroseconds())));
|
| + mean_deviation_ = max(mean_deviation_,
|
| + QuicTime::Delta::FromMicroseconds(std::abs(
|
| + (smoothed_rtt_ - latest_rtt_).ToMicroseconds())));
|
| smoothed_rtt_ = max(smoothed_rtt_, latest_rtt_);
|
| }
|
|
|
| @@ -80,7 +79,7 @@ void RttStats::UpdateRtt(QuicTime::Delta send_delta,
|
| previous_srtt_ = smoothed_rtt_;
|
|
|
| if (rtt_sample > ack_delay) {
|
| - rtt_sample = rtt_sample.Subtract(ack_delay);
|
| + rtt_sample = rtt_sample - ack_delay;
|
| }
|
| latest_rtt_ = rtt_sample;
|
| // First time call.
|
| @@ -91,9 +90,8 @@ void RttStats::UpdateRtt(QuicTime::Delta send_delta,
|
| } else {
|
| mean_deviation_ = QuicTime::Delta::FromMicroseconds(static_cast<int64_t>(
|
| kOneMinusBeta * mean_deviation_.ToMicroseconds() +
|
| - kBeta * std::abs(smoothed_rtt_.Subtract(rtt_sample).ToMicroseconds())));
|
| - smoothed_rtt_ =
|
| - smoothed_rtt_.Multiply(kOneMinusAlpha).Add(rtt_sample.Multiply(kAlpha));
|
| + kBeta * std::abs((smoothed_rtt_ - rtt_sample).ToMicroseconds())));
|
| + smoothed_rtt_ = kOneMinusAlpha * smoothed_rtt_ + kAlpha * rtt_sample;
|
| DVLOG(1) << " smoothed_rtt(us):" << smoothed_rtt_.ToMicroseconds()
|
| << " mean_deviation(us):" << mean_deviation_.ToMicroseconds();
|
| }
|
|
|