Chromium Code Reviews| Index: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc |
| diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e74bd2432d46a26bf03ce1fbbc47d1932dc4e0ef |
| --- /dev/null |
| +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
|
bbudge
2012/01/11 23:52:59
2012
scottmg
2012/01/11 23:58:25
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +// |
| +// SRPC-abstraction wrappers around PPB_Gamepad functions. |
| + |
| +#include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| +#include "native_client/src/shared/ppapi_proxy/utility.h" |
| +#include "ppapi/c/dev/ppb_gamepad_dev.h" |
| +#include "srpcgen/ppb_rpc.h" |
| + |
| +using ppapi_proxy::DebugPrintf; |
| +using ppapi_proxy::PPBGamepadInterface; |
| + |
| +void PpbGamepadRpcServer::PPB_Gamepad_SampleGamepads( |
| + NaClSrpcRpc* rpc, |
| + NaClSrpcClosure* done, |
| + // inputs |
| + PP_Instance instance, |
| + // outputs |
| + nacl_abi_size_t* pads_bytes, char* pads) { |
| + NaClSrpcClosureRunner runner(done); |
| + rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
| + if (*pads_bytes != sizeof(struct PP_GamepadsData_Dev)) |
| + return; |
| + |
| + PPBGamepadInterface()->SampleGamepads( |
| + instance, |
| + reinterpret_cast<struct PP_GamepadsData_Dev*>(pads)); |
| + DebugPrintf("PPB_Gamepad::SampleGamepads\n"); |
| + |
| + rpc->result = NACL_SRPC_RESULT_OK; |
| +} |