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

Side by Side Diff: content/renderer/device_sensors/device_light_event_pump.h

Issue 286793002: [DeviceLight] Add renderer+common parts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: jochen's comments Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/device_sensors/device_light_event_pump.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 DeviceLightEventPump();
25 explicit DeviceLightEventPump(int pump_delay_millis);
26 virtual ~DeviceLightEventPump();
27
28 // Sets the listener to receive updates for device light data at
29 // regular intervals. Returns true if the registration was successful.
30 bool SetListener(blink::WebDeviceLightListener* listener);
31
32 // RenderProcessObserver implementation.
33 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
34
35 protected:
36 // Methods overriden from base class DeviceSensorEventPump
37 virtual void FireEvent() OVERRIDE;
38 virtual bool InitializeReader(base::SharedMemoryHandle handle) OVERRIDE;
39 virtual bool SendStartMessage() OVERRIDE;
40 virtual bool SendStopMessage() OVERRIDE;
41
42 blink::WebDeviceLightListener* listener_;
43 scoped_ptr<DeviceLightSharedMemoryReader> reader_;
44 double last_seen_data_;
45
46 DISALLOW_COPY_AND_ASSIGN(DeviceLightEventPump);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_LIGHT_EVENT_PUMP_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/device_sensors/device_light_event_pump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698