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

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

Issue 16988003: Revert "Extract ContextLifecycleNotifier from ScriptExecutionContext." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/core.gypi ('k') | Source/core/dom/ContextDestructionObserver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ActiveDOMObject.cpp
diff --git a/Source/core/dom/ActiveDOMObject.cpp b/Source/core/dom/ActiveDOMObject.cpp
index 880c976aae4be8efe1024e40a5218344ceba3d34..a3270fc1cfb718974b1a4ae1c560d9a0691f2ded 100644
--- a/Source/core/dom/ActiveDOMObject.cpp
+++ b/Source/core/dom/ActiveDOMObject.cpp
@@ -33,7 +33,7 @@
namespace WebCore {
ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext)
- : ContextDestructionObserver(scriptExecutionContext, ActiveDOMObjectType)
+ : ContextDestructionObserver(scriptExecutionContext)
, m_pendingActivityCount(0)
#if !ASSERT_DISABLED
, m_suspendIfNeededCalled(false)
@@ -43,22 +43,26 @@ ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext)
return;
ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->didCreateActiveDOMObject(this);
}
ActiveDOMObject::~ActiveDOMObject()
{
+ if (!m_scriptExecutionContext)
+ return;
+
+ ASSERT(m_suspendIfNeededCalled);
+
// ActiveDOMObject may be inherited by a sub-class whose life-cycle
// exceeds that of the associated ScriptExecutionContext. In those cases,
// m_scriptExecutionContext would/should have been nullified by
// ContextDestructionObserver::contextDestroyed() (which we implement /
// inherit). Hence, we should ensure that this is not 0 before use it
// here.
- if (!m_scriptExecutionContext)
- return;
-
- ASSERT(m_suspendIfNeededCalled);
- ASSERT(m_scriptExecutionContext->isContextThread());
- observeContext(0, ActiveDOMObjectType);
+ if (m_scriptExecutionContext) {
+ ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->willDestroyActiveDOMObject(this);
+ }
}
void ActiveDOMObject::suspendIfNeeded()
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/ContextDestructionObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698