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

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

Powered by Google App Engine
This is Rietveld 408576698