Chromium Code Reviews| 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]; |
|
bengr
2016/11/29 18:39:15
Why is this +1 now?
tbansal1
2016/12/02 17:41:17
CONNECTION_LAST + 1 is correct. The size of the ar
|
| // Thresholds for different effective connection types obtained from field |
| // trial variation params. These thresholds encode how different connection |