Index: Source/core/workers/WorkerGlobalScope.cpp |
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp |
index 1b89c2ea74710865777114b0778cdc8ea73e86fb..ac48f5846f06e4e207ddd2b47b4e36c106bad0cf 100644 |
--- a/Source/core/workers/WorkerGlobalScope.cpp |
+++ b/Source/core/workers/WorkerGlobalScope.cpp |
@@ -81,7 +81,7 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W |
, m_userAgent(userAgent) |
, m_script(adoptPtr(new WorkerScriptController(*this))) |
, m_thread(thread) |
- , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) |
+ , m_workerInspectorController(adoptRefWillBeNoop(new WorkerInspectorController(this))) |
, m_closing(false) |
, m_eventQueue(WorkerEventQueue::create(this)) |
, m_workerClients(workerClients) |
@@ -92,6 +92,7 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W |
setClient(this); |
setSecurityOrigin(SecurityOrigin::create(url)); |
m_workerClients->reattachThread(); |
+ m_thread->setWorkerInspectorController(m_workerInspectorController); |
} |
WorkerGlobalScope::~WorkerGlobalScope() |
@@ -182,8 +183,13 @@ void WorkerGlobalScope::postTask(PassOwnPtr<ExecutionContextTask> task) |
thread()->runLoop().postTask(task); |
} |
+// FIXME: Called twice, from WorkerThreadShutdownFinishTask and WorkerGlobalScope::dispose. |
void WorkerGlobalScope::clearInspector() |
{ |
+ if (!m_workerInspectorController) |
+ return; |
+ m_workerInspectorController->dispose(); |
+ thread()->setWorkerInspectorController(nullptr); |
yurys
2014/07/03 03:25:54
The reference stored in WorkerThread should be cle
keishi
2014/07/03 23:53:53
Done.
|
m_workerInspectorController.clear(); |
} |
@@ -338,6 +344,7 @@ void WorkerGlobalScope::trace(Visitor* visitor) |
visitor->trace(m_console); |
visitor->trace(m_location); |
visitor->trace(m_navigator); |
+ visitor->trace(m_workerInspectorController); |
visitor->trace(m_eventQueue); |
visitor->trace(m_workerClients); |
WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |