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

Unified Diff: ppapi/thunk/ppb_gamepad_thunk.cc

Issue 14161017: Pepper: Simplify idl_thunk implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: on_failure comment nit Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/thunk/ppb_find_dev_thunk.cc ('k') | ppapi/thunk/ppb_messaging_thunk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_gamepad_thunk.cc
diff --git a/ppapi/thunk/ppb_gamepad_thunk.cc b/ppapi/thunk/ppb_gamepad_thunk.cc
index e2f0160589bd6731f90406da25f91ab594b5385d..e36af34410685782554f0734393e3099b0cb0bd5 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<PPB_Gamepad_API> 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 = {
« no previous file with comments | « ppapi/thunk/ppb_find_dev_thunk.cc ('k') | ppapi/thunk/ppb_messaging_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698