| OLD | NEW |
| 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 // From ppb_gamepad.idl modified Thu Mar 28 15:36:32 2013. |
| 6 |
| 5 #include <string.h> | 7 #include <string.h> |
| 6 | 8 |
| 9 #include "ppapi/c/pp_errors.h" |
| 7 #include "ppapi/c/ppb_gamepad.h" | 10 #include "ppapi/c/ppb_gamepad.h" |
| 8 #include "ppapi/thunk/thunk.h" | 11 #include "ppapi/shared_impl/tracked_callback.h" |
| 9 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
| 10 #include "ppapi/thunk/ppb_gamepad_api.h" | 13 #include "ppapi/thunk/ppb_gamepad_api.h" |
| 11 #include "ppapi/thunk/ppb_instance_api.h" | 14 #include "ppapi/thunk/ppb_instance_api.h" |
| 12 #include "ppapi/thunk/resource_creation_api.h" | 15 #include "ppapi/thunk/resource_creation_api.h" |
| 16 #include "ppapi/thunk/thunk.h" |
| 13 | 17 |
| 14 namespace ppapi { | 18 namespace ppapi { |
| 15 namespace thunk { | 19 namespace thunk { |
| 16 | 20 |
| 17 namespace { | 21 namespace { |
| 18 | 22 |
| 19 void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data) { | 23 void Sample(PP_Instance instance, struct PP_GamepadsSampleData* data) { |
| 20 EnterInstanceAPI<PPB_Gamepad_API> enter(instance); | 24 EnterInstanceAPI<PPB_Gamepad_API> enter(instance); |
| 21 if (enter.succeeded()) { | 25 if (enter.succeeded()) { |
| 22 enter.functions()->Sample(instance, data); | 26 enter.functions()->Sample(instance, data); |
| 23 return; | 27 return; |
| 24 } | 28 } |
| 25 // Failure, zero out. | 29 memset(data, 0, sizeof(struct PP_GamepadsSampleData)); |
| 26 memset(data, 0, sizeof(PP_GamepadsSampleData)); | |
| 27 } | 30 } |
| 28 | 31 |
| 29 const PPB_Gamepad g_ppb_gamepad_thunk = { | 32 const PPB_Gamepad_1_0 g_ppb_gamepad_thunk_1_0 = { |
| 30 &SampleGamepads, | 33 &Sample |
| 31 }; | 34 }; |
| 32 | 35 |
| 33 } // namespace | 36 } // namespace |
| 34 | 37 |
| 35 const PPB_Gamepad* GetPPB_Gamepad_1_0_Thunk() { | 38 const PPB_Gamepad_1_0* GetPPB_Gamepad_1_0_Thunk() { |
| 36 return &g_ppb_gamepad_thunk; | 39 return &g_ppb_gamepad_thunk_1_0; |
| 37 } | 40 } |
| 38 | 41 |
| 39 } // namespace thunk | 42 } // namespace thunk |
| 40 } // namespace ppapi | 43 } // namespace ppapi |
| OLD | NEW |