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

Side by Side Diff: content/browser/device_orientation/data_fetcher_shared_memory.h

Issue 14678012: Implement the content/renderer and content/browser part of the Device Motion API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: factored out as much code as possible from the templated reader Created 7 years, 6 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
OLDNEW
(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 virtual ~DataFetcherSharedMemory() {}
20
21 // Returns true if this fetcher needs explicit calls to
22 virtual bool needsPolling() = 0;
23
24 // If this fetcher needsPolling() is true, this method will update the
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() = 0;
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) = 0;
35
36 // Indicates to the fetcher to stop fetching device data.
37 virtual void StopFetchingDeviceMotionData() = 0;
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698