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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_gamepad.cc

Issue 9566022: Rename NaCl/pepper gamepad interface from _dev to stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "native_client/src/shared/ppapi_proxy/plugin_instance_data.h" 5 #include "native_client/src/shared/ppapi_proxy/plugin_instance_data.h"
6 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_gamepad.h" 6 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_gamepad.h"
7 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" 7 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
8 #include "native_client/src/shared/ppapi_proxy/utility.h" 8 #include "native_client/src/shared/ppapi_proxy/utility.h"
9 #include "ppapi/c/pp_size.h" 9 #include "ppapi/c/pp_size.h"
10 #include "ppapi/c/dev/ppb_fullscreen_dev.h"
11 #include "srpcgen/ppb_rpc.h" 10 #include "srpcgen/ppb_rpc.h"
12 11
13 namespace ppapi_proxy { 12 namespace ppapi_proxy {
14 13
15 namespace { 14 namespace {
16 15
17 void SampleGamepads(PP_Instance instance, 16 void SampleGamepads(PP_Instance instance,
18 struct PP_GamepadsSampleData_Dev* pads) { 17 struct PP_GamepadsSampleData* pads) {
19 DebugPrintf("PPB_Gamepad::SampleGamepads: instance=%"NACL_PRId32"\n", 18 DebugPrintf("PPB_Gamepad::SampleGamepads: instance=%"NACL_PRId32"\n",
20 instance); 19 instance);
21 if (pads == NULL) 20 if (pads == NULL)
22 return; 21 return;
23 22
24 nacl_abi_size_t pads_bytes = 23 nacl_abi_size_t pads_bytes =
25 static_cast<nacl_abi_size_t>(sizeof(struct PP_GamepadsSampleData_Dev)); 24 static_cast<nacl_abi_size_t>(sizeof(struct PP_GamepadsSampleData));
26 NaClSrpcError srpc_result = 25 NaClSrpcError srpc_result =
27 PpbGamepadRpcClient::PPB_Gamepad_SampleGamepads( 26 PpbGamepadRpcClient::PPB_Gamepad_Sample(
28 GetMainSrpcChannel(), 27 GetMainSrpcChannel(),
29 instance, 28 instance,
30 &pads_bytes, 29 &pads_bytes,
31 reinterpret_cast<char*>(pads)); 30 reinterpret_cast<char*>(pads));
32 DebugPrintf("PPB_Gamepad::SampleGamepads: %s\n", 31 DebugPrintf("PPB_Gamepad::SampleGamepads: %s\n",
33 NaClSrpcErrorString(srpc_result)); 32 NaClSrpcErrorString(srpc_result));
34 33
35 if (srpc_result != NACL_SRPC_RESULT_OK) 34 if (srpc_result != NACL_SRPC_RESULT_OK)
36 pads->length = 0; 35 pads->length = 0;
37 } 36 }
38 37
39 } // namespace 38 } // namespace
40 39
41 const PPB_Gamepad_Dev* PluginGamepad::GetInterface() { 40 const PPB_Gamepad* PluginGamepad::GetInterface() {
42 static const PPB_Gamepad_Dev gamepad_interface = { 41 static const PPB_Gamepad gamepad_interface = {
43 SampleGamepads 42 SampleGamepads
44 }; 43 };
45 return &gamepad_interface; 44 return &gamepad_interface;
46 } 45 }
47 46
48 } // namespace ppapi_proxy 47 } // namespace ppapi_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698