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

Unified Diff: Source/modules/device_orientation/DeviceMotionController.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/device_orientation/DeviceMotionController.cpp
diff --git a/Source/modules/device_orientation/DeviceMotionController.cpp b/Source/modules/device_orientation/DeviceMotionController.cpp
index 877fe372663d6bf364aec4779e3b23b7ee74a48e..9aec05c77e4127be9988516f2b230b3f4e1042e1 100644
--- a/Source/modules/device_orientation/DeviceMotionController.cpp
+++ b/Source/modules/device_orientation/DeviceMotionController.cpp
@@ -37,9 +37,9 @@
namespace WebCore {
-DeviceMotionController::DeviceMotionController(Document* document)
+DeviceMotionController::DeviceMotionController(Document& document)
: DeviceSensorEventController(document)
- , DOMWindowLifecycleObserver(document->domWindow())
+ , DOMWindowLifecycleObserver(document.domWindow())
{
}
@@ -58,14 +58,14 @@ const char* DeviceMotionController::supplementName()
return "DeviceMotionController";
}
-DeviceMotionController* DeviceMotionController::from(Document* document)
+DeviceMotionController& DeviceMotionController::from(Document& document)
{
DeviceMotionController* controller = static_cast<DeviceMotionController*>(DocumentSupplement::from(document, supplementName()));
if (!controller) {
controller = new DeviceMotionController(document);
DocumentSupplement::provideTo(document, supplementName(), adoptPtr(controller));
}
- return controller;
+ return *controller;
}
bool DeviceMotionController::hasLastData()

Powered by Google App Engine
This is Rietveld 408576698