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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/inspector/InspectorController.h" | 32 #include "core/inspector/InspectorController.h" |
33 | 33 |
34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
35 #include "core/InspectorBackendDispatcher.h" | 35 #include "core/InspectorBackendDispatcher.h" |
36 #include "core/InspectorFrontend.h" | 36 #include "core/InspectorFrontend.h" |
| 37 #include "core/inspector/EditedResourcesContentManager.h" |
37 #include "core/inspector/IdentifiersFactory.h" | 38 #include "core/inspector/IdentifiersFactory.h" |
38 #include "core/inspector/InjectedScriptHost.h" | 39 #include "core/inspector/InjectedScriptHost.h" |
39 #include "core/inspector/InjectedScriptManager.h" | 40 #include "core/inspector/InjectedScriptManager.h" |
40 #include "core/inspector/InspectorApplicationCacheAgent.h" | 41 #include "core/inspector/InspectorApplicationCacheAgent.h" |
41 #include "core/inspector/InspectorCSSAgent.h" | 42 #include "core/inspector/InspectorCSSAgent.h" |
42 #include "core/inspector/InspectorCanvasAgent.h" | 43 #include "core/inspector/InspectorCanvasAgent.h" |
43 #include "core/inspector/InspectorClient.h" | 44 #include "core/inspector/InspectorClient.h" |
44 #include "core/inspector/InspectorDOMAgent.h" | 45 #include "core/inspector/InspectorDOMAgent.h" |
45 #include "core/inspector/InspectorDOMDebuggerAgent.h" | 46 #include "core/inspector/InspectorDOMDebuggerAgent.h" |
46 #include "core/inspector/InspectorDOMStorageAgent.h" | 47 #include "core/inspector/InspectorDOMStorageAgent.h" |
(...skipping 20 matching lines...) Expand all Loading... |
67 #include "core/page/ContextMenuProvider.h" | 68 #include "core/page/ContextMenuProvider.h" |
68 #include "core/page/Page.h" | 69 #include "core/page/Page.h" |
69 #include "core/rendering/RenderLayer.h" | 70 #include "core/rendering/RenderLayer.h" |
70 #include "platform/PlatformMouseEvent.h" | 71 #include "platform/PlatformMouseEvent.h" |
71 | 72 |
72 namespace blink { | 73 namespace blink { |
73 | 74 |
74 InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
lient) | 75 InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
lient) |
75 : m_instrumentingAgents(InstrumentingAgents::create()) | 76 : m_instrumentingAgents(InstrumentingAgents::create()) |
76 , m_injectedScriptManager(InjectedScriptManager::createForPage()) | 77 , m_injectedScriptManager(InjectedScriptManager::createForPage()) |
| 78 , m_editedResourcesContentManager(EditedResourcesContentManager::create()) |
77 , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(inspectorClient))) | 79 , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(inspectorClient))) |
78 , m_overlay(InspectorOverlay::create(page, inspectorClient)) | 80 , m_overlay(InspectorOverlay::create(page, inspectorClient)) |
79 , m_cssAgent(nullptr) | 81 , m_cssAgent(nullptr) |
80 , m_resourceAgent(nullptr) | 82 , m_resourceAgent(nullptr) |
81 , m_layerTreeAgent(nullptr) | 83 , m_layerTreeAgent(nullptr) |
82 , m_page(page) | 84 , m_page(page) |
83 , m_inspectorClient(inspectorClient) | 85 , m_inspectorClient(inspectorClient) |
84 , m_agents(m_instrumentingAgents.get(), m_state.get()) | 86 , m_agents(m_instrumentingAgents.get(), m_state.get()) |
85 , m_isUnderTest(false) | 87 , m_isUnderTest(false) |
86 , m_deferredAgentsInitialized(false) | 88 , m_deferredAgentsInitialized(false) |
87 { | 89 { |
88 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; | 90 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; |
89 InspectorOverlay* overlay = m_overlay.get(); | 91 InspectorOverlay* overlay = m_overlay.get(); |
90 | 92 |
91 m_agents.append(InspectorInspectorAgent::create(m_page, injectedScriptManage
r)); | 93 m_agents.append(InspectorInspectorAgent::create(m_page, injectedScriptManage
r)); |
92 | 94 |
93 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_page, injectedScriptManager, inspectorClient, overlay)); | 95 OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::crea
te(m_page, injectedScriptManager, m_editedResourcesContentManager.get(), inspect
orClient, overlay)); |
94 m_pageAgent = pageAgentPtr.get(); | 96 m_pageAgent = pageAgentPtr.get(); |
95 m_agents.append(pageAgentPtr.release()); | 97 m_agents.append(pageAgentPtr.release()); |
96 | 98 |
97 OwnPtrWillBeRawPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(
m_pageAgent, injectedScriptManager, overlay)); | 99 OwnPtrWillBeRawPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(
m_pageAgent, injectedScriptManager, overlay)); |
98 m_domAgent = domAgentPtr.get(); | 100 m_domAgent = domAgentPtr.get(); |
99 m_agents.append(domAgentPtr.release()); | 101 m_agents.append(domAgentPtr.release()); |
100 | 102 |
101 | 103 |
102 OwnPtrWillBeRawPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayer
TreeAgent::create(m_page)); | 104 OwnPtrWillBeRawPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayer
TreeAgent::create(m_page)); |
103 m_layerTreeAgent = layerTreeAgentPtr.get(); | 105 m_layerTreeAgent = layerTreeAgentPtr.get(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 163 } |
162 | 164 |
163 void InspectorController::initializeDeferredAgents() | 165 void InspectorController::initializeDeferredAgents() |
164 { | 166 { |
165 if (m_deferredAgentsInitialized) | 167 if (m_deferredAgentsInitialized) |
166 return; | 168 return; |
167 m_deferredAgentsInitialized = true; | 169 m_deferredAgentsInitialized = true; |
168 | 170 |
169 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; | 171 InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get()
; |
170 InspectorOverlay* overlay = m_overlay.get(); | 172 InspectorOverlay* overlay = m_overlay.get(); |
| 173 EditedResourcesContentManager* editedResourcesContentManager = m_editedResou
rcesContentManager.get(); |
171 | 174 |
172 OwnPtrWillBeRawPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourc
eAgent::create(m_pageAgent)); | 175 OwnPtrWillBeRawPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourc
eAgent::create(m_pageAgent, editedResourcesContentManager)); |
173 m_resourceAgent = resourceAgentPtr.get(); | 176 m_resourceAgent = resourceAgentPtr.get(); |
174 m_agents.append(resourceAgentPtr.release()); | 177 m_agents.append(resourceAgentPtr.release()); |
175 | 178 |
176 OwnPtrWillBeRawPtr<InspectorCSSAgent> cssAgentPtr(InspectorCSSAgent::create(
m_domAgent, m_pageAgent, m_resourceAgent)); | 179 OwnPtrWillBeRawPtr<InspectorCSSAgent> cssAgentPtr(InspectorCSSAgent::create(
m_domAgent, m_pageAgent, m_resourceAgent, editedResourcesContentManager)); |
177 m_cssAgent = cssAgentPtr.get(); | 180 m_cssAgent = cssAgentPtr.get(); |
178 m_agents.append(cssAgentPtr.release()); | 181 m_agents.append(cssAgentPtr.release()); |
179 | 182 |
180 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent)); | 183 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent)); |
181 | 184 |
182 m_agents.append(InspectorMemoryAgent::create()); | 185 m_agents.append(InspectorMemoryAgent::create()); |
183 | 186 |
184 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent)); | 187 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent)); |
185 | 188 |
186 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share
d(); | 189 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share
d(); |
187 | 190 |
188 OwnPtrWillBeRawPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgen
t::create(pageScriptDebugServer, m_pageAgent, injectedScriptManager, overlay)); | 191 OwnPtrWillBeRawPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgen
t::create(pageScriptDebugServer, m_pageAgent, injectedScriptManager, editedResou
rcesContentManager, overlay)); |
189 InspectorDebuggerAgent* debuggerAgent = debuggerAgentPtr.get(); | 192 InspectorDebuggerAgent* debuggerAgent = debuggerAgentPtr.get(); |
190 m_agents.append(debuggerAgentPtr.release()); | 193 m_agents.append(debuggerAgentPtr.release()); |
191 | 194 |
192 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent)
); | 195 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent)
); |
193 | 196 |
194 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla
y)); | 197 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla
y)); |
195 | 198 |
196 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager)); | 199 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager)); |
197 | 200 |
198 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana
ger)); | 201 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana
ger)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 m_layerTreeAgent->willAddPageOverlay(layer); | 503 m_layerTreeAgent->willAddPageOverlay(layer); |
501 } | 504 } |
502 | 505 |
503 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) | 506 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) |
504 { | 507 { |
505 if (m_layerTreeAgent) | 508 if (m_layerTreeAgent) |
506 m_layerTreeAgent->didRemovePageOverlay(layer); | 509 m_layerTreeAgent->didRemovePageOverlay(layer); |
507 } | 510 } |
508 | 511 |
509 } // namespace blink | 512 } // namespace blink |
OLD | NEW |