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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 901663005: Revert r189385 "Remove LifecycleContext" and r189391, r189530, r189456 that block it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 9bdf3d277d7123b3121055e6e2cafbd70358e97f..21ea7a4fd548428bda10d12abae0ed2e024e0215 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -382,8 +382,7 @@ bool LocalDOMWindow::canShowModalDialogNow(const LocalFrame* frame)
}
LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
- : DOMWindowLifecycleNotifier(this)
- , m_frameObserver(WindowFrameObserver::create(this, frame))
+ : m_frameObserver(WindowFrameObserver::create(this, frame))
, m_shouldPrintWhenFinishedLoading(false)
#if ENABLE(ASSERT)
, m_hasBeenReset(false)
@@ -901,9 +900,9 @@ void LocalDOMWindow::focus(ExecutionContext* context)
ASSERT(context);
- bool allowFocus = context->isWindowInteractionAllowed();
+ bool allowFocus = context->isWindowFocusAllowed();
if (allowFocus) {
- context->consumeWindowInteraction();
+ context->consumeWindowFocus();
} else {
ASSERT(isMainThread());
allowFocus = opener() && (opener() != this) && (toDocument(context)->domWindow() == opener());
@@ -1506,7 +1505,7 @@ bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<
document->addListenerTypeIfNeeded(eventType);
}
- notifyAddEventListener(this, eventType);
+ lifecycleNotifier().notifyAddEventListener(this, eventType);
if (eventType == EventTypeNames::unload) {
UseCounter::count(document(), UseCounter::DocumentUnloadRegistered);
@@ -1535,7 +1534,7 @@ bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, PassRefP
if (frame() && frame()->host())
frame()->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eventType);
- notifyRemoveEventListener(this, eventType);
+ lifecycleNotifier().notifyRemoveEventListener(this, eventType);
if (eventType == EventTypeNames::unload) {
removeUnloadEventListener(this);
@@ -1599,7 +1598,7 @@ void LocalDOMWindow::removeAllEventListenersInternal(BroadcastListenerRemoval mo
EventTarget::removeAllEventListeners();
if (mode == DoBroadcastListenerRemoval) {
- notifyRemoveAllEventListeners(this);
+ lifecycleNotifier().notifyRemoveAllEventListeners(this);
if (frame() && frame()->host())
frame()->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
}
@@ -1792,6 +1791,16 @@ void LocalDOMWindow::showModalDialog(const String& urlString, const String& dial
dialogFrame->host()->chrome().runModal();
}
+DOMWindowLifecycleNotifier& LocalDOMWindow::lifecycleNotifier()
+{
+ return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWindow>::lifecycleNotifier());
+}
+
+PassOwnPtr<LifecycleNotifier<LocalDOMWindow>> LocalDOMWindow::createLifecycleNotifier()
+{
+ return DOMWindowLifecycleNotifier::create(this);
+}
+
void LocalDOMWindow::trace(Visitor* visitor)
{
#if ENABLE(OILPAN)
@@ -1818,7 +1827,7 @@ void LocalDOMWindow::trace(Visitor* visitor)
HeapSupplementable<LocalDOMWindow>::trace(visitor);
#endif
DOMWindow::trace(visitor);
- DOMWindowLifecycleNotifier::trace(visitor);
+ LifecycleContext<LocalDOMWindow>::trace(visitor);
}
LocalFrame* LocalDOMWindow::frame() const
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698