From 135f59435e8aa4ee4ef60014569ab50fd5ff7775 Mon Sep 17 00:00:00 2001 From: "teravest@chromium.org" Date: Fri, 19 Apr 2013 14:25:18 +0000 Subject: Pepper: Simplify idl_thunk implementation. This gets rid of some code duplication, and rewrites functions in thunk files which return void to an alternate, equivalent form. BUG= Review URL: https://codereview.chromium.org/14161017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195180 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/thunk/ppb_gamepad_thunk.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ppapi/thunk/ppb_gamepad_thunk.cc') diff --git a/ppapi/thunk/ppb_gamepad_thunk.cc b/ppapi/thunk/ppb_gamepad_thunk.cc index e2f0160..e36af34 100644 --- a/ppapi/thunk/ppb_gamepad_thunk.cc +++ b/ppapi/thunk/ppb_gamepad_thunk.cc @@ -23,11 +23,11 @@ namespace { void Sample(PP_Instance instance, struct PP_GamepadsSampleData* data) { VLOG(4) << "PPB_Gamepad::Sample()"; EnterInstanceAPI enter(instance); - if (enter.succeeded()) { - enter.functions()->Sample(instance, data); + if (enter.failed()) { + memset(data, 0, sizeof(*data)); return; } - memset(data, 0, sizeof(*data)); + enter.functions()->Sample(instance, data); } const PPB_Gamepad_1_0 g_ppb_gamepad_thunk_1_0 = { -- cgit v1.1