OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | |
7 | |
8 #include "content/browser/device_orientation/device_data.h" | |
9 #include "content/common/device_motion_hardware_buffer.h" | |
10 | |
11 namespace WebKit { | |
12 class WebDeviceMotionData; | |
13 } | |
14 | |
15 namespace content { | |
16 | |
17 class DataFetcherSharedMemory { | |
18 public: | |
19 static DataFetcherSharedMemory* instance(); | |
20 | |
21 // Returns true if this fetcher needs explicit calls to fetch the data. | |
22 virtual bool NeedsPolling(); | |
23 | |
24 // If this fetcher needsPolling() is true, this method will update the | |
bulach
2013/07/09 09:03:29
nit: s/needs/Needs/ here and below..
timvolodine
2013/07/09 18:59:56
Done.
| |
25 // buffer with the latest device motion data. | |
26 // This method will do nothing if needsPolling() is false. | |
27 // Returns true if there was any motion data to update the buffer with. | |
28 virtual bool FetchDeviceMotionDataIntoBuffer(); | |
29 | |
30 // Returns true if the relevant sensors could be successfully activated. | |
31 // This method should be called before any calls to | |
32 // FetchDeviceMotionDataIntoBuffer(). | |
33 virtual bool StartFetchingDeviceMotionData( | |
34 DeviceMotionHardwareBuffer* buffer); | |
35 | |
36 // Indicates to the fetcher to stop fetching device data. | |
37 virtual void StopFetchingDeviceMotionData(); | |
38 virtual ~DataFetcherSharedMemory(); | |
bulach
2013/07/09 09:03:29
since the only way to get one object is via "insta
timvolodine
2013/07/09 18:59:56
Done.
| |
39 | |
40 protected: | |
41 DataFetcherSharedMemory() : device_motion_buffer_(NULL) { } | |
42 | |
bulach
2013/07/09 09:03:29
nit: private:
(data members and the DISALLOW_* mac
timvolodine
2013/07/09 18:59:56
Done.
| |
43 DeviceMotionHardwareBuffer* device_motion_buffer_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | |
OLD | NEW |