Index: net/nqe/network_quality_estimator.h |
diff --git a/net/nqe/network_quality_estimator.h b/net/nqe/network_quality_estimator.h |
index 5c2718a12b6df2eb8ba4763a739942f511798982..3a609e73a7941632fc0bb58c677297d1abc38066 100644 |
--- a/net/nqe/network_quality_estimator.h |
+++ b/net/nqe/network_quality_estimator.h |
@@ -34,6 +34,10 @@ |
#include "net/nqe/observation_buffer.h" |
#include "net/socket/socket_performance_watcher_factory.h" |
+#if defined(OS_ANDROID) |
+#include "net/android/cellular_signal_strength.h" |
+#endif // OS_ANDROID |
+ |
namespace base { |
class TickClock; |
} // namespace base |
@@ -669,10 +673,10 @@ class NET_EXPORT NetworkQualityEstimator |
// The factor by which the weight of an observation reduces every second. |
const double weight_multiplier_per_second_; |
- // 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. |
- const double weight_multiplier_per_dbm_; |
+ // The factor by which the weight of an observation reduces for every signal |
+ // strength level difference between the current signal strength, and the |
+ // signal strength at the time when the observation was taken. |
+ const double weight_multiplier_per_signal_strength_level_; |
// Algorithm to use for computing effective connection type. The value is |
// obtained from field trial parameters. If the value from field trial |
@@ -786,12 +790,13 @@ class NET_EXPORT NetworkQualityEstimator |
// |effective_connection_type_recomputation_interval_| ago). |
EffectiveConnectionType effective_connection_type_; |
- // Last known value of the wireless signal strength. Set to INT32_MIN if |
- // unavailable. |signal_strength_dbm_| is reset to INT32_MIN on connection |
- // change events. |
- int32_t signal_strength_dbm_; |
+ // Last known value of the wireless signal strength level. Set to INT32_MIN if |
+ // unavailable. |signal_strength_| is reset to INT32_MIN on connection |
+ // change events. If the signal strength level is available, the value is set |
+ // to between 0 and 4, both inclusive. |
+ int32_t signal_strength_; |
- // Minimum and maximum signal strength (in dBm) observed since last connection |
+ // Minimum and maximum signal strength level observed since last connection |
// change. Updated on connection change and main frame requests. |
int32_t min_signal_strength_since_connection_change_; |
int32_t max_signal_strength_since_connection_change_; |
@@ -830,6 +835,12 @@ class NET_EXPORT NetworkQualityEstimator |
const std::vector<NetworkQualityObservationSource> |
disallowed_observation_sources_for_transport_; |
+#if defined(OS_ANDROID) |
+ // Initialized only if the experiment to use the cellular signal strength |
+ // is enabled. |
+ std::unique_ptr<android::CellularSignalStrength> cellular_signal_strength_; |
+#endif // OS_ANDROID |
+ |
base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |