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

Unified Diff: content/renderer/device_orientation/device_motion_shared_memory_reader.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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/device_orientation/device_motion_shared_memory_reader.h
diff --git a/content/renderer/device_orientation/device_motion_shared_memory_reader.h b/content/renderer/device_orientation/device_motion_shared_memory_reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8983cf180ffcd778ef0ea2bfe6c5efcf017e2b5
--- /dev/null
+++ b/content/renderer/device_orientation/device_motion_shared_memory_reader.h
@@ -0,0 +1,35 @@
+// 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_RENDERER_DEVICE_MOTION_SHARED_MEMORY_READER_H_
+#define CONTENT_RENDERER_DEVICE_MOTION_SHARED_MEMORY_READER_H_
+
+#include "base/shared_memory.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace WebKit {
+class WebDeviceMotionData;
+}
+
+namespace content {
+
+struct DeviceMotionHardwareBuffer;
+
+class DeviceMotionSharedMemoryReader {
+ public:
+ DeviceMotionSharedMemoryReader();
+ virtual ~DeviceMotionSharedMemoryReader() { }
+
+ virtual bool GetLatestDeviceMotionData(WebKit::WebDeviceMotionData& data);
darin (slow to review) 2013/06/17 05:27:46 nit: google c++ style disallows non-const referenc
timvolodine 2013/06/17 20:10:55 Done.
+ virtual bool Initialize(base::SharedMemoryHandle shared_memory_handle);
+
+ private:
+ base::SharedMemoryHandle renderer_shared_memory_handle_;
+ scoped_ptr<base::SharedMemory> renderer_shared_memory_;
+ DeviceMotionHardwareBuffer* device_motion_hardware_buffer_;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_DEVICE_MOTION_SHARED_MEMORY_READER_H_

Powered by Google App Engine
This is Rietveld 408576698