blob: 8e49e5219973674284a6c764135ab4cb0d883510 [file] [log] [blame]
[email protected]0a424af2012-01-10 19:24:281// 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
3// found in the LICENSE file.
4
[email protected]b3fcc412014-01-16 04:34:375// From ppb_gamepad.idl modified Fri Nov 15 14:40:57 2013.
[email protected]2a7e8c52013-03-30 00:13:256
[email protected]f5118812012-08-24 19:54:307#include <string.h>
8
[email protected]2a7e8c52013-03-30 00:13:259#include "ppapi/c/pp_errors.h"
[email protected]d5cc7192012-03-07 16:53:1610#include "ppapi/c/ppb_gamepad.h"
[email protected]2a7e8c52013-03-30 00:13:2511#include "ppapi/shared_impl/tracked_callback.h"
[email protected]0a424af2012-01-10 19:24:2812#include "ppapi/thunk/enter.h"
[email protected]b3fcc412014-01-16 04:34:3713#include "ppapi/thunk/ppapi_thunk_export.h"
[email protected]f5118812012-08-24 19:54:3014#include "ppapi/thunk/ppb_gamepad_api.h"
[email protected]0a424af2012-01-10 19:24:2815
16namespace ppapi {
17namespace thunk {
18
19namespace {
20
[email protected]2a7e8c52013-03-30 00:13:2521void Sample(PP_Instance instance, struct PP_GamepadsSampleData* data) {
[email protected]03f8b542013-04-02 17:57:5022 VLOG(4) << "PPB_Gamepad::Sample()";
[email protected]109dcfb2012-11-29 17:59:1923 EnterInstanceAPI<PPB_Gamepad_API> enter(instance);
[email protected]135f5942013-04-19 14:25:1824 if (enter.failed()) {
25 memset(data, 0, sizeof(*data));
[email protected]109dcfb2012-11-29 17:59:1926 return;
[email protected]f5118812012-08-24 19:54:3027 }
[email protected]135f5942013-04-19 14:25:1828 enter.functions()->Sample(instance, data);
[email protected]0a424af2012-01-10 19:24:2829}
30
[email protected]2a7e8c52013-03-30 00:13:2531const PPB_Gamepad_1_0 g_ppb_gamepad_thunk_1_0 = {
32 &Sample
[email protected]0a424af2012-01-10 19:24:2833};
34
35} // namespace
36
[email protected]b3fcc412014-01-16 04:34:3737PPAPI_THUNK_EXPORT const PPB_Gamepad_1_0* GetPPB_Gamepad_1_0_Thunk() {
[email protected]2a7e8c52013-03-30 00:13:2538 return &g_ppb_gamepad_thunk_1_0;
[email protected]0a424af2012-01-10 19:24:2839}
40
41} // namespace thunk
42} // namespace ppapi