10529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// IPC messages for device motion.
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Multiply-included message file, hence no include guard.
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
87dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "base/memory/shared_memory.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_macros.h"
107dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ipc/ipc_param_traits.h"
117dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ipc/ipc_platform_file.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START DeviceMotionMsgStart
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Asks the browser process to activate Device Motion sensors if necessary.
167dbb3d5cf0c15f500944d211057644d6a2f37371Ben MurdochIPC_MESSAGE_CONTROL0(DeviceMotionHostMsg_StartPolling)
171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// The browser process asynchronously returns the shared memory handle that will
191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// hold the data from the hardware sensors.
201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// See device_motion_hardware_buffer.h for a description of how
211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// synchronization is handled.
227dbb3d5cf0c15f500944d211057644d6a2f37371Ben MurdochIPC_MESSAGE_CONTROL1(DeviceMotionMsg_DidStartPolling,
237dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch                     base::SharedMemoryHandle /* handle */)
247dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Notifies the browser process that the renderer process is not using the
261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Device Motion data anymore. The number of Starts should match the number
271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// of Stops.
287dbb3d5cf0c15f500944d211057644d6a2f37371Ben MurdochIPC_MESSAGE_CONTROL0(DeviceMotionHostMsg_StopPolling)
29