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

Side by Side Diff: net/nqe/network_quality_estimator.cc

Issue 2705273002: Throttle Socket watcher RTT notifications from QUIC (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/net.gypi ('k') | net/nqe/network_quality_estimator_params.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/nqe/network_quality_estimator.h" 5 #include "net/nqe/network_quality_estimator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 AddDefaultEstimates(); 310 AddDefaultEstimates();
311 311
312 throughput_analyzer_.reset(new nqe::internal::ThroughputAnalyzer( 312 throughput_analyzer_.reset(new nqe::internal::ThroughputAnalyzer(
313 base::ThreadTaskRunnerHandle::Get(), 313 base::ThreadTaskRunnerHandle::Get(),
314 base::Bind(&NetworkQualityEstimator::OnNewThroughputObservationAvailable, 314 base::Bind(&NetworkQualityEstimator::OnNewThroughputObservationAvailable,
315 base::Unretained(this)), 315 base::Unretained(this)),
316 use_localhost_requests_, use_smaller_responses_for_tests)); 316 use_localhost_requests_, use_smaller_responses_for_tests));
317 317
318 watcher_factory_.reset(new nqe::internal::SocketWatcherFactory( 318 watcher_factory_.reset(new nqe::internal::SocketWatcherFactory(
319 base::ThreadTaskRunnerHandle::Get(), 319 base::ThreadTaskRunnerHandle::Get(),
320 nqe::internal::GetMinSocketWatcherNotificationInterval(variation_params),
320 base::Bind(&NetworkQualityEstimator::OnUpdatedRTTAvailable, 321 base::Bind(&NetworkQualityEstimator::OnUpdatedRTTAvailable,
321 base::Unretained(this)))); 322 base::Unretained(this)),
323 tick_clock_.get()));
322 324
323 // Record accuracy after a 15 second interval. The values used here must 325 // Record accuracy after a 15 second interval. The values used here must
324 // remain in sync with the suffixes specified in 326 // remain in sync with the suffixes specified in
325 // tools/metrics/histograms/histograms.xml. 327 // tools/metrics/histograms/histograms.xml.
326 accuracy_recording_intervals_.push_back(base::TimeDelta::FromSeconds(15)); 328 accuracy_recording_intervals_.push_back(base::TimeDelta::FromSeconds(15));
327 } 329 }
328 330
329 void NetworkQualityEstimator::ObtainOperatingParams( 331 void NetworkQualityEstimator::ObtainOperatingParams(
330 const std::map<std::string, std::string>& variation_params) { 332 const std::map<std::string, std::string>& variation_params) {
331 DCHECK(thread_checker_.CalledOnValidThread()); 333 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); 1702 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE);
1701 downstream_throughput_kbps_observations_.AddObservation( 1703 downstream_throughput_kbps_observations_.AddObservation(
1702 throughput_observation); 1704 throughput_observation);
1703 NotifyObserversOfThroughput(throughput_observation); 1705 NotifyObserversOfThroughput(throughput_observation);
1704 } 1706 }
1705 1707
1706 ComputeEffectiveConnectionType(); 1708 ComputeEffectiveConnectionType();
1707 } 1709 }
1708 1710
1709 } // namespace net 1711 } // namespace net
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/nqe/network_quality_estimator_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698