Index: Source/modules/screen_orientation/ScreenOrientation.cpp |
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp |
index 36d6369b9f85c98d27dcff195970b037019c23c2..df4563a66cba3d71bd42dfde204ff9ef6bf59954 100644 |
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp |
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp |
@@ -49,8 +49,8 @@ static const AtomicString& orientationToString(blink::WebScreenOrientation orien |
return nullAtom; |
} |
-ScreenOrientation::ScreenOrientation(Screen* screen) |
- : DOMWindowProperty(screen->frame()) |
+ScreenOrientation::ScreenOrientation(Screen& screen) |
+ : DOMWindowProperty(screen.frame()) |
{ |
} |
@@ -59,48 +59,47 @@ const char* ScreenOrientation::supplementName() |
return "ScreenOrientation"; |
} |
-Document* ScreenOrientation::document() const |
+Document& ScreenOrientation::document() const |
{ |
ASSERT(m_associatedDOMWindow); |
- return m_associatedDOMWindow->document(); |
+ ASSERT(m_associatedDOMWindow->document()); |
dcheng
2014/02/28 20:54:42
Please be careful when making these changes. The o
dcheng
2014/02/28 21:13:41
Actually, I'm wrong so ignore me for now. Sorry fo
|
+ return *m_associatedDOMWindow->document(); |
} |
-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() |
{ |
} |
-const AtomicString& ScreenOrientation::orientation(Screen* screen) |
+const AtomicString& ScreenOrientation::orientation(Screen& screen) |
{ |
- ScreenOrientation* screenOrientation = ScreenOrientation::from(screen); |
- ScreenOrientationController* controller = ScreenOrientationController::from(screenOrientation->document()); |
- ASSERT(controller); |
- return orientationToString(controller->orientation()); |
+ ScreenOrientation& screenOrientation = ScreenOrientation::from(screen); |
+ ScreenOrientationController& controller = ScreenOrientationController::from(screenOrientation.document()); |
+ return orientationToString(controller.orientation()); |
} |
-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. |
} |