Index: Source/core/inspector/WorkerDebuggerAgent.cpp |
diff --git a/Source/core/inspector/WorkerDebuggerAgent.cpp b/Source/core/inspector/WorkerDebuggerAgent.cpp |
index 52d2b4d4f5c01e4badba956ba1125f152e94843d..d2d057862b4c9a889796aa6a177e0aeb24cf9605 100644 |
--- a/Source/core/inspector/WorkerDebuggerAgent.cpp |
+++ b/Source/core/inspector/WorkerDebuggerAgent.cpp |
@@ -46,7 +46,7 @@ Mutex& workerDebuggerAgentsMutex() |
return mutex; |
} |
-typedef HashMap<WorkerThread*, WorkerDebuggerAgent*> WorkerDebuggerAgents; |
+typedef HashMap<WorkerThread*, OwnPtr<Persistent<WorkerDebuggerAgent> > > WorkerDebuggerAgents; |
WorkerDebuggerAgents& workerDebuggerAgents() |
{ |
@@ -54,7 +54,6 @@ WorkerDebuggerAgents& workerDebuggerAgents() |
return agents; |
} |
- |
class RunInspectorCommandsTask FINAL : public ScriptDebugServer::Task { |
public: |
explicit RunInspectorCommandsTask(WorkerThread* thread) |
@@ -73,31 +72,50 @@ private: |
} // namespace |
-PassOwnPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager) |
+PassOwnPtrWillBeRawPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager) |
{ |
- return adoptPtr(new WorkerDebuggerAgent(scriptDebugServer, inspectedWorkerGlobalScope, injectedScriptManager)); |
+ return adoptPtrWillBeNoop(new WorkerDebuggerAgent(scriptDebugServer, inspectedWorkerGlobalScope, injectedScriptManager)); |
} |
WorkerDebuggerAgent::WorkerDebuggerAgent(WorkerScriptDebugServer* scriptDebugServer, WorkerGlobalScope* inspectedWorkerGlobalScope, InjectedScriptManager* injectedScriptManager) |
: InspectorDebuggerAgent(injectedScriptManager) |
, m_scriptDebugServer(scriptDebugServer) |
, m_inspectedWorkerGlobalScope(inspectedWorkerGlobalScope) |
+ , m_thread(inspectedWorkerGlobalScope->thread()) |
{ |
MutexLocker lock(workerDebuggerAgentsMutex()); |
- workerDebuggerAgents().set(inspectedWorkerGlobalScope->thread(), this); |
+ ASSERT(!workerDebuggerAgents().contains(m_thread)); |
+//#if ENABLE(OILPAN) |
+ workerDebuggerAgents().add(m_thread, nullptr/*adoptPtr(new Persistent<WorkerDebuggerAgent>(this))*/); |
keishi
2014/06/02 12:06:31
I tried to do the same thing that DatabaseManager
Mads Ager (chromium)
2014/06/03 10:19:35
I don't use lldb but I think your debugger is play
|
+//#else |
+// workerDebuggerAgents().set(m_thread, this); |
+//#endif |
} |
WorkerDebuggerAgent::~WorkerDebuggerAgent() |
{ |
- MutexLocker lock(workerDebuggerAgentsMutex()); |
- ASSERT(workerDebuggerAgents().contains(m_inspectedWorkerGlobalScope->thread())); |
- workerDebuggerAgents().remove(m_inspectedWorkerGlobalScope->thread()); |
+ //MutexLocker lock(workerDebuggerAgentsMutex()); |
+ //ASSERT(workerDebuggerAgents().contains(m_thread)); |
+ //workerDebuggerAgents().remove(m_thread); |
+} |
+ |
+void WorkerDebuggerAgent::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_inspectedWorkerGlobalScope); |
+ InspectorDebuggerAgent::trace(visitor); |
} |
void WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(WorkerThread* thread) |
{ |
MutexLocker lock(workerDebuggerAgentsMutex()); |
+#if ENABLE(OILPAN) |
+ Persistent<WorkerDebuggerAgent>* agentHandle = workerDebuggerAgents().get(thread); |
+ if (!agentHandle) |
+ return; |
+ WorkerDebuggerAgent* agent = agentHandle->get(); |
+#else |
WorkerDebuggerAgent* agent = workerDebuggerAgents().get(thread); |
+#endif |
if (agent) |
agent->m_scriptDebugServer->interruptAndRunTask(adoptPtr(new RunInspectorCommandsTask(thread))); |
} |