OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // IPC messages for device motion. | |
6 // Multiply-included message file, hence no include guard. | |
7 | |
8 #include "base/memory/shared_memory.h" | |
9 #include "ipc/ipc_message_macros.h" | |
10 #include "ipc/ipc_param_traits.h" | |
11 #include "ipc/ipc_platform_file.h" | |
12 | |
13 #define IPC_MESSAGE_START DeviceMotionMsgStart | |
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_MESSAGE_CONTROL0(DeviceMotionHostMsg_StartPolling) | |
22 IPC_MESSAGE_CONTROL1(DeviceMotionMsg_DidStartPolling, | |
23 base::SharedMemoryHandle /* handle */) | |
24 | |
25 IPC_MESSAGE_CONTROL0(DeviceMotionHostMsg_StopPolling) | |
26 | |
27 // TODO(timvolodine): remove the methods below once the Device Motion | |
28 // is implemented. | |
29 | |
30 IPC_STRUCT_BEGIN(DeviceMotionMsg_Updated_Params) | |
31 // These fields have the same meaning as in device_motion::Motion. | |
32 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_x) | |
33 IPC_STRUCT_MEMBER(double, acceleration_x) | |
34 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_y) | |
35 IPC_STRUCT_MEMBER(double, acceleration_y) | |
36 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_z) | |
37 IPC_STRUCT_MEMBER(double, acceleration_z) | |
38 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_including_gravity_x) | |
39 IPC_STRUCT_MEMBER(double, acceleration_including_gravity_x) | |
40 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_including_gravity_y) | |
41 IPC_STRUCT_MEMBER(double, acceleration_including_gravity_y) | |
42 IPC_STRUCT_MEMBER(bool, can_provide_acceleration_including_gravity_z) | |
43 IPC_STRUCT_MEMBER(double, acceleration_including_gravity_z) | |
44 IPC_STRUCT_MEMBER(bool, can_provide_rotation_rate_alpha) | |
45 IPC_STRUCT_MEMBER(double, rotation_rate_alpha) | |
46 IPC_STRUCT_MEMBER(bool, can_provide_rotation_rate_beta) | |
47 IPC_STRUCT_MEMBER(double, rotation_rate_beta) | |
48 IPC_STRUCT_MEMBER(bool, can_provide_rotation_rate_gamma) | |
49 IPC_STRUCT_MEMBER(double, rotation_rate_gamma) | |
50 IPC_STRUCT_MEMBER(bool, can_provide_interval) | |
51 IPC_STRUCT_MEMBER(double, interval) | |
52 IPC_STRUCT_END() | |
53 | |
54 // Messages sent from the browser to the renderer. | |
55 | |
56 // Notification that the device's motion has changed. | |
57 IPC_MESSAGE_ROUTED1(DeviceMotionMsg_Updated, | |
58 DeviceMotionMsg_Updated_Params) | |
59 | |
60 // Messages sent from the renderer to the browser. | |
61 | |
62 // A RenderView requests to start receiving device motion updates. | |
63 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StartUpdating, | |
64 int /* render_view_id */) | |
65 | |
66 // A RenderView requests to stop receiving device motion updates. | |
67 IPC_MESSAGE_CONTROL1(DeviceMotionHostMsg_StopUpdating, | |
68 int /* render_view_id */) | |
OLD | NEW |