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

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

Issue 2134063002: Remove DOMWindowLifecycleObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 785f15887741aa1562e9c8c165092844f43adf85..fc8f98bad6aba05d06b2f72315a4705ffb25092f 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -499,7 +499,6 @@ MediaQueryList* LocalDOMWindow::matchMedia(const String& media)
void LocalDOMWindow::willDetachFrameHost()
{
frame()->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
- LocalDOMWindow::notifyContextDestroyed();
}
void LocalDOMWindow::frameDestroyed()
@@ -532,6 +531,11 @@ void LocalDOMWindow::unregisterProperty(DOMWindowProperty* property)
m_properties.remove(property);
}
+void LocalDOMWindow::registerEventListenerObserver(EventListenerObserver* eventListenerObserver)
+{
+ m_eventListenerObservers.add(eventListenerObserver);
+}
+
void LocalDOMWindow::reset()
{
m_frameObserver->contextDestroyed();
@@ -548,8 +552,6 @@ void LocalDOMWindow::reset()
m_media = nullptr;
m_customElements = nullptr;
m_applicationCache = nullptr;
-
- LocalDOMWindow::notifyContextDestroyed();
}
void LocalDOMWindow::sendOrientationChangeEvent()
@@ -1367,7 +1369,9 @@ void LocalDOMWindow::addedEventListener(const AtomicString& eventType, Registere
if (Document* document = this->document())
document->addListenerTypeIfNeeded(eventType);
- notifyAddEventListener(this, eventType);
+ for (auto& it : m_eventListenerObservers) {
+ it->didAddEventListener(this, eventType);
+ }
if (eventType == EventTypeNames::unload) {
UseCounter::count(document(), UseCounter::DocumentUnloadRegistered);
@@ -1392,7 +1396,9 @@ void LocalDOMWindow::removedEventListener(const AtomicString& eventType, const R
if (frame() && frame()->host())
frame()->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eventType, registeredListener.options());
- notifyRemoveEventListener(this, eventType);
+ for (auto& it : m_eventListenerObservers) {
+ it->didRemoveEventListener(this, eventType);
+ }
if (eventType == EventTypeNames::unload) {
removeUnloadEventListener(this);
@@ -1442,7 +1448,10 @@ void LocalDOMWindow::removeAllEventListeners()
{
EventTarget::removeAllEventListeners();
- notifyRemoveAllEventListeners(this);
+ for (auto& it : m_eventListenerObservers) {
+ it->didRemoveAllEventListeners(this);
+ }
+
if (frame() && frame()->host())
frame()->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
@@ -1547,9 +1556,9 @@ DEFINE_TRACE(LocalDOMWindow)
visitor->trace(m_eventQueue);
visitor->trace(m_postMessageTimers);
visitor->trace(m_visualViewport);
+ visitor->trace(m_eventListenerObservers);
DOMWindow::trace(visitor);
Supplementable<LocalDOMWindow>::trace(visitor);
- DOMWindowLifecycleNotifier::trace(visitor);
}
LocalFrame* LocalDOMWindow::frame() const
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.h ('k') | third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698