Commit 596d1c90 authored by haraken's avatar haraken Committed by Commit bot

Remove DOMWindowProperty from ScreenOrientationCoontroller

We're replacing DOMWindowProperty with ContextLifecycleObserver.
This CL does the replacement for ScreenOrientationCoontroller.

BUG=610176

Review-Url: https://codereview.chromium.org/2568913003
Cr-Commit-Position: refs/heads/master@{#439421}
parent ee81deee
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "modules/screen_orientation/ScreenOrientationControllerImpl.h" #include "modules/screen_orientation/ScreenOrientationControllerImpl.h"
#include "core/dom/Document.h"
#include "core/events/Event.h" #include "core/events/Event.h"
#include "core/frame/FrameHost.h" #include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h" #include "core/frame/FrameView.h"
...@@ -39,7 +40,7 @@ ScreenOrientationControllerImpl* ScreenOrientationControllerImpl::from( ...@@ -39,7 +40,7 @@ ScreenOrientationControllerImpl* ScreenOrientationControllerImpl::from(
ScreenOrientationControllerImpl::ScreenOrientationControllerImpl( ScreenOrientationControllerImpl::ScreenOrientationControllerImpl(
LocalFrame& frame, LocalFrame& frame,
WebScreenOrientationClient* client) WebScreenOrientationClient* client)
: DOMWindowProperty(&frame), : ContextLifecycleObserver(frame.document()),
PlatformEventController(frame.page()), PlatformEventController(frame.page()),
m_client(client), m_client(client),
m_dispatchEventTimer( m_dispatchEventTimer(
...@@ -82,7 +83,6 @@ void ScreenOrientationControllerImpl::updateOrientation() { ...@@ -82,7 +83,6 @@ void ScreenOrientationControllerImpl::updateOrientation() {
DCHECK(m_orientation); DCHECK(m_orientation);
DCHECK(frame()); DCHECK(frame());
DCHECK(frame()->host()); DCHECK(frame()->host());
ChromeClient& chromeClient = frame()->host()->chromeClient(); ChromeClient& chromeClient = frame()->host()->chromeClient();
WebScreenInfo screenInfo = chromeClient.screenInfo(); WebScreenInfo screenInfo = chromeClient.screenInfo();
WebScreenOrientationType orientationType = screenInfo.orientationType; WebScreenOrientationType orientationType = screenInfo.orientationType;
...@@ -208,10 +208,9 @@ bool ScreenOrientationControllerImpl::hasLastData() { ...@@ -208,10 +208,9 @@ bool ScreenOrientationControllerImpl::hasLastData() {
return true; return true;
} }
void ScreenOrientationControllerImpl::frameDestroyed() { void ScreenOrientationControllerImpl::contextDestroyed() {
stopUpdating(); stopUpdating();
m_client = nullptr; m_client = nullptr;
DOMWindowProperty::frameDestroyed();
m_activeLock = false; m_activeLock = false;
} }
...@@ -224,7 +223,7 @@ void ScreenOrientationControllerImpl::notifyDispatcher() { ...@@ -224,7 +223,7 @@ void ScreenOrientationControllerImpl::notifyDispatcher() {
DEFINE_TRACE(ScreenOrientationControllerImpl) { DEFINE_TRACE(ScreenOrientationControllerImpl) {
visitor->trace(m_orientation); visitor->trace(m_orientation);
DOMWindowProperty::trace(visitor); ContextLifecycleObserver::trace(visitor);
Supplement<LocalFrame>::trace(visitor); Supplement<LocalFrame>::trace(visitor);
PlatformEventController::trace(visitor); PlatformEventController::trace(visitor);
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef ScreenOrientationControllerImpl_h #ifndef ScreenOrientationControllerImpl_h
#define ScreenOrientationControllerImpl_h #define ScreenOrientationControllerImpl_h
#include "core/frame/DOMWindowProperty.h" #include "core/dom/Document.h"
#include "core/frame/PlatformEventController.h" #include "core/frame/PlatformEventController.h"
#include "core/frame/ScreenOrientationController.h" #include "core/frame/ScreenOrientationController.h"
#include "modules/ModulesExport.h" #include "modules/ModulesExport.h"
...@@ -23,7 +23,7 @@ class WebScreenOrientationClient; ...@@ -23,7 +23,7 @@ class WebScreenOrientationClient;
class MODULES_EXPORT ScreenOrientationControllerImpl final class MODULES_EXPORT ScreenOrientationControllerImpl final
: public GarbageCollectedFinalized<ScreenOrientationControllerImpl>, : public GarbageCollectedFinalized<ScreenOrientationControllerImpl>,
public ScreenOrientationController, public ScreenOrientationController,
public DOMWindowProperty, public ContextLifecycleObserver,
public PlatformEventController { public PlatformEventController {
USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationControllerImpl); USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationControllerImpl);
WTF_MAKE_NONCOPYABLE(ScreenOrientationControllerImpl); WTF_MAKE_NONCOPYABLE(ScreenOrientationControllerImpl);
...@@ -57,8 +57,8 @@ class MODULES_EXPORT ScreenOrientationControllerImpl final ...@@ -57,8 +57,8 @@ class MODULES_EXPORT ScreenOrientationControllerImpl final
bool hasLastData() override; bool hasLastData() override;
void pageVisibilityChanged() override; void pageVisibilityChanged() override;
// Inherited from DOMWindowProperty. // Inherited from ContextLifecycleObserver.
void frameDestroyed() override; void contextDestroyed() override;
void notifyDispatcher(); void notifyDispatcher();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment