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

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

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Request for permission, in onSensorCreated() 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..cc5967b8c929be5141a3496d2514725b75bf4539 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) {
- m_sensorProxy =
- provider->createSensor(m_type, createSensorReadingFactory());
+ RefPtr<SecurityOrigin> origin = getExecutionContext()->getSecurityOrigin();
+ DCHECK(origin);
+ m_sensorProxy = provider->createSensor(m_type, std::move(origin),
+ createSensorReadingFactory());
}
}

Powered by Google App Engine
This is Rietveld 408576698