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

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

Issue 916033002: Oilpan: Move LifecycleNotifier's hierarchy to Oilpan's heap Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | « Source/core/dom/ContextLifecycleNotifier.h ('k') | Source/core/dom/DocumentLifecycleNotifier.h » ('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 b62bcbd30eb5ca4300855815120f456070192196..7f7f029d4d67720344467e994d64606f3ee0abd7 100644
--- a/Source/core/dom/ContextLifecycleNotifier.cpp
+++ b/Source/core/dom/ContextLifecycleNotifier.cpp
@@ -53,6 +53,9 @@ void ContextLifecycleNotifier::removeObserver(ContextLifecycleNotifier::Observer
LifecycleNotifier<ExecutionContext>::removeObserver(observer);
if (observer->observerType() == Observer::ActiveDOMObjectType) {
+#if ENABLE(OILPAN)
+ RELEASE_ASSERT(m_iterating != IteratingOverActiveDOMObjects);
+#endif
m_activeDOMObjects.remove(static_cast<ActiveDOMObject*>(observer));
}
}
@@ -60,6 +63,13 @@ void ContextLifecycleNotifier::removeObserver(ContextLifecycleNotifier::Observer
void ContextLifecycleNotifier::notifyResumingActiveDOMObjects()
{
TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveDOMObjects);
+#if ENABLE(OILPAN)
+ for (ActiveDOMObject* obj : m_activeDOMObjects) {
+ ASSERT(obj->executionContext() == context());
+ ASSERT(obj->suspendIfNeededCalled());
+ obj->resume();
+ }
+#else
Vector<ActiveDOMObject*> snapshotOfActiveDOMObjects;
copyToVector(m_activeDOMObjects, snapshotOfActiveDOMObjects);
for (ActiveDOMObject* obj : snapshotOfActiveDOMObjects) {
@@ -76,11 +86,19 @@ void ContextLifecycleNotifier::notifyResumingActiveDOMObjects()
obj->resume();
}
}
+#endif
}
void ContextLifecycleNotifier::notifySuspendingActiveDOMObjects()
{
TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveDOMObjects);
+#if ENABLE(OILPAN)
+ for (ActiveDOMObject* obj : m_activeDOMObjects) {
+ ASSERT(obj->executionContext() == context());
+ ASSERT(obj->suspendIfNeededCalled());
+ obj->suspend();
+ }
+#else
Vector<ActiveDOMObject*> snapshotOfActiveDOMObjects;
copyToVector(m_activeDOMObjects, snapshotOfActiveDOMObjects);
for (ActiveDOMObject* obj : snapshotOfActiveDOMObjects) {
@@ -92,11 +110,19 @@ void ContextLifecycleNotifier::notifySuspendingActiveDOMObjects()
obj->suspend();
}
}
+#endif
}
void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects()
{
TemporaryChange<IterationType> scope(this->m_iterating, IteratingOverActiveDOMObjects);
+#if ENABLE(OILPAN)
+ for (ActiveDOMObject* obj : m_activeDOMObjects) {
+ ASSERT(obj->executionContext() == context());
+ ASSERT(obj->suspendIfNeededCalled());
+ obj->stop();
+ }
+#else
Vector<ActiveDOMObject*> snapshotOfActiveDOMObjects;
copyToVector(m_activeDOMObjects, snapshotOfActiveDOMObjects);
for (ActiveDOMObject* obj : snapshotOfActiveDOMObjects) {
@@ -108,6 +134,7 @@ void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects()
obj->stop();
}
}
+#endif
}
bool ContextLifecycleNotifier::hasPendingActivity() const
@@ -119,4 +146,10 @@ bool ContextLifecycleNotifier::hasPendingActivity() const
return false;
}
+void ContextLifecycleNotifier::trace(Visitor* visitor)
+{
+ visitor->trace(m_activeDOMObjects);
+ LifecycleNotifier<ExecutionContext>::trace(visitor);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/dom/ContextLifecycleNotifier.h ('k') | Source/core/dom/DocumentLifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698