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

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

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Mikhail+alex comments 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
Index: third_party/WebKit/Source/modules/sensor/Sensor.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
index 60551e7edd45e22c1090aaf8f1f05beec2d6fa4a..d8b3f6132dd2319b35f2794caac67c1db26d332b 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -167,8 +167,11 @@ void Sensor::initSensorProxyIfNeeded() {
m_sensorProxy = provider->getSensor(m_type);
if (!m_sensorProxy) {
- m_sensorProxy =
- provider->createSensor(m_type, createSensorReadingFactory());
+ m_sensorProxy = provider->createSensor(m_type, getExecutionContext(),
+ createSensorReadingFactory());
+ // check if proxy was created correctly.
+ if (!m_sensorProxy)
shalamov 2016/11/18 13:17:45 This is sync operation that is initiated from Sens
riju_ 2016/11/21 11:23:28 Done.
+ reportError(NotAllowedError, "Could not create sensor proxy.");
}
}

Powered by Google App Engine
This is Rietveld 408576698