summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/ActiveDOMObject.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/dom/ActiveDOMObject.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/dom/ActiveDOMObject.cpp')
-rw-r--r--Source/WebCore/dom/ActiveDOMObject.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/WebCore/dom/ActiveDOMObject.cpp b/Source/WebCore/dom/ActiveDOMObject.cpp
index b44f07d45..0c6e8ed02 100644
--- a/Source/WebCore/dom/ActiveDOMObject.cpp
+++ b/Source/WebCore/dom/ActiveDOMObject.cpp
@@ -28,13 +28,12 @@
#include "ActiveDOMObject.h"
#include "ScriptExecutionContext.h"
-#include "WebCoreMemoryInstrumentation.h"
-#include "WorkerContext.h"
+#include "WorkerGlobalScope.h"
#include "WorkerThread.h"
namespace WebCore {
-ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext, void* upcastPointer)
+ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext)
: ContextDestructionObserver(scriptExecutionContext)
, m_pendingActivityCount(0)
#if !ASSERT_DISABLED
@@ -45,7 +44,7 @@ ActiveDOMObject::ActiveDOMObject(ScriptExecutionContext* scriptExecutionContext,
return;
ASSERT(m_scriptExecutionContext->isContextThread());
- m_scriptExecutionContext->didCreateActiveDOMObject(this, upcastPointer);
+ m_scriptExecutionContext->didCreateActiveDOMObject(this);
}
ActiveDOMObject::~ActiveDOMObject()
@@ -54,8 +53,17 @@ ActiveDOMObject::~ActiveDOMObject()
return;
ASSERT(m_suspendIfNeededCalled);
- ASSERT(m_scriptExecutionContext->isContextThread());
- m_scriptExecutionContext->willDestroyActiveDOMObject(this);
+
+ // 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) {
+ ASSERT(m_scriptExecutionContext->isContextThread());
+ m_scriptExecutionContext->willDestroyActiveDOMObject(this);
+ }
}
void ActiveDOMObject::suspendIfNeeded()
@@ -92,10 +100,4 @@ void ActiveDOMObject::stop()
{
}
-void ActiveDOMObject::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
-{
- MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM);
-}
-
-
} // namespace WebCore