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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_gamepad_rpc_server.cc

Issue 9148044: Add NaCl proxy for pepper gamepad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing build file entry Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
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;
+}
« no previous file with comments | « ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc ('k') | ppapi/native_client/src/shared/ppapi_proxy/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698