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

Unified Diff: content/common/device_orientation/device_orientation_messages.h

Issue 20707002: Implement Device Orientation using shared memory in content/renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed owners 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
Index: content/common/device_orientation/device_orientation_messages.h
diff --git a/content/common/device_orientation/device_orientation_messages.h b/content/common/device_orientation/device_orientation_messages.h
new file mode 100644
index 0000000000000000000000000000000000000000..ea8bd4ad91bc5f8e66048d833f4f16eb939618d7
--- /dev/null
+++ b/content/common/device_orientation/device_orientation_messages.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 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.
+
+// IPC messages for device orientation.
+// Multiply-included message file, hence no include guard.
+
+#include "base/memory/shared_memory.h"
+#include "ipc/ipc_message_macros.h"
+
+#define IPC_MESSAGE_START DeviceOrientationMsgStart
+
+// Messages sent from the renderer to the browser.
+
+// Asks the browser process to start polling, and return a shared memory
+// handles that will hold the data from the hardware. See
palmer 2013/08/02 19:10:37 Typo: "handle", singular
timvolodine 2013/08/05 15:26:47 Done.
+// device_motion_hardware_buffer.h for a description of how synchronization is
+// handled. The number of Starts should match the number of Stops.
+IPC_MESSAGE_CONTROL0(DeviceOrientationHostMsg_StartPolling)
+IPC_MESSAGE_CONTROL1(DeviceOrientationMsg_DidStartPolling,
+ base::SharedMemoryHandle /* handle */)
+
+IPC_MESSAGE_CONTROL0(DeviceOrientationHostMsg_StopPolling)
+
+// TODO(timvolodine): remove the methods below once the shared memory
+// Device Orientation is implemented.
+
+IPC_STRUCT_BEGIN(DeviceOrientationMsg_Updated_Params)
+ // These fields have the same meaning as in content::Orientation.
+ IPC_STRUCT_MEMBER(bool, can_provide_alpha)
+ IPC_STRUCT_MEMBER(double, alpha)
+ IPC_STRUCT_MEMBER(bool, can_provide_beta)
+ IPC_STRUCT_MEMBER(double, beta)
+ IPC_STRUCT_MEMBER(bool, can_provide_gamma)
+ IPC_STRUCT_MEMBER(double, gamma)
+ IPC_STRUCT_MEMBER(bool, can_provide_absolute)
+ IPC_STRUCT_MEMBER(bool, absolute)
+IPC_STRUCT_END()
+
+// Messages sent from the browser to the renderer.
+
+// Notification that the device's orientation has changed.
+IPC_MESSAGE_ROUTED1(DeviceOrientationMsg_Updated,
+ DeviceOrientationMsg_Updated_Params)
+
+// Messages sent from the renderer to the browser.
+
+// A RenderView requests to start receiving device orientation updates.
+IPC_MESSAGE_CONTROL1(DeviceOrientationHostMsg_StartUpdating,
+ int /* render_view_id */)
+
+// A RenderView requests to stop receiving device orientation updates.
+IPC_MESSAGE_CONTROL1(DeviceOrientationHostMsg_StopUpdating,
+ int /* render_view_id */)

Powered by Google App Engine
This is Rietveld 408576698