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

Unified Diff: net/base/network_quality_estimator.h

Issue 1316863006: Populate EEP estimate in NQE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use EXPECT_TRUE instead of DCHECK Created 5 years, 3 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/base/external_estimate_provider.h ('k') | net/base/network_quality_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_quality_estimator.h
diff --git a/net/base/network_quality_estimator.h b/net/base/network_quality_estimator.h
index aba0313b6ec924c68376ced83ecd7eeb5391c207..f951bd4f7fa533b72dd88a7ec01243c31cf6d38f 100644
--- a/net/base/network_quality_estimator.h
+++ b/net/base/network_quality_estimator.h
@@ -149,6 +149,9 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType type) override;
+ // ExternalEstimateProvider::UpdatedEstimateObserver implementation.
+ void OnUpdatedEstimateAvailable() override;
+
private:
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestKbpsRTTUpdates);
@@ -165,6 +168,10 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
TestLRUCacheMaximumSize);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestGetMedianRTTSince);
+ FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
+ TestExternalEstimateProvider);
+ FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
+ TestExternalEstimateProviderMergeEstimates);
// NetworkQuality is used to cache the quality of a network connection.
class NET_EXPORT_PRIVATE NetworkQuality {
@@ -352,12 +359,18 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// Maximum number of observations that can be held in the ObservationBuffer.
static const size_t kMaximumObservationsBufferSize = 300;
+ // Time duration (in milliseconds) after which the estimate provided by
+ // external estimate provider is considered stale.
+ static const int kExternalEstimateProviderFreshnessDurationMsec =
+ 5 * 60 * 1000;
+
// Returns the RTT value to be used when the valid RTT is unavailable. Readers
// should discard RTT if it is set to the value returned by |InvalidRTT()|.
static const base::TimeDelta InvalidRTT();
- // ExternalEstimateProvider::UpdatedEstimateObserver implementation:
- void OnUpdatedEstimateAvailable() override;
+ // Queries the external estimate provider for the latest network quality
+ // estimates, and adds those estimates to the current observation buffer.
+ void QueryExternalEstimateProvider();
// Obtains operating parameters from the field trial parameters.
void ObtainOperatingParams(
@@ -396,6 +409,22 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// observations.
bool RequestProvidesUsefulObservations(const URLRequest& request) const;
+ // Values of external estimate provider status. This enum must remain
+ // synchronized with the enum of the same name in
+ // metrics/histograms/histograms.xml.
+ enum NQEExternalEstimateProviderStatus {
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_NOT_AVAILABLE,
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE,
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED,
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL,
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_CALLBACK,
+ EXTERNAL_ESTIMATE_PROVIDER_STATUS_BOUNDARY
+ };
+
+ // Records the metrics related to external estimate provider.
+ void RecordExternalEstimateProviderMetrics(
+ NQEExternalEstimateProviderStatus status) const;
+
// Determines if the requests to local host can be used in estimating the
// network quality. Set to true only for tests.
const bool allow_localhost_requests_;
@@ -439,7 +468,7 @@ class NET_EXPORT_PRIVATE NetworkQualityEstimator
// ExternalEstimateProvider that provides network quality using operating
// system APIs. May be NULL.
- const scoped_ptr<ExternalEstimateProvider> external_estimates_provider_;
+ const scoped_ptr<ExternalEstimateProvider> external_estimate_provider_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « net/base/external_estimate_provider.h ('k') | net/base/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698