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

Side by Side Diff: content/common/device_motion_messages.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: Created 7 years, 7 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // IPC messages for device motion. 5 // IPC messages for device motion.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include "ipc/ipc_message_macros.h" 8 #include "ipc/ipc_message_macros.h"
9 #include "ipc/ipc_param_traits.h"
10 #include "ipc/ipc_platform_file.h"
11 #include "base/shared_memory.h"
9 12
10 #define IPC_MESSAGE_START DeviceMotionMsgStart 13 #define IPC_MESSAGE_START DeviceMotionMsgStart
11 14
15 // Messages sent from the renderer to the browser.
16
17 // Asks the browser process to start polling, and return a shared memory
18 // handles that will hold the data from the hardware. See
19 // device_motion_hardware_buffer.h for a description of how synchronization is
20 // handled. The number of Starts should match the number of Stops.
21 IPC_SYNC_MESSAGE_CONTROL0_1(DeviceMotionHostMsg_StartPolling,
jamesr 2013/05/16 19:58:21 Why synchronous?
timvolodine 2013/05/20 18:18:48 we need a valid handle to the shared memory from t
22 base::SharedMemoryHandle /* handle */)
23
24 IPC_SYNC_MESSAGE_CONTROL0_0(DeviceMotionHostMsg_StopPolling)
jamesr 2013/05/16 19:58:21 Ditto - why synchronous?
timvolodine 2013/05/20 18:18:48 this can be async. Done.
25
26 // TODO(timvolodine): remove the methods below once the Device Motion
27 // is implemented.
28
12 IPC_STRUCT_BEGIN(DeviceMotionMsg_Updated_Params) 29 IPC_STRUCT_BEGIN(DeviceMotionMsg_Updated_Params)
13 // These fields have the same meaning as in device_motion::Motion. 30 // These fields have the same meaning as in device_motion::Motion.
14 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_x) 31 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_x)
15 IPC_STRUCT_MEMBER(double, acceleration_x) 32 IPC_STRUCT_MEMBER(double, acceleration_x)
16 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_y) 33 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_y)
17 IPC_STRUCT_MEMBER(double, acceleration_y) 34 IPC_STRUCT_MEMBER(double, acceleration_y)
18 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_z) 35 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_z)
19 IPC_STRUCT_MEMBER(double, acceleration_z) 36 IPC_STRUCT_MEMBER(double, acceleration_z)
20 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_including_gravity_x) 37 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_including_gravity_x)
21 IPC_STRUCT_MEMBER(double, acceleration_including_gravity_x) 38 IPC_STRUCT_MEMBER(double, acceleration_including_gravity_x)
(...skipping 19 matching lines...) Expand all
41 58
42 // Messages sent from the renderer to the browser. 59 // Messages sent from the renderer to the browser.
43 60
44 // A RenderView requests to start receiving device motion updates. 61 // A RenderView requests to start receiving device motion updates.
45 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StartUpdating, 62 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StartUpdating,
46 int /* render_view_id */) 63 int /* render_view_id */)
47 64
48 // A RenderView requests to stop receiving device motion updates. 65 // A RenderView requests to stop receiving device motion updates.
49 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StopUpdating, 66 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StopUpdating,
50 int /* render_view_id */) 67 int /* render_view_id */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698