| 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
|
|
|