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

Unified Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 165443003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/ScreenOrientation.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp
index 4b147dd809a0f4ee807ee0cd9fb9fe5145c8ce0e..d7723c404b39d3519bc3ef3bd7b0458104acd68f 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp
@@ -11,8 +11,8 @@
namespace WebCore {
-ScreenOrientation::ScreenOrientation(Screen* screen)
- : DOMWindowProperty(screen->frame())
+ScreenOrientation::ScreenOrientation(Screen& screen)
+ : DOMWindowProperty(screen.frame())
{
}
@@ -21,15 +21,14 @@ const char* ScreenOrientation::supplementName()
return "ScreenOrientation";
}
-ScreenOrientation* ScreenOrientation::from(Screen* screen)
+ScreenOrientation& ScreenOrientation::from(Screen& screen)
{
ScreenOrientation* supplement = static_cast<ScreenOrientation*>(Supplement<Screen>::from(screen, supplementName()));
if (!supplement) {
- ASSERT(screen);
supplement = new ScreenOrientation(screen);
provideTo(screen, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
ScreenOrientation::~ScreenOrientation()
@@ -45,26 +44,26 @@ Screen* ScreenOrientation::screen() const
return window->screen();
}
-const AtomicString& ScreenOrientation::orientation(Screen* screen)
+const AtomicString& ScreenOrientation::orientation(Screen& screen)
{
// FIXME: Implement.
DEFINE_STATIC_LOCAL(const AtomicString, portraitPrimary, ("portrait-primary", AtomicString::ConstructFromLiteral));
return portraitPrimary;
}
-bool ScreenOrientation::lockOrientation(Screen* screen, const Vector<String>& orientations)
+bool ScreenOrientation::lockOrientation(Screen& screen, const Vector<String>& orientations)
{
// FIXME: Implement.
return false;
}
-bool ScreenOrientation::lockOrientation(Screen* screen, const AtomicString& orientation)
+bool ScreenOrientation::lockOrientation(Screen& screen, const AtomicString& orientation)
{
// FIXME: Implement.
return false;
}
-void ScreenOrientation::unlockOrientation(Screen* screen)
+void ScreenOrientation::unlockOrientation(Screen& screen)
{
// FIXME: Implement.
}
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.h ('k') | Source/modules/serviceworkers/NavigatorServiceWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698