Index: third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9838f62f0896894255ef1c782b3ce0d6fb8d06ad |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SensorReadingUpdater_h |
+#define SensorReadingUpdater_h |
+ |
+#include "core/dom/FrameRequestCallback.h" |
+#include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" |
+ |
+namespace blink { |
+ |
+class SensorProxy; |
+ |
+// This class encapsulates sensor reading update notification logic. |
+class SensorReadingUpdater : public FrameRequestCallback { |
+ public: |
+ static SensorReadingUpdater* create(SensorProxy*, |
+ device::mojom::blink::ReportingMode); |
+ |
+ virtual void start(); |
+ virtual void stop(); |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+ protected: |
+ explicit SensorReadingUpdater(SensorProxy*); |
+ Member<SensorProxy> m_sensorProxy; |
+ int m_rafCallbackId; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // SensorReadingUpdater_h |