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

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: implemented async messaging for obtaining the shared memory handle 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
10 namespace WebKit {
11 class WebDeviceMotionData;
12 }
13
14 namespace content {
15
16 class DeviceMotionHardwareBuffer;
17
18 class DataFetcherSharedMemory {
19 public:
20 virtual ~DataFetcherSharedMemory() {}
21
22 // Returns true if this fetcher needs explicit calls to
23 virtual bool needsPolling() = 0;
24
25 // If this fetcher needsPolling() is true, this method will update the
26 // buffer with the latest device motion data.
27 // This method will do nothing if needsPolling() is false.
28 // Returns true if there was any motion data to update the buffer with.
29 virtual bool FetchDeviceMotionDataIntoBuffer() = 0;
30
31 // Returns true if the relevant sensors could be successfully activated.
32 // This method should be called before any calls to
33 // FetchDeviceMotionDataIntoBuffer().
34 virtual bool StartFetchingDeviceMotionData(
35 DeviceMotionHardwareBuffer* buffer) = 0;
36
37 // Indicates to the fetcher to stop fetching device data.
38 virtual void StopFetchingDeviceMotionData() = 0;
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698