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

Unified Diff: Source/modules/screen_orientation/ScreenOrientationController.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/screen_orientation/ScreenOrientationController.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientationController.cpp b/Source/modules/screen_orientation/ScreenOrientationController.cpp
index 49c11dbfd772bd9372822351f4e24b10ff415d60..c3f9974088792d15d72323d61227ca46cf994e01 100644
--- a/Source/modules/screen_orientation/ScreenOrientationController.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientationController.cpp
@@ -18,14 +18,14 @@ ScreenOrientationController::~ScreenOrientationController()
ScreenOrientationDispatcher::instance().removeController(this);
}
-ScreenOrientationController* ScreenOrientationController::from(Document* document)
+ScreenOrientationController& ScreenOrientationController::from(Document& document)
{
ScreenOrientationController* controller = static_cast<ScreenOrientationController*>(DocumentSupplement::from(document, supplementName()));
if (!controller) {
- controller = new ScreenOrientationController(*document);
+ controller = new ScreenOrientationController(document);
DocumentSupplement::provideTo(document, supplementName(), adoptPtr(controller));
}
- return controller;
+ return *controller;
}
ScreenOrientationController::ScreenOrientationController(Document& document)

Powered by Google App Engine
This is Rietveld 408576698