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

Side by Side Diff: ppapi/thunk/ppb_gamepad_thunk.cc

Issue 12568010: Cleanup: Make gamepad API consistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment out unused parameters. Created 7 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
« no previous file with comments | « ppapi/thunk/ppb_gamepad_api.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string.h> 5 #include <string.h>
6 6
7 #include "ppapi/c/ppb_gamepad.h" 7 #include "ppapi/c/ppb_gamepad.h"
8 #include "ppapi/thunk/thunk.h" 8 #include "ppapi/thunk/thunk.h"
9 #include "ppapi/thunk/enter.h" 9 #include "ppapi/thunk/enter.h"
10 #include "ppapi/thunk/ppb_gamepad_api.h" 10 #include "ppapi/thunk/ppb_gamepad_api.h"
11 #include "ppapi/thunk/ppb_instance_api.h" 11 #include "ppapi/thunk/ppb_instance_api.h"
12 #include "ppapi/thunk/resource_creation_api.h" 12 #include "ppapi/thunk/resource_creation_api.h"
13 13
14 namespace ppapi { 14 namespace ppapi {
15 namespace thunk { 15 namespace thunk {
16 16
17 namespace { 17 namespace {
18 18
19 void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data) { 19 void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data) {
20 EnterInstanceAPI<PPB_Gamepad_API> enter(instance); 20 EnterInstanceAPI<PPB_Gamepad_API> enter(instance);
21 if (enter.succeeded()) { 21 if (enter.succeeded()) {
22 enter.functions()->Sample(data); 22 enter.functions()->Sample(instance, data);
23 return; 23 return;
24 } 24 }
25 // Failure, zero out. 25 // Failure, zero out.
26 memset(data, 0, sizeof(PP_GamepadsSampleData)); 26 memset(data, 0, sizeof(PP_GamepadsSampleData));
27 } 27 }
28 28
29 const PPB_Gamepad g_ppb_gamepad_thunk = { 29 const PPB_Gamepad g_ppb_gamepad_thunk = {
30 &SampleGamepads, 30 &SampleGamepads,
31 }; 31 };
32 32
33 } // namespace 33 } // namespace
34 34
35 const PPB_Gamepad* GetPPB_Gamepad_1_0_Thunk() { 35 const PPB_Gamepad* GetPPB_Gamepad_1_0_Thunk() {
36 return &g_ppb_gamepad_thunk; 36 return &g_ppb_gamepad_thunk;
37 } 37 }
38 38
39 } // namespace thunk 39 } // namespace thunk
40 } // namespace ppapi 40 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_gamepad_api.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698