Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/Source/modules/sensor/SensorProxy.cpp

Issue 2465363004: [Sensors] Consider maximum supported frequency (Closed)
Patch Set: Comment from Tim Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9aea416ebdbd44a897fd3a27ac343f510f43df97..e3b01f30c0d560100a8eb40e5720b98fa23a2870 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
+++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
@@ -23,7 +23,8 @@ SensorProxy::SensorProxy(SensorType sensorType,
m_clientBinding(this),
m_state(SensorProxy::Uninitialized),
m_suspended(false),
- m_readingFactory(std::move(readingFactory)) {}
+ m_readingFactory(std::move(readingFactory)),
+ m_maximumFrequency(0.0) {}
SensorProxy::~SensorProxy() {}
@@ -180,6 +181,9 @@ void SensorProxy::onSensorCreated(SensorInitParamsPtr params,
return;
}
+ m_maximumFrequency = params->maximum_frequency;
+ DCHECK(m_maximumFrequency <= SensorConfiguration::kMaxAllowedFrequency);
+
auto errorCallback =
WTF::bind(&SensorProxy::handleSensorError, wrapWeakPersistent(this),
UnknownError, String("Internal error"), String());
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698