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

Unified Diff: net/nqe/network_quality_estimator.h

Issue 2481373004: NQE: Add default RTT and throughput observations (Closed)
Patch Set: Rebased, addressed bengr comments Created 4 years 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/nqe/network_id.h ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator.h
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h
index c8c2846fff65a2e069143979e93cd3332ffbb7ae..6bd701911ee1efad103ebf7362e6339a027e40e7 100644
--- a/net/nqe/network_quality_estimator.h
+++ b/net/nqe/network_quality_estimator.h
@@ -298,6 +298,15 @@ class NET_EXPORT NetworkQualityEstimator
nqe::internal::CachedNetworkQuality> read_prefs);
protected:
+ // A protected constructor for testing that allows setting the value of
+ // |add_default_platform_observations_|.
+ NetworkQualityEstimator(
+ std::unique_ptr<ExternalEstimateProvider> external_estimates_provider,
+ const std::map<std::string, std::string>& variation_params,
+ bool use_local_host_requests_for_tests,
+ bool use_smaller_responses_for_tests,
+ bool add_default_platform_observations);
+
// NetworkChangeNotifier::ConnectionTypeObserver implementation:
void OnConnectionTypeChanged(
NetworkChangeNotifier::ConnectionType type) override;
@@ -363,7 +372,8 @@ class NET_EXPORT NetworkQualityEstimator
AdaptiveRecomputationEffectiveConnectionType);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestAddObservation);
- FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, ObtainOperatingParams);
+ FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
+ DefaultObservationsOverridden);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
ObtainAlgorithmToUseFromParams);
FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, HalfLifeParam);
@@ -578,6 +588,9 @@ class NET_EXPORT NetworkQualityEstimator
// network quality. Set to true only for tests.
bool use_small_responses_;
+ // If true, default values provided by the platform are used for estimation.
+ const bool add_default_platform_observations_;
+
// The factor by which the weight of an observation reduces every second.
const double weight_multiplier_per_second_;
@@ -619,7 +632,7 @@ class NET_EXPORT NetworkQualityEstimator
// estimator field trial parameters. The observations are indexed by
// ConnectionType.
nqe::internal::NetworkQuality
- default_observations_[NetworkChangeNotifier::CONNECTION_LAST];
+ default_observations_[NetworkChangeNotifier::CONNECTION_LAST + 1];
// Thresholds for different effective connection types obtained from field
// trial variation params. These thresholds encode how different connection
« no previous file with comments | « net/nqe/network_id.h ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698