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

Unified Diff: net/quic/quic_sustained_bandwidth_recorder.cc

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc 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/quic_sustained_bandwidth_recorder.h ('k') | net/quic/quic_sustained_bandwidth_recorder_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sustained_bandwidth_recorder.cc
diff --git a/net/quic/quic_sustained_bandwidth_recorder.cc b/net/quic/quic_sustained_bandwidth_recorder.cc
deleted file mode 100644
index b4b4a6168c630910dd6ca3250d0233d2a7c026ec..0000000000000000000000000000000000000000
--- a/net/quic/quic_sustained_bandwidth_recorder.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/quic_sustained_bandwidth_recorder.h"
-
-#include "base/logging.h"
-#include "net/quic/quic_bandwidth.h"
-#include "net/quic/quic_time.h"
-
-namespace net {
-
-QuicSustainedBandwidthRecorder::QuicSustainedBandwidthRecorder()
- : has_estimate_(false),
- is_recording_(false),
- bandwidth_estimate_recorded_during_slow_start_(false),
- bandwidth_estimate_(QuicBandwidth::Zero()),
- max_bandwidth_estimate_(QuicBandwidth::Zero()),
- max_bandwidth_timestamp_(0),
- start_time_(QuicTime::Zero()) {}
-
-void QuicSustainedBandwidthRecorder::RecordEstimate(bool in_recovery,
- bool in_slow_start,
- QuicBandwidth bandwidth,
- QuicTime estimate_time,
- QuicWallTime wall_time,
- QuicTime::Delta srtt) {
- if (in_recovery) {
- is_recording_ = false;
- DVLOG(1) << "Stopped recording at: " << estimate_time.ToDebuggingValue();
- return;
- }
-
- if (!is_recording_) {
- // This is the first estimate of a new recording period.
- start_time_ = estimate_time;
- is_recording_ = true;
- DVLOG(1) << "Started recording at: " << start_time_.ToDebuggingValue();
- return;
- }
-
- // If we have been recording for at least 3 * srtt, then record the latest
- // bandwidth estimate as a valid sustained bandwidth estimate.
- if (estimate_time - start_time_ >= 3 * srtt) {
- has_estimate_ = true;
- bandwidth_estimate_recorded_during_slow_start_ = in_slow_start;
- bandwidth_estimate_ = bandwidth;
- DVLOG(1) << "New sustained bandwidth estimate (KBytes/s): "
- << bandwidth_estimate_.ToKBytesPerSecond();
- }
-
- // Check for an increase in max bandwidth.
- if (bandwidth > max_bandwidth_estimate_) {
- max_bandwidth_estimate_ = bandwidth;
- max_bandwidth_timestamp_ = wall_time.ToUNIXSeconds();
- DVLOG(1) << "New max bandwidth estimate (KBytes/s): "
- << max_bandwidth_estimate_.ToKBytesPerSecond();
- }
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_sustained_bandwidth_recorder.h ('k') | net/quic/quic_sustained_bandwidth_recorder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698