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

Unified Diff: third_party/WebKit/Source/core/page/PageLifecycleNotifier.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/page/PageLifecycleNotifier.cpp
diff --git a/third_party/WebKit/Source/core/page/PageLifecycleNotifier.cpp b/third_party/WebKit/Source/core/page/PageLifecycleNotifier.cpp
index 0a623e14eeec35e3bcf42fb77020ca67174524e2..5a6db288139154bf8776f1ed6e4788cff857a99b 100644
--- a/third_party/WebKit/Source/core/page/PageLifecycleNotifier.cpp
+++ b/third_party/WebKit/Source/core/page/PageLifecycleNotifier.cpp
@@ -33,43 +33,15 @@ namespace blink {
void PageLifecycleNotifier::notifyPageVisibilityChanged()
{
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<PageLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (PageLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->pageVisibilityChanged();
- }
-#else
for (PageLifecycleObserver* observer : m_observers)
observer->pageVisibilityChanged();
-#endif
}
void PageLifecycleNotifier::notifyDidCommitLoad(LocalFrame* frame)
{
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<PageLifecycleObserver>> snapshotOfObservers;
- copyToVector(m_observers, snapshotOfObservers);
- for (PageLifecycleObserver* observer : snapshotOfObservers) {
- if (m_observers.contains(observer))
- observer->didCommitLoad(frame);
- }
-#else
for (PageLifecycleObserver* observer : m_observers)
observer->didCommitLoad(frame);
-#endif
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698