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

Unified Diff: Source/modules/gamepad/NavigatorGamepad.cpp

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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
Index: Source/modules/gamepad/NavigatorGamepad.cpp
diff --git a/Source/modules/gamepad/NavigatorGamepad.cpp b/Source/modules/gamepad/NavigatorGamepad.cpp
index 5370c2236797a2e333c102700d6851cda3b7bcd8..81f0e7708bb018e28ae8fd780f637511e1efba5d 100644
--- a/Source/modules/gamepad/NavigatorGamepad.cpp
+++ b/Source/modules/gamepad/NavigatorGamepad.cpp
@@ -70,19 +70,19 @@ const char* NavigatorGamepad::supplementName()
return "NavigatorGamepad";
}
-NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator)
+NavigatorGamepad& NavigatorGamepad::from(Navigator& navigator)
{
NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
supplement = new NavigatorGamepad();
provideTo(navigator, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-GamepadList* NavigatorGamepad::webkitGetGamepads(Navigator* navigator)
+GamepadList* NavigatorGamepad::webkitGetGamepads(Navigator& navigator)
{
- return NavigatorGamepad::from(navigator)->gamepads();
+ return NavigatorGamepad::from(navigator).gamepads();
}
GamepadList* NavigatorGamepad::gamepads()

Powered by Google App Engine
This is Rietveld 408576698