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

Side by Side Diff: content/browser/device_orientation/device_motion_provider.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: fix compilation: peer_handle -> PeerHandle() Created 7 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
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_DEVICE_MOTION_PROVIDER_H_
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_MOTION_PROVIDER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/shared_memory.h"
10 #include "content/common/content_export.h"
11 #include "content/common/device_motion_hardware_buffer.h"
12
13 namespace content {
14
15 // TODO(timvolodine): Add data fetcher to this class.
16
17 class CONTENT_EXPORT DeviceMotionProvider {
18 public:
19 DeviceMotionProvider();
20 virtual ~DeviceMotionProvider();
21
22 // Returns the shared memory handle of the device motion data duplicated
23 // into the given process.
24 base::SharedMemoryHandle GetSharedMemoryHandleForProcess(
25 base::ProcessHandle renderer_process);
26
27 // Pause and resume the background polling thread. Can be called from any
28 // thread.
29 void StartFetchingDeviceMotionData();
30 void StopFetchingDeviceMotionData();
31
32 private:
33 base::SharedMemory device_motion_shared_memory_;
34
35 DeviceMotionHardwareBuffer* SharedMemoryAsHardwareBuffer();
36
37 // TODO(timvolodine): add member variable,
38 // scoped_ptr<DataFetcherSharedMemory> data_fetcher_;
39
40 bool is_started_;
41
42 DISALLOW_COPY_AND_ASSIGN(DeviceMotionProvider);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_MOTION_PROVIDER_H_
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/device_orientation/device_motion_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698