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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/device_orientation/device_motion_provider.h
diff --git a/content/browser/device_orientation/device_motion_provider.h b/content/browser/device_orientation/device_motion_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..39f8a4d9fbfdd708c58abb831bfe208b40025922
--- /dev/null
+++ b/content/browser/device_orientation/device_motion_provider.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_MOTION_PROVIDER_H_
+#define CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_MOTION_PROVIDER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/shared_memory.h"
+#include "content/common/content_export.h"
+#include "content/common/device_motion_hardware_buffer.h"
+
+namespace content {
+
+// TODO(timvolodine): Add data fetcher to this class.
+
+class CONTENT_EXPORT DeviceMotionProvider {
+ public:
+ DeviceMotionProvider();
+ virtual ~DeviceMotionProvider();
+
+ // Returns the shared memory handle of the device motion data duplicated
+ // into the given process.
+ base::SharedMemoryHandle GetSharedMemoryHandleForProcess(
+ base::ProcessHandle renderer_process);
+
+ // Pause and resume the background polling thread. Can be called from any
+ // thread.
+ void StartFetchingDeviceMotionData();
+ void StopFetchingDeviceMotionData();
+
+ private:
+ base::SharedMemory device_motion_shared_memory_;
+
+ DeviceMotionHardwareBuffer* SharedMemoryAsHardwareBuffer();
+
+ // TODO(timvolodine): add member variable,
+ // scoped_ptr<DataFetcherSharedMemory> data_fetcher_;
+
+ bool is_started_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceMotionProvider);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DEVICE_MOTION_PROVIDER_H_
« 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