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: content/renderer/device_sensors/device_motion_event_pump.h

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)
Patch Set: updated content/renderer/BUILD.gn Created 3 years, 7 months 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: content/renderer/device_sensors/device_motion_event_pump.h
diff --git a/content/renderer/device_sensors/device_motion_event_pump.h b/content/renderer/device_sensors/device_motion_event_pump.h
index 5846db199bb8a2e123874350752b4ee685c91cbc..2dc3eaf67c4a2eea23af0af999f1e5996fa1334f 100644
--- a/content/renderer/device_sensors/device_motion_event_pump.h
+++ b/content/renderer/device_sensors/device_motion_event_pump.h
@@ -5,39 +5,36 @@
#ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_
#define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_MOTION_EVENT_PUMP_H_
-#include <memory>
-
#include "base/macros.h"
#include "content/renderer/device_sensors/device_sensor_event_pump.h"
-#include "content/renderer/shared_memory_seqlock_reader.h"
-#include "device/sensors/public/cpp/motion_data.h"
-#include "device/sensors/public/interfaces/motion.mojom.h"
namespace blink {
+class WebDeviceMotionData;
class WebDeviceMotionListener;
}
namespace content {
-typedef SharedMemorySeqLockReader<device::MotionData>
- DeviceMotionSharedMemoryReader;
-
class CONTENT_EXPORT DeviceMotionEventPump
- : public DeviceSensorMojoClientMixin<
- DeviceSensorEventPump<blink::WebDeviceMotionListener>,
- device::mojom::MotionSensor> {
+ : public DeviceSensorEventPump<blink::WebDeviceMotionListener> {
public:
explicit DeviceMotionEventPump(RenderThread* thread);
~DeviceMotionEventPump() override;
- // PlatformEventObserver.
+ // PlatformEventObserver:
+ void SendStartMessage() override;
void SendFakeDataForTesting(void* fake_data) override;
protected:
+ // DeviceSensorEventPump:
void FireEvent() override;
- bool InitializeReader(base::SharedMemoryHandle handle) override;
- std::unique_ptr<DeviceMotionSharedMemoryReader> reader_;
+ private:
+ // DeviceSensorEventPump:
+ bool CanStart() const override;
+
+ bool AllAvailableSensorsAreActive() const;
+ bool GetDataFromSharedMemory(blink::WebDeviceMotionData* data);
DISALLOW_COPY_AND_ASSIGN(DeviceMotionEventPump);
};

Powered by Google App Engine
This is Rietveld 408576698