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

Unified Diff: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp

Issue 2568913003: Remove DOMWindowProperty from ScreenOrientationCoontroller (Closed)
Patch Set: temp Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
index 6414baef66c55afa760a044a6f1d2ab093455023..4b7b693c5868a6e0fcf9c172b045820929f74657 100644
--- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
+++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.cpp
@@ -4,6 +4,7 @@
#include "modules/screen_orientation/ScreenOrientationControllerImpl.h"
+#include "core/dom/Document.h"
#include "core/events/Event.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
@@ -39,7 +40,7 @@ ScreenOrientationControllerImpl* ScreenOrientationControllerImpl::from(
ScreenOrientationControllerImpl::ScreenOrientationControllerImpl(
LocalFrame& frame,
WebScreenOrientationClient* client)
- : DOMWindowProperty(&frame),
+ : ContextLifecycleObserver(frame.document()),
PlatformEventController(frame.page()),
m_client(client),
m_dispatchEventTimer(
@@ -80,9 +81,13 @@ WebScreenOrientationType ScreenOrientationControllerImpl::computeOrientation(
void ScreenOrientationControllerImpl::updateOrientation() {
DCHECK(m_orientation);
- DCHECK(frame());
- DCHECK(frame()->host());
+ if (!frame()) {
+ m_orientation->setType(WebScreenOrientationPortraitPrimary);
+ return;
+ }
+
+ DCHECK(frame()->host());
ChromeClient& chromeClient = frame()->host()->chromeClient();
WebScreenInfo screenInfo = chromeClient.screenInfo();
WebScreenOrientationType orientationType = screenInfo.orientationType;
@@ -208,9 +213,9 @@ bool ScreenOrientationControllerImpl::hasLastData() {
return true;
}
-void ScreenOrientationControllerImpl::frameDestroyed() {
+void ScreenOrientationControllerImpl::contextDestroyed() {
+ stopUpdating();
sof 2016/12/14 14:00:31 Seems like this is too strong a measure.
m_client = nullptr;
- DOMWindowProperty::frameDestroyed();
m_activeLock = false;
}
@@ -223,7 +228,7 @@ void ScreenOrientationControllerImpl::notifyDispatcher() {
DEFINE_TRACE(ScreenOrientationControllerImpl) {
visitor->trace(m_orientation);
- DOMWindowProperty::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
Supplement<LocalFrame>::trace(visitor);
PlatformEventController::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/modules/screen_orientation/ScreenOrientationControllerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698