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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentLifecycleNotifier.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/dom/DocumentLifecycleNotifier.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentLifecycleNotifier.cpp b/third_party/WebKit/Source/core/dom/DocumentLifecycleNotifier.cpp
index 301aaa02f603a30ba77227f5a3084541326680e8..3bd50ce18495279da41b7796e66c39224512b1e6 100644
--- a/third_party/WebKit/Source/core/dom/DocumentLifecycleNotifier.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentLifecycleNotifier.cpp
@@ -33,40 +33,8 @@ namespace blink {
void DocumentLifecycleNotifier::notifyDocumentWasDetached()
{
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<DocumentLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (DocumentLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->documentWasDetached();
- }
-#else
for (DocumentLifecycleObserver* observer : m_observers)
observer->documentWasDetached();
-#endif
}
-#if !ENABLE(OILPAN)
-void DocumentLifecycleNotifier::notifyDocumentWasDisposed()
-{
- TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll);
- // 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<DocumentLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (DocumentLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->documentWasDisposed();
- }
-}
-#endif
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698