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

Unified Diff: ppapi/thunk/ppb_gamepad_thunk.cc

Issue 11359063: Refactor the way singleton-style resources are exposed via PPB_Instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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
Index: ppapi/thunk/ppb_gamepad_thunk.cc
diff --git a/ppapi/thunk/ppb_gamepad_thunk.cc b/ppapi/thunk/ppb_gamepad_thunk.cc
index 3aeedb57dea12d116e6b0f112e98327f5ff1510b..de2c8be04cf54f30dcd3ed82d82087d23f3e0abf 100644
--- a/ppapi/thunk/ppb_gamepad_thunk.cc
+++ b/ppapi/thunk/ppb_gamepad_thunk.cc
@@ -17,13 +17,10 @@ namespace thunk {
namespace {
void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data) {
- EnterInstance enter(instance);
+ EnterInstanceAPI<PPB_Gamepad_API> enter(instance);
if (enter.succeeded()) {
- PPB_Gamepad_API* api = enter.functions()->GetGamepadAPI(instance);
- if (api) {
- api->Sample(data);
- return;
- }
+ enter.functions()->Sample(data);
+ return;
}
// Failure, zero out.
memset(data, 0, sizeof(PP_GamepadsSampleData));

Powered by Google App Engine
This is Rietveld 408576698