Chromium Code Reviews| 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 401ae29b3f59ff6137304899ebbfe06c1d6a02d8..6c6a931a342b1a9eeebd6c967cad722441a68121 100644 |
| --- a/third_party/WebKit/Source/modules/sensor/SensorProxy.h |
| +++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.h |
| @@ -5,6 +5,7 @@ |
| #ifndef SensorProxy_h |
| #define SensorProxy_h |
| +#include "core/page/PageVisibilityObserver.h" |
| #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" |
| #include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| @@ -19,7 +20,9 @@ class SensorProviderProxy; |
| // JS sensor instances of the same type (within a single frame). |
| class SensorProxy final |
| : public GarbageCollectedFinalized<SensorProxy> |
| - , public device::mojom::blink::SensorClient { |
| + , public device::mojom::blink::SensorClient |
| + , public PageVisibilityObserver { |
|
haraken
2016/09/08 11:07:13
Sensor is already a PageVisibilityObserver. Can we
Mikhail
2016/09/08 11:24:48
Tim raised the same concern at https://codereview.
|
| + USING_GARBAGE_COLLECTED_MIXIN(SensorProxy); |
| USING_PRE_FINALIZER(SensorProxy, dispose); |
| WTF_MAKE_NONCOPYABLE(SensorProxy); |
| public: |
| @@ -67,12 +70,15 @@ public: |
| private: |
| friend class SensorProviderProxy; |
| - SensorProxy(device::mojom::blink::SensorType, SensorProviderProxy*); |
| + SensorProxy(device::mojom::blink::SensorType, Page*, SensorProviderProxy*); |
| // device::mojom::blink::SensorClient overrides. |
| void RaiseError() override; |
| void SensorReadingChanged() override; |
| + // PageVisibilityObserver overrides. |
| + void pageVisibilityChanged() override; |
| + |
| // Generic handler for a fatal error. |
| void handleSensorError(); |