| 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..313e83db50c362bfc49be97465a7d7386d614c31
|
| --- /dev/null
|
| +++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc
|
| @@ -0,0 +1,33 @@
|
| +// 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.
|
| +//
|
| +// 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;
|
| +}
|
|
|