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

Unified Diff: Source/core/dom/ContextLifecycleNotifier.cpp

Issue 1132053002: [WIP]Oilpan: checking for nearly-dead observers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | Source/core/dom/DocumentLifecycleNotifier.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ContextLifecycleNotifier.cpp
diff --git a/Source/core/dom/ContextLifecycleNotifier.cpp b/Source/core/dom/ContextLifecycleNotifier.cpp
index 7ce7a1e25bbee4d0b8d054840842f8dc41271571..bada199cd7a8304de9f2f8f80fef36f8de7831e5 100644
--- a/Source/core/dom/ContextLifecycleNotifier.cpp
+++ b/Source/core/dom/ContextLifecycleNotifier.cpp
@@ -39,6 +39,10 @@ void ContextLifecycleNotifier::notifyResumingActiveDOMObjects()
Vector<ContextLifecycleObserver*> snapshotOfObservers;
copyToVector(m_observers, snapshotOfObservers);
for (ContextLifecycleObserver* observer : snapshotOfObservers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
// FIXME: Oilpan: At the moment, it's possible that a ActiveDOMObject
haraken 2015/05/09 14:50:33 Not related to this CL, I think this FIXME is vali
// observer is destructed while iterating. Once we enable Oilpan by default
// for all LifecycleObserver<T>s, we can remove the hack by making m_observers
@@ -62,6 +66,10 @@ void ContextLifecycleNotifier::notifySuspendingActiveDOMObjects()
Vector<ContextLifecycleObserver*> snapshotOfObservers;
copyToVector(m_observers, snapshotOfObservers);
for (ContextLifecycleObserver* observer : snapshotOfObservers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
// It's possible that the ActiveDOMObject is already destructed.
// See a FIXME above.
if (m_observers.contains(observer)) {
@@ -81,6 +89,10 @@ void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects()
Vector<ContextLifecycleObserver*> snapshotOfObservers;
copyToVector(m_observers, snapshotOfObservers);
for (ContextLifecycleObserver* observer : snapshotOfObservers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
// It's possible that the ActiveDOMObject is already destructed.
// See a FIXME above.
if (m_observers.contains(observer)) {
@@ -98,6 +110,10 @@ unsigned ContextLifecycleNotifier::activeDOMObjectCount() const
{
unsigned activeDOMObjects = 0;
for (ContextLifecycleObserver* observer : m_observers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType)
continue;
activeDOMObjects++;
@@ -108,6 +124,10 @@ unsigned ContextLifecycleNotifier::activeDOMObjectCount() const
bool ContextLifecycleNotifier::hasPendingActivity() const
{
for (ContextLifecycleObserver* observer : m_observers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType)
continue;
ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer);
@@ -121,6 +141,10 @@ bool ContextLifecycleNotifier::hasPendingActivity() const
bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const
{
for (ContextLifecycleObserver* observer : m_observers) {
+#if !ENABLE(OILPAN)
+ if (!isObserverAlive(observer))
+ continue;
+#endif
if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType)
continue;
ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer);
« no previous file with comments | « no previous file | Source/core/dom/DocumentLifecycleNotifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698