| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ | 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ | 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 ~NetworkQualityEstimatorParams(); | 38 ~NetworkQualityEstimatorParams(); |
| 39 | 39 |
| 40 // Returns the algorithm that should be used for computing effective | 40 // Returns the algorithm that should be used for computing effective |
| 41 // connection type. Returns an empty string if a valid algorithm paramter is | 41 // connection type. Returns an empty string if a valid algorithm paramter is |
| 42 // not specified. | 42 // not specified. |
| 43 std::string GetEffectiveConnectionTypeAlgorithm() const; | 43 std::string GetEffectiveConnectionTypeAlgorithm() const; |
| 44 | 44 |
| 45 // Returns a descriptive name corresponding to |connection_type|. | 45 // Returns a descriptive name corresponding to |connection_type|. |
| 46 static const char* GetNameForConnectionType( | 46 static const char* GetNameForConnectionType( |
| 47 net::NetworkChangeNotifier::ConnectionType connection_type); | 47 NetworkChangeNotifier::ConnectionType connection_type); |
| 48 | 48 |
| 49 // Sets the default observation for different connection types in | 49 // Returns the default observation for connection |type|. The default |
| 50 // |default_observations|. The default observations are different for | 50 // observations are different for different connection types (e.g., 2G, 3G, |
| 51 // different connection types (e.g., 2G, 3G, 4G, WiFi). The default | 51 // 4G, WiFi). The default observations may be used to determine the network |
| 52 // observations may be used to determine the network quality in absence of any | 52 // quality in absence of any other information. |
| 53 // other information. | 53 const NetworkQuality& DefaultObservation( |
| 54 void ObtainDefaultObservations( | 54 NetworkChangeNotifier::ConnectionType type) const; |
| 55 nqe::internal::NetworkQuality default_observations[]) const; | |
| 56 | 55 |
| 57 // Sets |typical_network_quality| to typical network quality for different | 56 // Returns the typical network quality for connection |type|. |
| 58 // effective connection types. | 57 const NetworkQuality& TypicalNetworkQuality( |
| 59 void ObtainTypicalNetworkQuality( | 58 EffectiveConnectionType type) const; |
| 60 NetworkQuality typical_network_quality[]) const; | |
| 61 | 59 |
| 62 // Sets the thresholds for different effective connection types in | 60 // Returns the threshold for effective connection type |type|. |
| 63 // |connection_thresholds|. | 61 const NetworkQuality& ConnectionThreshold(EffectiveConnectionType type) const; |
| 64 void ObtainEffectiveConnectionTypeModelParams( | |
| 65 nqe::internal::NetworkQuality connection_thresholds[]) const; | |
| 66 | 62 |
| 67 // Returns the weight multiplier per second, which represents the factor by | 63 // Returns the weight multiplier per second, which represents the factor by |
| 68 // which the weight of an observation reduces every second. | 64 // which the weight of an observation reduces every second. |
| 69 double weight_multiplier_per_second() const { | 65 double weight_multiplier_per_second() const { |
| 70 return weight_multiplier_per_second_; | 66 return weight_multiplier_per_second_; |
| 71 } | 67 } |
| 72 | 68 |
| 73 // Returns the factor by which the weight of an observation reduces for every | 69 // Returns the factor by which the weight of an observation reduces for every |
| 74 // dBm difference between the current signal strength (in dBm), and the signal | 70 // dBm difference between the current signal strength (in dBm), and the signal |
| 75 // strength at the time when the observation was taken. | 71 // strength at the time when the observation was taken. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const std::map<std::string, std::string> params_; | 104 const std::map<std::string, std::string> params_; |
| 109 | 105 |
| 110 const double weight_multiplier_per_second_; | 106 const double weight_multiplier_per_second_; |
| 111 const double weight_multiplier_per_dbm_; | 107 const double weight_multiplier_per_dbm_; |
| 112 const double correlation_uma_logging_probability_; | 108 const double correlation_uma_logging_probability_; |
| 113 const base::Optional<EffectiveConnectionType> | 109 const base::Optional<EffectiveConnectionType> |
| 114 forced_effective_connection_type_; | 110 forced_effective_connection_type_; |
| 115 const bool persistent_cache_reading_enabled_; | 111 const bool persistent_cache_reading_enabled_; |
| 116 const base::TimeDelta min_socket_watcher_notification_interval_; | 112 const base::TimeDelta min_socket_watcher_notification_interval_; |
| 117 | 113 |
| 114 // Default network quality observations obtained from |params_|. |
| 115 NetworkQuality |
| 116 default_observations_[NetworkChangeNotifier::CONNECTION_LAST + 1]; |
| 117 |
| 118 // Typical network quality for different effective connection types obtained |
| 119 // from |params_|. |
| 120 NetworkQuality typical_network_quality_ |
| 121 [EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 122 |
| 123 // Thresholds for different effective connection types obtained from |
| 124 // |params_|. These thresholds encode how different connection types behave |
| 125 // in general. |
| 126 NetworkQuality connection_thresholds_ |
| 127 [EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 128 |
| 118 base::ThreadChecker thread_checker_; | 129 base::ThreadChecker thread_checker_; |
| 119 | 130 |
| 120 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimatorParams); | 131 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimatorParams); |
| 121 }; | 132 }; |
| 122 | 133 |
| 123 } // namespace internal | 134 } // namespace internal |
| 124 | 135 |
| 125 } // namespace nqe | 136 } // namespace nqe |
| 126 | 137 |
| 127 } // namespace net | 138 } // namespace net |
| 128 | 139 |
| 129 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ | 140 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_PARAMS_H_ |
| OLD | NEW |