Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_LIGHT_EVENT_PUMP_H_ | |
| 6 #define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_LIGHT_EVENT_PUMP_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "content/common/device_sensors/device_light_data.h" | |
| 10 #include "content/renderer/device_sensors/device_sensor_event_pump.h" | |
| 11 #include "content/renderer/shared_memory_seqlock_reader.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 class WebDeviceLightListener; | |
| 15 } | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 typedef SharedMemorySeqLockReader<DeviceLightData> | |
| 20 DeviceLightSharedMemoryReader; | |
| 21 | |
| 22 class CONTENT_EXPORT DeviceLightEventPump : public DeviceSensorEventPump { | |
| 23 public: | |
| 24 // Default delay between subsequent firing of DeviceLight events. | |
| 25 static const int kDefaultLightPumpDelayMillis; | |
|
jochen (gone - plz use gerrit)
2014/06/12 14:33:51
any reason this is part of the public interface?
riju_
2014/06/13 17:06:25
Making it protected now.
| |
| 26 | |
| 27 DeviceLightEventPump(); | |
| 28 explicit DeviceLightEventPump(int pump_delay_millis); | |
| 29 virtual ~DeviceLightEventPump(); | |
| 30 | |
| 31 // Sets the listener to receive updates for device light data at | |
| 32 // regular intervals. Returns true if the registration was successful. | |
| 33 bool SetListener(blink::WebDeviceLightListener* listener); | |
| 34 | |
| 35 // RenderProcessObserver implementation. | |
| 36 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 37 | |
| 38 protected: | |
| 39 virtual void FireEvent() OVERRIDE; | |
|
jochen (gone - plz use gerrit)
2014/06/12 14:33:51
please add a comment which interface is implemente
riju_
2014/06/13 17:06:25
Done.
| |
| 40 virtual bool InitializeReader(base::SharedMemoryHandle handle) OVERRIDE; | |
| 41 virtual bool SendStartMessage() OVERRIDE; | |
| 42 virtual bool SendStopMessage() OVERRIDE; | |
| 43 | |
| 44 blink::WebDeviceLightListener* listener_; | |
| 45 scoped_ptr<DeviceLightSharedMemoryReader> reader_; | |
| 46 }; | |
|
jochen (gone - plz use gerrit)
2014/06/12 14:33:51
disallow copy/assign
riju_
2014/06/13 17:06:25
Done.
| |
| 47 | |
| 48 } // namespace content | |
| 49 | |
| 50 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_LIGHT_EVENT_PUMP_H_ | |
| OLD | NEW |