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