| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ | 5 #ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ |
| 6 #define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ | 6 #define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/renderer/device_sensors/device_sensor_event_pump.h" | 11 #include "content/renderer/device_sensors/device_sensor_event_pump.h" |
| 12 #include "content/renderer/shared_memory_seqlock_reader.h" | 12 #include "content/renderer/shared_memory_seqlock_reader.h" |
| 13 #include "device/sensors/public/cpp/motion_data.h" |
| 13 #include "device/sensors/public/interfaces/motion.mojom.h" | 14 #include "device/sensors/public/interfaces/motion.mojom.h" |
| 14 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 class WebDeviceMotionListener; | 17 class WebDeviceMotionListener; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 typedef SharedMemorySeqLockReader<blink::WebDeviceMotionData> | 22 typedef SharedMemorySeqLockReader<device::MotionData> |
| 23 DeviceMotionSharedMemoryReader; | 23 DeviceMotionSharedMemoryReader; |
| 24 | 24 |
| 25 class CONTENT_EXPORT DeviceMotionEventPump | 25 class CONTENT_EXPORT DeviceMotionEventPump |
| 26 : public DeviceSensorMojoClientMixin< | 26 : public DeviceSensorMojoClientMixin< |
| 27 DeviceSensorEventPump<blink::WebDeviceMotionListener>, | 27 DeviceSensorEventPump<blink::WebDeviceMotionListener>, |
| 28 device::mojom::MotionSensor> { | 28 device::mojom::MotionSensor> { |
| 29 public: | 29 public: |
| 30 explicit DeviceMotionEventPump(RenderThread* thread); | 30 explicit DeviceMotionEventPump(RenderThread* thread); |
| 31 ~DeviceMotionEventPump() override; | 31 ~DeviceMotionEventPump() override; |
| 32 | 32 |
| 33 // PlatformEventObserver. | 33 // PlatformEventObserver. |
| 34 void SendFakeDataForTesting(void* fake_data) override; | 34 void SendFakeDataForTesting(void* fake_data) override; |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 void FireEvent() override; | 37 void FireEvent() override; |
| 38 bool InitializeReader(base::SharedMemoryHandle handle) override; | 38 bool InitializeReader(base::SharedMemoryHandle handle) override; |
| 39 | 39 |
| 40 std::unique_ptr<DeviceMotionSharedMemoryReader> reader_; | 40 std::unique_ptr<DeviceMotionSharedMemoryReader> reader_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(DeviceMotionEventPump); | 42 DISALLOW_COPY_AND_ASSIGN(DeviceMotionEventPump); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace content | 45 } // namespace content |
| 46 | 46 |
| 47 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ | 47 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_ |
| OLD | NEW |