Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Unified Diff: net/quic/congestion_control/rtt_stats.cc

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/rtt_stats.h ('k') | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..86eb3abb7e70ae01445cefd113c0d0b6d0bbcca0 100644
--- a/net/quic/congestion_control/rtt_stats.cc
+++ b/net/quic/congestion_control/rtt_stats.cc
@@ -37,7 +37,8 @@ RttStats::RttStats()
num_samples_for_forced_min_(0),
windowed_min_rtt_(
QuicTime::Delta::FromMilliseconds(kMinRttWindowLengthMs),
- QuicTime::Delta::Zero()) {}
+ QuicTime::Delta::Zero(),
+ QuicTime::Zero()) {}
void RttStats::SampleNewWindowedMinRtt(uint32_t num_samples) {
num_samples_for_forced_min_ = num_samples;
@@ -46,10 +47,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 +80,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 +91,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();
}
« no previous file with comments | « net/quic/congestion_control/rtt_stats.h ('k') | net/quic/congestion_control/rtt_stats_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698