Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: Source/core/inspector/InspectorController.cpp

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: PTAL Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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 "InspectorBackendDispatcher.h" 34 #include "InspectorBackendDispatcher.h"
35 #include "InspectorFrontend.h" 35 #include "InspectorFrontend.h"
36 #include "bindings/dart/DartScriptDebugServer.h"
36 #include "bindings/v8/DOMWrapperWorld.h" 37 #include "bindings/v8/DOMWrapperWorld.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/InspectorDartAgent.h" 45 #include "core/inspector/InspectorDartAgent.h"
45 #include "core/inspector/InspectorDOMAgent.h" 46 #include "core/inspector/InspectorDOMAgent.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 m_agents.append(tracingAgentPtr.release()); 107 m_agents.append(tracingAgentPtr.release());
107 108
108 OwnPtr<InspectorTimelineAgent> timelineAgentPtr(InspectorTimelineAgent::crea te(m_pageAgent, m_layerTreeAgent, 109 OwnPtr<InspectorTimelineAgent> timelineAgentPtr(InspectorTimelineAgent::crea te(m_pageAgent, m_layerTreeAgent,
109 overlay, InspectorTimelineAgent::PageInspector, inspectorClient)); 110 overlay, InspectorTimelineAgent::PageInspector, inspectorClient));
110 OwnPtr<InspectorDartAgent> dartAgentPtr(InspectorDartAgent::create(m_instrum entingAgents.get(), m_pageAgent, m_state.get())); 111 OwnPtr<InspectorDartAgent> dartAgentPtr(InspectorDartAgent::create(m_instrum entingAgents.get(), m_pageAgent, m_state.get()));
111 m_dartAgent = dartAgentPtr.get(); 112 m_dartAgent = dartAgentPtr.get();
112 m_agents.append(dartAgentPtr.release()); 113 m_agents.append(dartAgentPtr.release());
113 m_timelineAgent = timelineAgentPtr.get(); 114 m_timelineAgent = timelineAgentPtr.get();
114 m_agents.append(timelineAgentPtr.release()); 115 m_agents.append(timelineAgentPtr.release());
115 116
116 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share d(); 117 UnifiedScriptDebugServer* unifiedScriptDebugServer = &UnifiedScriptDebugServ er::shared();
118 ScriptDebugServer* scriptDebugServer = &PageScriptDebugServer::shared();
117 119
118 m_agents.append(PageRuntimeAgent::create(injectedScriptManager, pageScriptDe bugServer, m_page, m_pageAgent)); 120 m_agents.append(PageRuntimeAgent::create(injectedScriptManager, unifiedScrip tDebugServer, m_page, m_pageAgent));
119 121
120 m_agents.append(PageConsoleAgent::create(injectedScriptManager, m_domAgent, m_timelineAgent)); 122 m_agents.append(PageConsoleAgent::create(injectedScriptManager, m_domAgent, m_timelineAgent));
121 123
122 m_agents.append(InspectorWorkerAgent::create()); 124 m_agents.append(InspectorWorkerAgent::create());
123 125
124 ASSERT_ARG(inspectorClient, inspectorClient); 126 ASSERT_ARG(inspectorClient, inspectorClient);
125 m_injectedScriptManager->injectedScriptHost()->init(m_instrumentingAgents.ge t(), pageScriptDebugServer); 127 m_injectedScriptManager->injectedScriptHost()->init(m_instrumentingAgents.ge t(), scriptDebugServer);
126 } 128 }
127 129
128 InspectorController::~InspectorController() 130 InspectorController::~InspectorController()
129 { 131 {
130 } 132 }
131 133
132 PassOwnPtr<InspectorController> InspectorController::create(Page* page, Inspecto rClient* client) 134 PassOwnPtr<InspectorController> InspectorController::create(Page* page, Inspecto rClient* client)
133 { 135 {
134 return adoptPtr(new InspectorController(page, client)); 136 return adoptPtr(new InspectorController(page, client));
135 } 137 }
(...skipping 22 matching lines...) Expand all
158 m_agents.append(resourceAgentPtr.release()); 160 m_agents.append(resourceAgentPtr.release());
159 161
160 m_agents.append(InspectorCSSAgent::create(m_domAgent, m_pageAgent, resourceA gent)); 162 m_agents.append(InspectorCSSAgent::create(m_domAgent, m_pageAgent, resourceA gent));
161 163
162 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent)); 164 m_agents.append(InspectorDOMStorageAgent::create(m_pageAgent));
163 165
164 m_agents.append(InspectorMemoryAgent::create()); 166 m_agents.append(InspectorMemoryAgent::create());
165 167
166 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent)); 168 m_agents.append(InspectorApplicationCacheAgent::create(m_pageAgent));
167 169
168 PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::share d(); 170 UnifiedScriptDebugServer* unifiedScriptDebugServer = &UnifiedScriptDebugServ er::shared();
169 171
170 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(pa geScriptDebugServer, m_pageAgent, injectedScriptManager, overlay)); 172 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(un ifiedScriptDebugServer, m_pageAgent, injectedScriptManager, overlay));
171 InspectorDebuggerAgent* debuggerAgent = debuggerAgentPtr.get(); 173 InspectorDebuggerAgent* debuggerAgent = debuggerAgentPtr.get();
172 m_agents.append(debuggerAgentPtr.release()); 174 m_agents.append(debuggerAgentPtr.release());
173 175
174 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent) ); 176 m_agents.append(InspectorDOMDebuggerAgent::create(m_domAgent, debuggerAgent) );
175 177
176 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla y)); 178 m_agents.append(InspectorProfilerAgent::create(injectedScriptManager, overla y));
177 179
178 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager)); 180 m_agents.append(InspectorHeapProfilerAgent::create(injectedScriptManager));
179 181
180 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana ger)); 182 m_agents.append(InspectorCanvasAgent::create(m_pageAgent, injectedScriptMana ger));
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 Document* document = node->ownerDocument(); 313 Document* document = node->ownerDocument();
312 if (!document) 314 if (!document)
313 return; 315 return;
314 LocalFrame* frame = document->frame(); 316 LocalFrame* frame = document->frame();
315 if (!frame) 317 if (!frame)
316 return; 318 return;
317 319
318 if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCU MENT_NODE) 320 if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCU MENT_NODE)
319 node = node->parentNode(); 321 node = node->parentNode();
320 322
321 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(V 8ScriptState::forMainWorld(frame)); 323 V8InjectedScript* injectedScript = static_cast<V8InjectedScript*>(&m_injecte dScriptManager->injectedScriptFor(V8ScriptState::forMainWorld(frame)));
322 if (injectedScript.isEmpty()) 324 if (injectedScript->isEmpty())
323 return; 325 return;
324 injectedScript.inspectNode(node); 326 injectedScript->inspectNode(node);
325 } 327 }
326 328
327 void InspectorController::setInjectedScriptForOrigin(const String& origin, const String& source) 329 void InspectorController::setInjectedScriptForOrigin(const String& origin, const String& source)
328 { 330 {
329 if (InspectorInspectorAgent* inspectorAgent = m_instrumentingAgents->inspect orInspectorAgent()) 331 if (InspectorInspectorAgent* inspectorAgent = m_instrumentingAgents->inspect orInspectorAgent())
330 inspectorAgent->setInjectedScriptForOrigin(origin, source); 332 inspectorAgent->setInjectedScriptForOrigin(origin, source);
331 } 333 }
332 334
333 void InspectorController::dispatchMessageFromFrontend(const String& message) 335 void InspectorController::dispatchMessageFromFrontend(const String& message)
334 { 336 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 m_layerTreeAgent->willAddPageOverlay(layer); 480 m_layerTreeAgent->willAddPageOverlay(layer);
479 } 481 }
480 482
481 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer) 483 void InspectorController::didRemovePageOverlay(const GraphicsLayer* layer)
482 { 484 {
483 if (m_layerTreeAgent) 485 if (m_layerTreeAgent)
484 m_layerTreeAgent->didRemovePageOverlay(layer); 486 m_layerTreeAgent->didRemovePageOverlay(layer);
485 } 487 }
486 488
487 } // namespace WebCore 489 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCanvasAgent.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698