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

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

Issue 1858583002: Simplify LifecycleNotifier and Observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more removals Created 4 years, 8 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/DOMWindowLifecycleNotifier.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindowLifecycleNotifier.cpp b/third_party/WebKit/Source/core/frame/DOMWindowLifecycleNotifier.cpp
index b0c5080fa7cb1244364fedcb9dd609c1a7a36659..3c24d90cd42b5118e3876ac71eb9e178556cae85 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindowLifecycleNotifier.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindowLifecycleNotifier.cpp
@@ -32,64 +32,22 @@ namespace blink {
void DOMWindowLifecycleNotifier::notifyAddEventListener(LocalDOMWindow* window, const AtomicString& eventType)
{
TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
-#if !ENABLE(OILPAN)
- // Notifications perform unknown amounts of heap allocations,
- // which might trigger (conservative) GCs. This will flush out
- // dead observers, causing the _non-heap_ set be updated. Snapshot
- // the observers and explicitly check if they're still alive before
- // notifying.
- Vector<RawPtr<DOMWindowLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (DOMWindowLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->didAddEventListener(window, eventType);
- }
-#else
for (DOMWindowLifecycleObserver* observer : m_observers)
observer->didAddEventListener(window, eventType);
-#endif
}
void DOMWindowLifecycleNotifier::notifyRemoveEventListener(LocalDOMWindow* window, const AtomicString& eventType)
{
TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
-#if !ENABLE(OILPAN)
- // Notifications perform unknown amounts of heap allocations,
- // which might trigger (conservative) GCs. This will flush out
- // dead observers, causing the _non-heap_ set be updated. Snapshot
- // the observers and explicitly check if they're still alive before
- // notifying.
- Vector<RawPtr<DOMWindowLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (DOMWindowLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->didRemoveEventListener(window, eventType);
- }
-#else
for (DOMWindowLifecycleObserver* observer : m_observers)
observer->didRemoveEventListener(window, eventType);
-#endif
}
void DOMWindowLifecycleNotifier::notifyRemoveAllEventListeners(LocalDOMWindow* window)
{
TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
-#if !ENABLE(OILPAN)
- // Notifications perform unknown amounts of heap allocations,
- // which might trigger (conservative) GCs. This will flush out
- // dead observers, causing the _non-heap_ set be updated. Snapshot
- // the observers and explicitly check if they're still alive before
- // notifying.
- Vector<RawPtr<DOMWindowLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (DOMWindowLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->didRemoveAllEventListeners(window);
- }
-#else
for (DOMWindowLifecycleObserver* observer : m_observers)
observer->didRemoveAllEventListeners(window);
-#endif
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698