Index: third_party/WebKit/Source/modules/sensor/SensorProxy.cpp |
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp |
index 6caf643251707c101b239a138b9a79c37d58a8a6..baa7be212caa72df4b93ed3c77bf24acfc2be9a3 100644 |
--- a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp |
+++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp |
@@ -24,8 +24,7 @@ SensorProxy::SensorProxy(SensorType sensorType, |
m_provider(provider), |
m_clientBinding(this), |
m_state(SensorProxy::Uninitialized), |
- m_suspended(false), |
- m_maximumFrequency(0.0) {} |
+ m_suspended(false) {} |
SensorProxy::~SensorProxy() {} |
@@ -211,9 +210,14 @@ void SensorProxy::onSensorCreated(SensorInitParamsPtr params, |
handleSensorError(); |
return; |
} |
- |
- m_maximumFrequency = params->maximum_frequency; |
- DCHECK(m_maximumFrequency <= SensorConfiguration::kMaxAllowedFrequency); |
+ m_frequencyLimits.first = params->minimum_frequency; |
+ m_frequencyLimits.second = params->maximum_frequency; |
+ |
+ DCHECK_GT(m_frequencyLimits.first, 0.0); |
+ DCHECK_GE(m_frequencyLimits.second, m_frequencyLimits.first); |
+ constexpr double kMaxAllowedFrequency = |
+ SensorConfiguration::kMaxAllowedFrequency; |
+ DCHECK_GE(kMaxAllowedFrequency, m_frequencyLimits.second); |
auto errorCallback = |
WTF::bind(&SensorProxy::handleSensorError, wrapWeakPersistent(this)); |