Chromium Code Reviews| Index: net/nqe/network_quality_estimator_params.h |
| diff --git a/net/nqe/network_quality_estimator_params.h b/net/nqe/network_quality_estimator_params.h |
| index 9996735c4902a6625619bf53b66c494f5b3c0877..b375aad6a67d46d151717035bc06913202af959c 100644 |
| --- a/net/nqe/network_quality_estimator_params.h |
| +++ b/net/nqe/network_quality_estimator_params.h |
| @@ -9,6 +9,7 @@ |
| #include <string> |
| #include "base/macros.h" |
| +#include "base/optional.h" |
| #include "base/threading/thread_checker.h" |
| #include "net/base/network_change_notifier.h" |
| #include "net/nqe/effective_connection_type.h" |
| @@ -22,7 +23,7 @@ namespace internal { |
| // NetworkQualityEstimatorParams computes the configuration parameters for |
| // the network quality estimator. |
| -class NetworkQualityEstimatorParams { |
| +class NET_EXPORT_PRIVATE NetworkQualityEstimatorParams { |
| public: |
| // |params| is the map containing all field trial parameters related to |
| // NetworkQualityEstimator field trial. |
| @@ -36,15 +37,6 @@ class NetworkQualityEstimatorParams { |
| // not specified. |
| std::string GetEffectiveConnectionTypeAlgorithm() const; |
| - // Computes and returns the weight multiplier per second, which represents the |
| - // factor by which the weight of an observation reduces every second. |
| - double GetWeightMultiplierPerSecond() const; |
| - |
| - // Returns the factor by which the weight of an observation reduces for every |
| - // dBm difference between the current signal strength (in dBm), and the signal |
| - // strength at the time when the observation was taken. |
| - double GetWeightMultiplierPerDbm() const; |
| - |
| // Returns a descriptive name corresponding to |connection_type|. |
| static const char* GetNameForConnectionType( |
| net::NetworkChangeNotifier::ConnectionType connection_type); |
| @@ -67,30 +59,57 @@ class NetworkQualityEstimatorParams { |
| void ObtainEffectiveConnectionTypeModelParams( |
| nqe::internal::NetworkQuality connection_thresholds[]) const; |
| - // Returns the fraction of URL requests that should record the correlation |
| - // UMA. |
| - double correlation_uma_logging_probability() const; |
| + // Returns the weight multiplier per second, which represents the factor by |
| + // which the weight of an observation reduces every second. |
| + double weight_multiplier_per_second() const { |
| + return weight_multiplier_per_second_; |
| + } |
| - // Returns true if the effective connection type has been forced via field |
| - // trial parameters. |
| - bool forced_effective_connection_type_set() const; |
| + // Returns the factor by which the weight of an observation reduces for every |
| + // dBm difference between the current signal strength (in dBm), and the signal |
| + // strength at the time when the observation was taken. |
| + double weight_multiplier_per_dbm() const { |
| + return weight_multiplier_per_dbm_; |
| + } |
| - // Returns the effective connection type if it has been forced via field trial |
| - // parameters. |
| - EffectiveConnectionType forced_effective_connection_type() const; |
| + // Returns the fraction of URL requests that should record the correlation |
| + // UMA. |
| + double correlation_uma_logging_probability() const { |
| + return correlation_uma_logging_probability_; |
| + } |
| + |
| + // Returns an uninitialized value if the effective connection type has not |
|
RyanSturm
2017/05/03 17:41:02
s/unitialized/unset/
tbansal1
2017/05/03 23:17:25
Done.
|
| + // been forced via the |params| provided to this class. Returns an initialized |
|
RyanSturm
2017/05/03 17:41:02
s/an initialized/a/
tbansal1
2017/05/03 23:17:25
Done.
|
| + // value set to the effective connection type that has been forced. |
| + base::Optional<EffectiveConnectionType> forced_effective_connection_type() |
| + const { |
| + return forced_effective_connection_type_; |
| + } |
| // Returns true if reading from the persistent cache is enabled. |
| - bool persistent_cache_reading_enabled() const; |
| + bool persistent_cache_reading_enabled() const { |
| + return persistent_cache_reading_enabled_; |
| + } |
| // Returns the the minimum interval betweeen consecutive notifications to a |
| // single socket watcher. |
| - base::TimeDelta GetMinSocketWatcherNotificationInterval() const; |
| + base::TimeDelta min_socket_watcher_notification_interval() const { |
| + return min_socket_watcher_notification_interval_; |
| + } |
| private: |
| // Map containing all field trial parameters related to |
| // NetworkQualityEstimator field trial. |
| const std::map<std::string, std::string> params_; |
| + const double weight_multiplier_per_second_; |
| + const double weight_multiplier_per_dbm_; |
| + const double correlation_uma_logging_probability_; |
| + const base::Optional<EffectiveConnectionType> |
| + forced_effective_connection_type_; |
| + const bool persistent_cache_reading_enabled_; |
| + const base::TimeDelta min_socket_watcher_notification_interval_; |
| + |
| base::ThreadChecker thread_checker_; |
| DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimatorParams); |