| OLD | NEW |
| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 AddDefaultEstimates(); | 319 AddDefaultEstimates(); |
| 320 | 320 |
| 321 throughput_analyzer_.reset(new nqe::internal::ThroughputAnalyzer( | 321 throughput_analyzer_.reset(new nqe::internal::ThroughputAnalyzer( |
| 322 base::ThreadTaskRunnerHandle::Get(), | 322 base::ThreadTaskRunnerHandle::Get(), |
| 323 base::Bind(&NetworkQualityEstimator::OnNewThroughputObservationAvailable, | 323 base::Bind(&NetworkQualityEstimator::OnNewThroughputObservationAvailable, |
| 324 base::Unretained(this)), | 324 base::Unretained(this)), |
| 325 use_localhost_requests_, use_smaller_responses_for_tests)); | 325 use_localhost_requests_, use_smaller_responses_for_tests)); |
| 326 | 326 |
| 327 watcher_factory_.reset(new nqe::internal::SocketWatcherFactory( | 327 watcher_factory_.reset(new nqe::internal::SocketWatcherFactory( |
| 328 base::ThreadTaskRunnerHandle::Get(), | 328 base::ThreadTaskRunnerHandle::Get(), |
| 329 nqe::internal::GetMinSocketWatcherNotificationInterval(variation_params), |
| 329 base::Bind(&NetworkQualityEstimator::OnUpdatedRTTAvailable, | 330 base::Bind(&NetworkQualityEstimator::OnUpdatedRTTAvailable, |
| 330 base::Unretained(this)))); | 331 base::Unretained(this)), |
| 332 tick_clock_.get())); |
| 331 | 333 |
| 332 // Record accuracy after a 15 second interval. The values used here must | 334 // Record accuracy after a 15 second interval. The values used here must |
| 333 // remain in sync with the suffixes specified in | 335 // remain in sync with the suffixes specified in |
| 334 // tools/metrics/histograms/histograms.xml. | 336 // tools/metrics/histograms/histograms.xml. |
| 335 accuracy_recording_intervals_.push_back(base::TimeDelta::FromSeconds(15)); | 337 accuracy_recording_intervals_.push_back(base::TimeDelta::FromSeconds(15)); |
| 336 } | 338 } |
| 337 | 339 |
| 338 void NetworkQualityEstimator::ObtainOperatingParams( | 340 void NetworkQualityEstimator::ObtainOperatingParams( |
| 339 const std::map<std::string, std::string>& variation_params) { | 341 const std::map<std::string, std::string>& variation_params) { |
| 340 DCHECK(thread_checker_.CalledOnValidThread()); | 342 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); | 1749 NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); |
| 1748 downstream_throughput_kbps_observations_.AddObservation( | 1750 downstream_throughput_kbps_observations_.AddObservation( |
| 1749 throughput_observation); | 1751 throughput_observation); |
| 1750 NotifyObserversOfThroughput(throughput_observation); | 1752 NotifyObserversOfThroughput(throughput_observation); |
| 1751 } | 1753 } |
| 1752 | 1754 |
| 1753 ComputeEffectiveConnectionType(); | 1755 ComputeEffectiveConnectionType(); |
| 1754 } | 1756 } |
| 1755 | 1757 |
| 1756 } // namespace net | 1758 } // namespace net |
| OLD | NEW |