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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 void InspectorController::initializeDeferredAgents() | 143 void InspectorController::initializeDeferredAgents() |
144 { | 144 { |
145 if (m_deferredAgentsInitialized) | 145 if (m_deferredAgentsInitialized) |
146 return; | 146 return; |
147 m_deferredAgentsInitialized = true; | 147 m_deferredAgentsInitialized = true; |
148 | 148 |
149 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; | 149 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; |
150 InspectorOverlay* overlay = m_overlay.get(); | 150 InspectorOverlay* overlay = m_overlay.get(); |
151 | 151 |
152 OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::crea
te(m_pageAgent)); | 152 OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::crea
te(m_pageAgent)); |
153 InspectorResourceAgent* resourceAgent = resourceAgentPtr.get(); | 153 m_resourceAgent = resourceAgentPtr.get(); |
154 m_agents.append(resourceAgentPtr.release()); | 154 m_agents.append(resourceAgentPtr.release()); |
155 | 155 |
156 m_agents.append(InspectorCSSAgent::create(m_domAgent, m_pageAgent, resourceA
gent)); | 156 m_agents.append(InspectorCSSAgent::create(m_domAgent, m_pageAgent, m_resourc
eAgent)); |
157 | 157 |
158 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent)); | 158 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent)); |
159 | 159 |
160 m_agents.append(InspectorMemoryAgent::create()); | 160 m_agents.append(InspectorMemoryAgent::create()); |
161 | 161 |
162 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent)); | 162 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent)); |
163 | 163 |
164 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share
d(); | 164 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share
d(); |
165 | 165 |
166 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(pa
geScriptDebugServer, m_pageAgent, injectedScriptManager, overlay)); | 166 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(pa
geScriptDebugServer, m_pageAgent, injectedScriptManager, overlay)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 void InspectorController::didClearDocumentOfWindowObject(LocalFrame* frame) | 202 void InspectorController::didClearDocumentOfWindowObject(LocalFrame* frame) |
203 { | 203 { |
204 // If the page is supposed to serve as InspectorFrontend notify inspector fr
ontend | 204 // If the page is supposed to serve as InspectorFrontend notify inspector fr
ontend |
205 // client that it's cleared so that the client can expose inspector bindings
. | 205 // client that it's cleared so that the client can expose inspector bindings
. |
206 if (m_inspectorFrontendClient && frame == m_page->mainFrame()) | 206 if (m_inspectorFrontendClient && frame == m_page->mainFrame()) |
207 m_inspectorFrontendClient->windowObjectCleared(); | 207 m_inspectorFrontendClient->windowObjectCleared(); |
208 } | 208 } |
209 | 209 |
210 void InspectorController::connectFrontend(InspectorFrontendChannel* frontendChan
nel) | 210 void InspectorController::connectFrontend(const String& hostId, InspectorFronten
dChannel* frontendChannel) |
211 { | 211 { |
212 ASSERT(frontendChannel); | 212 ASSERT(frontendChannel); |
| 213 m_hostId = hostId; |
213 | 214 |
214 initializeDeferredAgents(); | 215 initializeDeferredAgents(); |
| 216 m_resourceAgent->setHostId(hostId); |
215 | 217 |
216 m_inspectorFrontend = adoptPtr(new InspectorFrontend(frontendChannel)); | 218 m_inspectorFrontend = adoptPtr(new InspectorFrontend(frontendChannel)); |
217 // We can reconnect to existing front-end -> unmute state. | 219 // We can reconnect to existing front-end -> unmute state. |
218 m_state->unmute(); | 220 m_state->unmute(); |
219 | 221 |
220 m_agents.setFrontend(m_inspectorFrontend.get()); | 222 m_agents.setFrontend(m_inspectorFrontend.get()); |
221 | 223 |
222 InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.
get()); | 224 InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.
get()); |
223 InspectorInstrumentation::frontendCreated(); | 225 InspectorInstrumentation::frontendCreated(); |
224 | 226 |
(...skipping 15 matching lines...) Expand all Loading... |
240 m_state->mute(); | 242 m_state->mute(); |
241 | 243 |
242 m_agents.clearFrontend(); | 244 m_agents.clearFrontend(); |
243 | 245 |
244 m_inspectorFrontend.clear(); | 246 m_inspectorFrontend.clear(); |
245 | 247 |
246 // relese overlay page resources | 248 // relese overlay page resources |
247 m_overlay->freePage(); | 249 m_overlay->freePage(); |
248 InspectorInstrumentation::frontendDeleted(); | 250 InspectorInstrumentation::frontendDeleted(); |
249 InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgent
s.get()); | 251 InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgent
s.get()); |
| 252 m_hostId = ""; |
250 } | 253 } |
251 | 254 |
252 void InspectorController::reconnectFrontend() | 255 void InspectorController::reconnectFrontend() |
253 { | 256 { |
254 if (!m_inspectorFrontend) | 257 if (!m_inspectorFrontend) |
255 return; | 258 return; |
256 InspectorFrontendChannel* frontendChannel = m_inspectorFrontend->channel(); | 259 InspectorFrontendChannel* frontendChannel = m_inspectorFrontend->channel(); |
| 260 String hostId = m_hostId; |
257 disconnectFrontend(); | 261 disconnectFrontend(); |
258 connectFrontend(frontendChannel); | 262 connectFrontend(hostId, frontendChannel); |
259 } | 263 } |
260 | 264 |
261 void InspectorController::reuseFrontend(InspectorFrontendChannel* frontendChanne
l, const String& inspectorStateCookie) | 265 void InspectorController::reuseFrontend(const String& hostId, InspectorFrontendC
hannel* frontendChannel, const String& inspectorStateCookie) |
262 { | 266 { |
263 ASSERT(!m_inspectorFrontend); | 267 ASSERT(!m_inspectorFrontend); |
264 connectFrontend(frontendChannel); | 268 connectFrontend(hostId, frontendChannel); |
265 m_state->loadFromCookie(inspectorStateCookie); | 269 m_state->loadFromCookie(inspectorStateCookie); |
266 m_agents.restore(); | 270 m_agents.restore(); |
267 } | 271 } |
268 | 272 |
269 void InspectorController::setProcessId(long processId) | 273 void InspectorController::setProcessId(long processId) |
270 { | 274 { |
271 IdentifiersFactory::setProcessId(processId); | 275 IdentifiersFactory::setProcessId(processId); |
272 } | 276 } |
273 | 277 |
274 void InspectorController::setLayerTreeId(int id) | 278 void InspectorController::setLayerTreeId(int id) |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 void InspectorController::resume() | 387 void InspectorController::resume() |
384 { | 388 { |
385 if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents->inspector
DebuggerAgent()) { | 389 if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents->inspector
DebuggerAgent()) { |
386 ErrorString error; | 390 ErrorString error; |
387 debuggerAgent->resume(&error); | 391 debuggerAgent->resume(&error); |
388 } | 392 } |
389 } | 393 } |
390 | 394 |
391 void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumRes
ourcesContentSize, int maximumSingleResourceContentSize) | 395 void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumRes
ourcesContentSize, int maximumSingleResourceContentSize) |
392 { | 396 { |
393 if (InspectorResourceAgent* resourceAgent = m_instrumentingAgents->inspector
ResourceAgent()) | 397 if (m_resourceAgent) |
394 resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesC
ontentSize, maximumSingleResourceContentSize); | 398 m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResource
sContentSize, maximumSingleResourceContentSize); |
395 } | 399 } |
396 | 400 |
397 void InspectorController::willProcessTask() | 401 void InspectorController::willProcessTask() |
398 { | 402 { |
399 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector
TimelineAgent()) | 403 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector
TimelineAgent()) |
400 timelineAgent->willProcessTask(); | 404 timelineAgent->willProcessTask(); |
401 if (InspectorProfilerAgent* profilerAgent = m_instrumentingAgents->inspector
ProfilerAgent()) | 405 if (InspectorProfilerAgent* profilerAgent = m_instrumentingAgents->inspector
ProfilerAgent()) |
402 profilerAgent->willProcessTask(); | 406 profilerAgent->willProcessTask(); |
403 } | 407 } |
404 | 408 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 m_layerTreeAgent->willAddPageOverlay(layer); | 472 m_layerTreeAgent->willAddPageOverlay(layer); |
469 } | 473 } |
470 | 474 |
471 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) | 475 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) |
472 { | 476 { |
473 if (m_layerTreeAgent) | 477 if (m_layerTreeAgent) |
474 m_layerTreeAgent->didRemovePageOverlay(layer); | 478 m_layerTreeAgent->didRemovePageOverlay(layer); |
475 } | 479 } |
476 | 480 |
477 } // namespace WebCore | 481 } // namespace WebCore |
OLD | NEW |