OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 WorkerContext* m_workerContext; | 88 WorkerContext* m_workerContext; |
89 }; | 89 }; |
90 | 90 |
91 } | 91 } |
92 | 92 |
93 WorkerInspectorController::WorkerInspectorController(WorkerContext* workerContex
t) | 93 WorkerInspectorController::WorkerInspectorController(WorkerContext* workerContex
t) |
94 : m_workerContext(workerContext) | 94 : m_workerContext(workerContext) |
95 , m_stateClient(adoptPtr(new WorkerStateClient(workerContext))) | 95 , m_stateClient(adoptPtr(new WorkerStateClient(workerContext))) |
96 , m_state(adoptPtr(new InspectorState(m_stateClient.get()))) | 96 , m_state(adoptPtr(new InspectorState(m_stateClient.get()))) |
97 , m_instrumentingAgents(adoptPtr(new InstrumentingAgents())) | 97 , m_instrumentingAgents(InstrumentingAgents::create()) |
98 , m_injectedScriptManager(InjectedScriptManager::createForWorker()) | 98 , m_injectedScriptManager(InjectedScriptManager::createForWorker()) |
99 , m_runtimeAgent(0) | 99 , m_runtimeAgent(0) |
100 { | 100 { |
101 OwnPtr<InspectorRuntimeAgent> runtimeAgent = WorkerRuntimeAgent::create(m_in
strumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), workerCon
text); | 101 OwnPtr<InspectorRuntimeAgent> runtimeAgent = WorkerRuntimeAgent::create(m_in
strumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), workerCon
text); |
102 m_runtimeAgent = runtimeAgent.get(); | 102 m_runtimeAgent = runtimeAgent.get(); |
103 m_agents.append(runtimeAgent.release()); | 103 m_agents.append(runtimeAgent.release()); |
104 | 104 |
105 OwnPtr<InspectorConsoleAgent> consoleAgent = WorkerConsoleAgent::create(m_in
strumentingAgents.get(), m_state.get(), m_injectedScriptManager.get()); | 105 OwnPtr<InspectorConsoleAgent> consoleAgent = WorkerConsoleAgent::create(m_in
strumentingAgents.get(), m_state.get(), m_injectedScriptManager.get()); |
106 #if ENABLE(JAVASCRIPT_DEBUGGER) | 106 #if ENABLE(JAVASCRIPT_DEBUGGER) |
107 OwnPtr<InspectorDebuggerAgent> debuggerAgent = WorkerDebuggerAgent::create(m
_instrumentingAgents.get(), m_state.get(), workerContext, m_injectedScriptManage
r.get()); | 107 OwnPtr<InspectorDebuggerAgent> debuggerAgent = WorkerDebuggerAgent::create(m
_instrumentingAgents.get(), m_state.get(), workerContext, m_injectedScriptManage
r.get()); |
(...skipping 14 matching lines...) Expand all Loading... |
122 , 0 | 122 , 0 |
123 , 0 | 123 , 0 |
124 #if ENABLE(JAVASCRIPT_DEBUGGER) | 124 #if ENABLE(JAVASCRIPT_DEBUGGER) |
125 , debuggerAgentPtr | 125 , debuggerAgentPtr |
126 #endif | 126 #endif |
127 ); | 127 ); |
128 } | 128 } |
129 | 129 |
130 WorkerInspectorController::~WorkerInspectorController() | 130 WorkerInspectorController::~WorkerInspectorController() |
131 { | 131 { |
| 132 m_instrumentingAgents->reset(); |
132 disconnectFrontend(); | 133 disconnectFrontend(); |
133 } | 134 } |
134 | 135 |
135 void WorkerInspectorController::connectFrontend() | 136 void WorkerInspectorController::connectFrontend() |
136 { | 137 { |
137 ASSERT(!m_frontend); | 138 ASSERT(!m_frontend); |
138 m_state->unmute(); | 139 m_state->unmute(); |
139 m_frontendChannel = adoptPtr(new PageInspectorProxy(m_workerContext)); | 140 m_frontendChannel = adoptPtr(new PageInspectorProxy(m_workerContext)); |
140 m_frontend = adoptPtr(new InspectorFrontend(m_frontendChannel.get())); | 141 m_frontend = adoptPtr(new InspectorFrontend(m_frontendChannel.get())); |
141 m_backendDispatcher = InspectorBackendDispatcher::create(m_frontendChannel.g
et()); | 142 m_backendDispatcher = InspectorBackendDispatcher::create(m_frontendChannel.g
et()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void WorkerInspectorController::resume() | 177 void WorkerInspectorController::resume() |
177 { | 178 { |
178 ErrorString unused; | 179 ErrorString unused; |
179 m_runtimeAgent->run(&unused); | 180 m_runtimeAgent->run(&unused); |
180 } | 181 } |
181 #endif | 182 #endif |
182 | 183 |
183 } | 184 } |
184 | 185 |
185 #endif | 186 #endif |
OLD | NEW |