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

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

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Remove resetPermission + Rebase 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/SensorProxy.h
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
index 3243636775cef146e6edd103933ced25ff4c15ad..98d31e6afd12727f6fb555ec07d618adec455da9 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorProxy.h
+++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
@@ -14,6 +14,8 @@
#include "platform/Supplementable.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/permissions/permission.mojom-blink.h"
+#include "public/platform/modules/permissions/permission_status.mojom-blink.h"
#include "wtf/Vector.h"
namespace blink {
@@ -21,6 +23,7 @@ namespace blink {
class SensorProviderProxy;
class SensorReading;
class SensorReadingFactory;
+class SecurityOrigin;
// This class wraps 'Sensor' mojo interface and used by multiple
// JS sensor instances of the same type (within a single frame).
@@ -84,6 +87,8 @@ class SensorProxy final : public GarbageCollectedFinalized<SensorProxy>,
private:
friend class SensorProviderProxy;
SensorProxy(device::mojom::blink::SensorType,
+ mojom::blink::PermissionService*,
+ RefPtr<SecurityOrigin>,
SensorProviderProxy*,
Page*,
std::unique_ptr<SensorReadingFactory>);
@@ -119,6 +124,8 @@ class SensorProxy final : public GarbageCollectedFinalized<SensorProxy>,
void updatePollingStatus();
void onTimerFired(TimerBase*);
+ void onPermissionUpdate(mojom::blink::PermissionStatus);
+
device::mojom::blink::SensorType m_type;
device::mojom::blink::ReportingMode m_mode;
Member<SensorProviderProxy> m_provider;
@@ -147,6 +154,10 @@ class SensorProxy final : public GarbageCollectedFinalized<SensorProxy>,
sizeof(ReadingBuffer) ==
device::mojom::blink::SensorInitParams::kReadBufferSizeForTests,
"Check reading buffer size for tests");
+
+ mojom::blink::PermissionStatus m_permissionStatus;
+ mojom::blink::PermissionService* m_permissionService;
+ RefPtr<SecurityOrigin> m_securityOrigin;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698