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

Unified Diff: Source/core/inspector/WorkerDebuggerAgent.cpp

Issue 307943002: Oilpan: Prepare moving InspectorController and InspectorAgents to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Crashing Created 6 years, 7 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/inspector/WorkerDebuggerAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
}
« no previous file with comments | « Source/core/inspector/WorkerDebuggerAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698