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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #include "core/rendering/RenderLayer.h" | 67 #include "core/rendering/RenderLayer.h" |
68 #include "platform/PlatformMouseEvent.h" | 68 #include "platform/PlatformMouseEvent.h" |
69 | 69 |
70 namespace WebCore { | 70 namespace WebCore { |
71 | 71 |
72 InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
lient) | 72 InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
lient) |
73 : m_instrumentingAgents(InstrumentingAgents::create()) | 73 : m_instrumentingAgents(InstrumentingAgents::create()) |
74 , m_injectedScriptManager(InjectedScriptManager::createForPage()) | 74 , m_injectedScriptManager(InjectedScriptManager::createForPage()) |
75 , m_state(adoptPtr(new InspectorCompositeState(inspectorClient))) | 75 , m_state(adoptPtr(new InspectorCompositeState(inspectorClient))) |
76 , m_overlay(InspectorOverlay::create(page, inspectorClient)) | 76 , m_overlay(InspectorOverlay::create(page, inspectorClient)) |
| 77 , m_layerTreeAgent(0) |
77 , m_page(page) | 78 , m_page(page) |
78 , m_inspectorClient(inspectorClient) | 79 , m_inspectorClient(inspectorClient) |
79 , m_agents(m_instrumentingAgents.get(), m_state.get()) | 80 , m_agents(m_instrumentingAgents.get(), m_state.get()) |
80 , m_isUnderTest(false) | 81 , m_isUnderTest(false) |
81 , m_deferredAgentsInitialized(false) | 82 , m_deferredAgentsInitialized(false) |
82 { | 83 { |
83 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; | 84 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; |
84 InspectorOverlay* overlay = m_overlay.get(); | 85 InspectorOverlay* overlay = m_overlay.get(); |
85 | 86 |
86 m_agents.append(InspectorInspectorAgent::create(m_page, injectedScriptManage
r)); | 87 m_agents.append(InspectorInspectorAgent::create(m_page, injectedScriptManage
r)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent)
); | 163 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent)
); |
163 | 164 |
164 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla
y)); | 165 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla
y)); |
165 | 166 |
166 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager)); | 167 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager)); |
167 | 168 |
168 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana
ger)); | 169 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana
ger)); |
169 | 170 |
170 m_agents.append(InspectorInputAgent::create(m_page, m_inspectorClient)); | 171 m_agents.append(InspectorInputAgent::create(m_page, m_inspectorClient)); |
171 | 172 |
172 m_agents.append(InspectorLayerTreeAgent::create(m_domAgent, m_page)); | 173 OwnPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayerTreeAgent::c
reate(m_domAgent, m_page)); |
| 174 m_layerTreeAgent = layerTreeAgentPtr.get(); |
| 175 m_agents.append(layerTreeAgentPtr.release()); |
173 } | 176 } |
174 | 177 |
175 void InspectorController::inspectedPageDestroyed() | 178 void InspectorController::inspectedPageDestroyed() |
176 { | 179 { |
177 disconnectFrontend(); | 180 disconnectFrontend(); |
178 m_injectedScriptManager->disconnect(); | 181 m_injectedScriptManager->disconnect(); |
179 m_inspectorClient = 0; | 182 m_inspectorClient = 0; |
180 m_page = 0; | 183 m_page = 0; |
181 } | 184 } |
182 | 185 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector
TimelineAgent()) | 465 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector
TimelineAgent()) |
463 timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestam
p, phase, foreign, usedGPUMemoryBytes)); | 466 timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestam
p, phase, foreign, usedGPUMemoryBytes)); |
464 } | 467 } |
465 | 468 |
466 void InspectorController::scriptsEnabled(bool enabled) | 469 void InspectorController::scriptsEnabled(bool enabled) |
467 { | 470 { |
468 if (InspectorPageAgent* pageAgent = m_instrumentingAgents->inspectorPageAgen
t()) | 471 if (InspectorPageAgent* pageAgent = m_instrumentingAgents->inspectorPageAgen
t()) |
469 pageAgent->scriptsEnabled(enabled); | 472 pageAgent->scriptsEnabled(enabled); |
470 } | 473 } |
471 | 474 |
| 475 void InspectorController::willAddPageOverlay(const GraphicsLayer* layer) |
| 476 { |
| 477 if (m_layerTreeAgent) |
| 478 m_layerTreeAgent->willAddPageOverlay(layer); |
| 479 } |
| 480 |
| 481 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) |
| 482 { |
| 483 if (m_layerTreeAgent) |
| 484 m_layerTreeAgent->didRemovePageOverlay(layer); |
| 485 } |
| 486 |
472 } // namespace WebCore | 487 } // namespace WebCore |
OLD | NEW |