Index: Source/core/inspector/WorkerInspectorController.cpp |
diff --git a/Source/core/inspector/WorkerInspectorController.cpp b/Source/core/inspector/WorkerInspectorController.cpp |
index b63e19f60036e1118af5822016d1688e36a71108..e154506b21277e279b2c9f025505aad0396d5463 100644 |
--- a/Source/core/inspector/WorkerInspectorController.cpp |
+++ b/Source/core/inspector/WorkerInspectorController.cpp |
@@ -95,25 +95,25 @@ WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGl |
, m_instrumentingAgents(InstrumentingAgents::create()) |
, m_injectedScriptManager(InjectedScriptManager::createForWorker()) |
, m_debugServer(adoptPtr(new WorkerScriptDebugServer(workerGlobalScope))) |
- , m_agents(m_instrumentingAgents.get(), m_state.get()) |
+ , m_agents(adoptPtrWillBeNoop(new InspectorAgentRegistry(m_instrumentingAgents.get(), m_state.get()))) |
{ |
- m_agents.append(WorkerRuntimeAgent::create(m_injectedScriptManager.get(), m_debugServer.get(), workerGlobalScope)); |
+ agents().append(WorkerRuntimeAgent::create(m_injectedScriptManager.get(), m_debugServer.get(), workerGlobalScope)); |
- OwnPtr<InspectorTimelineAgent> timelineAgent = InspectorTimelineAgent::create(0, 0, 0, InspectorTimelineAgent::WorkerInspector, 0); |
- m_agents.append(WorkerDebuggerAgent::create(m_debugServer.get(), workerGlobalScope, m_injectedScriptManager.get())); |
+ OwnPtrWillBeRawPtr<InspectorTimelineAgent> timelineAgent = InspectorTimelineAgent::create(0, 0, 0, InspectorTimelineAgent::WorkerInspector, 0); |
+ OwnPtrWillBeRawPtr<WorkerDebuggerAgent> debuggerAgent = WorkerDebuggerAgent::create(m_debugServer.get(), workerGlobalScope, m_injectedScriptManager.get()); |
+ m_debuggerAgent = debuggerAgent.get(); |
+ agents().append(debuggerAgent.release()); |
- m_agents.append(InspectorProfilerAgent::create(m_injectedScriptManager.get(), 0)); |
- m_agents.append(InspectorHeapProfilerAgent::create(m_injectedScriptManager.get())); |
- m_agents.append(WorkerConsoleAgent::create(timelineAgent.get(), m_injectedScriptManager.get())); |
- m_agents.append(timelineAgent.release()); |
+ agents().append(InspectorProfilerAgent::create(m_injectedScriptManager.get(), 0)); |
+ agents().append(InspectorHeapProfilerAgent::create(m_injectedScriptManager.get())); |
+ agents().append(WorkerConsoleAgent::create(timelineAgent.get(), m_injectedScriptManager.get())); |
+ agents().append(timelineAgent.release()); |
m_injectedScriptManager->injectedScriptHost()->init(m_instrumentingAgents.get(), m_debugServer.get()); |
} |
WorkerInspectorController::~WorkerInspectorController() |
{ |
- m_instrumentingAgents->reset(); |
- disconnectFrontend(); |
} |
void WorkerInspectorController::connectFrontend() |
@@ -123,8 +123,8 @@ void WorkerInspectorController::connectFrontend() |
m_frontendChannel = adoptPtr(new PageInspectorProxy(m_workerGlobalScope)); |
m_frontend = adoptPtr(new InspectorFrontend(m_frontendChannel.get())); |
m_backendDispatcher = InspectorBackendDispatcher::create(m_frontendChannel.get()); |
- m_agents.registerInDispatcher(m_backendDispatcher.get()); |
- m_agents.setFrontend(m_frontend.get()); |
+ agents().registerInDispatcher(m_backendDispatcher.get()); |
+ agents().setFrontend(m_frontend.get()); |
InspectorInstrumentation::frontendCreated(); |
} |
@@ -137,7 +137,7 @@ void WorkerInspectorController::disconnectFrontend() |
// Destroying agents would change the state, but we don't want that. |
// Pre-disconnect state will be used to restore inspector agents. |
m_state->mute(); |
- m_agents.clearFrontend(); |
+ agents().clearFrontend(); |
m_frontend.clear(); |
InspectorInstrumentation::frontendDeleted(); |
m_frontendChannel.clear(); |
@@ -149,7 +149,7 @@ void WorkerInspectorController::restoreInspectorStateFromCookie(const String& in |
connectFrontend(); |
m_state->loadFromCookie(inspectorCookie); |
- m_agents.restore(); |
+ agents().restore(); |
} |
void WorkerInspectorController::dispatchMessageFromFrontend(const String& message) |
@@ -166,4 +166,19 @@ void WorkerInspectorController::resume() |
} |
} |
+void WorkerInspectorController::discard() |
+{ |
+ m_debuggerAgent->discard(); |
haraken
2014/06/12 08:40:25
We conventionally call this kind of method dispose
keishi
2014/06/13 03:37:34
Done.
|
+ m_debuggerAgent = nullptr; |
+ m_instrumentingAgents->reset(); |
+ disconnectFrontend(); |
+} |
+ |
+void WorkerInspectorController::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_instrumentingAgents); |
+ visitor->trace(m_agents); |
+ visitor->trace(m_debuggerAgent); |
+} |
+ |
} |