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

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

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Pass only origin to provider 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..7e60d73757d3a13b0b3825b4b3e95dc4814d6e55 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -167,8 +167,10 @@ void Sensor::initSensorProxyIfNeeded() {
m_sensorProxy = provider->getSensor(m_type);
if (!m_sensorProxy) {
+ RefPtr<SecurityOrigin> origin = getExecutionContext()->getSecurityOrigin();
+ DCHECK(origin);
m_sensorProxy =
- provider->createSensor(m_type, createSensorReadingFactory());
+ provider->createSensor(m_type, origin, createSensorReadingFactory());
Mikhail 2016/11/21 14:29:41 nit: std::move(origin)
riju_ 2016/11/23 09:02:28 Acknowledged.
}
}

Powered by Google App Engine
This is Rietveld 408576698