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

Unified Diff: content/renderer/device_sensors/device_orientation_event_pump.h

Issue 446603002: Refactor code listening to platform events in content/renderer/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webkitplatform_impl_start_stop
Patch Set: rebase Created 6 years, 4 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_orientation_event_pump.h
diff --git a/content/renderer/device_sensors/device_orientation_event_pump.h b/content/renderer/device_sensors/device_orientation_event_pump.h
index b35ac3314da073a3dcad25249c829aa5aced6ed2..9f97e91e343e6b393b667a4d1668d31d2f761f51 100644
--- a/content/renderer/device_sensors/device_orientation_event_pump.h
+++ b/content/renderer/device_sensors/device_orientation_event_pump.h
@@ -19,34 +19,34 @@ namespace content {
typedef SharedMemorySeqLockReader<blink::WebDeviceOrientationData>
DeviceOrientationSharedMemoryReader;
-class CONTENT_EXPORT DeviceOrientationEventPump : public DeviceSensorEventPump {
+class CONTENT_EXPORT DeviceOrientationEventPump
+ : public DeviceSensorEventPump<blink::WebDeviceOrientationListener> {
public:
// Angle threshold beyond which two orientation events are considered
// sufficiently different.
static const double kOrientationThreshold;
- DeviceOrientationEventPump();
- explicit DeviceOrientationEventPump(int pump_delay_millis);
+ explicit DeviceOrientationEventPump(RenderThread* thread);
virtual ~DeviceOrientationEventPump();
- // Sets the listener to receive updates for device orientation data at
- // regular intervals. Returns true if the registration was successful.
- bool SetListener(blink::WebDeviceOrientationListener* listener);
-
- // RenderProcessObserver implementation.
+ // PlatformEventObserver.
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void SendFakeDataForTesting(void* data) OVERRIDE;
protected:
virtual void FireEvent() OVERRIDE;
virtual bool InitializeReader(base::SharedMemoryHandle handle) OVERRIDE;
- virtual bool SendStartMessage() OVERRIDE;
- virtual bool SendStopMessage() OVERRIDE;
+
+ // PlatformEventObserver.
+ virtual void SendStartMessage() OVERRIDE;
+ virtual void SendStopMessage() OVERRIDE;
bool ShouldFireEvent(const blink::WebDeviceOrientationData& data) const;
- blink::WebDeviceOrientationListener* listener_;
blink::WebDeviceOrientationData data_;
scoped_ptr<DeviceOrientationSharedMemoryReader> reader_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceOrientationEventPump);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698