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

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

Issue 13646003: DevTools: Remove ENABLE(INSPECTOR) and ENABLE(JAVASCRIPT_DEBUGGER) from the code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
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 32
33 #if ENABLE(INSPECTOR)
34 33
35 #include "InspectorController.h" 34 #include "InspectorController.h"
36 35
37 #include "Frame.h" 36 #include "Frame.h"
38 #include "GraphicsContext.h" 37 #include "GraphicsContext.h"
39 #include "IdentifiersFactory.h" 38 #include "IdentifiersFactory.h"
40 #include "InjectedScriptHost.h" 39 #include "InjectedScriptHost.h"
41 #include "InjectedScriptManager.h" 40 #include "InjectedScriptManager.h"
42 #include "InspectorAgent.h" 41 #include "InspectorAgent.h"
43 #include "InspectorApplicationCacheAgent.h" 42 #include "InspectorApplicationCacheAgent.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 m_agents.append(resourceAgentPtr.release()); 133 m_agents.append(resourceAgentPtr.release());
135 134
136 OwnPtr<InspectorRuntimeAgent> runtimeAgentPtr(PageRuntimeAgent::create(m_ins trumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), page, page Agent)); 135 OwnPtr<InspectorRuntimeAgent> runtimeAgentPtr(PageRuntimeAgent::create(m_ins trumentingAgents.get(), m_state.get(), m_injectedScriptManager.get(), page, page Agent));
137 InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get(); 136 InspectorRuntimeAgent* runtimeAgent = runtimeAgentPtr.get();
138 m_agents.append(runtimeAgentPtr.release()); 137 m_agents.append(runtimeAgentPtr.release());
139 138
140 OwnPtr<InspectorConsoleAgent> consoleAgentPtr(PageConsoleAgent::create(m_ins trumentingAgents.get(), m_inspectorAgent, m_state.get(), m_injectedScriptManager .get(), m_domAgent)); 139 OwnPtr<InspectorConsoleAgent> consoleAgentPtr(PageConsoleAgent::create(m_ins trumentingAgents.get(), m_inspectorAgent, m_state.get(), m_injectedScriptManager .get(), m_domAgent));
141 InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get(); 140 InspectorConsoleAgent* consoleAgent = consoleAgentPtr.get();
142 m_agents.append(consoleAgentPtr.release()); 141 m_agents.append(consoleAgentPtr.release());
143 142
144 #if ENABLE(JAVASCRIPT_DEBUGGER)
145 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(m_ instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get (), m_overlay.get())); 143 OwnPtr<InspectorDebuggerAgent> debuggerAgentPtr(PageDebuggerAgent::create(m_ instrumentingAgents.get(), m_state.get(), pageAgent, m_injectedScriptManager.get (), m_overlay.get()));
146 m_debuggerAgent = debuggerAgentPtr.get(); 144 m_debuggerAgent = debuggerAgentPtr.get();
147 m_agents.append(debuggerAgentPtr.release()); 145 m_agents.append(debuggerAgentPtr.release());
148 146
149 OwnPtr<InspectorDOMDebuggerAgent> domDebuggerAgentPtr(InspectorDOMDebuggerAg ent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_debuggerAg ent, m_inspectorAgent)); 147 OwnPtr<InspectorDOMDebuggerAgent> domDebuggerAgentPtr(InspectorDOMDebuggerAg ent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent, m_debuggerAg ent, m_inspectorAgent));
150 m_domDebuggerAgent = domDebuggerAgentPtr.get(); 148 m_domDebuggerAgent = domDebuggerAgentPtr.get();
151 m_agents.append(domDebuggerAgentPtr.release()); 149 m_agents.append(domDebuggerAgentPtr.release());
152 150
153 OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::crea te(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScr iptManager.get())); 151 OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::crea te(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScr iptManager.get()));
154 m_profilerAgent = profilerAgentPtr.get(); 152 m_profilerAgent = profilerAgentPtr.get();
155 m_agents.append(profilerAgentPtr.release()); 153 m_agents.append(profilerAgentPtr.release());
156 154
157 m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get (), m_state.get(), m_injectedScriptManager.get())); 155 m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get (), m_state.get(), m_injectedScriptManager.get()));
158 156
159 #endif
160 157
161 #if ENABLE(WORKERS) 158 #if ENABLE(WORKERS)
162 m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_ state.get())); 159 m_agents.append(InspectorWorkerAgent::create(m_instrumentingAgents.get(), m_ state.get()));
163 #endif 160 #endif
164 161
165 m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_ state.get(), pageAgent, m_injectedScriptManager.get())); 162 m_agents.append(InspectorCanvasAgent::create(m_instrumentingAgents.get(), m_ state.get(), pageAgent, m_injectedScriptManager.get()));
166 163
167 m_agents.append(InspectorInputAgent::create(m_instrumentingAgents.get(), m_s tate.get(), page)); 164 m_agents.append(InspectorInputAgent::create(m_instrumentingAgents.get(), m_s tate.get(), page));
168 165
169 #if USE(ACCELERATED_COMPOSITING) 166 #if USE(ACCELERATED_COMPOSITING)
170 m_agents.append(InspectorLayerTreeAgent::create(m_instrumentingAgents.get(), m_state.get())); 167 m_agents.append(InspectorLayerTreeAgent::create(m_instrumentingAgents.get(), m_state.get()));
171 #endif 168 #endif
172 169
173 ASSERT_ARG(inspectorClient, inspectorClient); 170 ASSERT_ARG(inspectorClient, inspectorClient);
174 m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent 171 m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent
175 , consoleAgent 172 , consoleAgent
176 #if ENABLE(SQL_DATABASE) 173 #if ENABLE(SQL_DATABASE)
177 , databaseAgent 174 , databaseAgent
178 #endif 175 #endif
179 , domStorageAgent 176 , domStorageAgent
180 , m_domAgent 177 , m_domAgent
181 , m_debuggerAgent 178 , m_debuggerAgent
182 ); 179 );
183 180
184 #if ENABLE(JAVASCRIPT_DEBUGGER)
185 runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer()); 181 runtimeAgent->setScriptDebugServer(&m_debuggerAgent->scriptDebugServer());
186 #endif
187 } 182 }
188 183
189 InspectorController::~InspectorController() 184 InspectorController::~InspectorController()
190 { 185 {
191 m_instrumentingAgents->reset(); 186 m_instrumentingAgents->reset();
192 m_agents.discardAgents(); 187 m_agents.discardAgents();
193 ASSERT(!m_inspectorClient); 188 ASSERT(!m_inspectorClient);
194 } 189 }
195 190
196 PassOwnPtr<InspectorController> InspectorController::create(Page* page, Inspecto rClient* client) 191 PassOwnPtr<InspectorController> InspectorController::create(Page* page, Inspecto rClient* client)
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 { 359 {
365 ErrorString error; 360 ErrorString error;
366 m_domAgent->hideHighlight(&error); 361 m_domAgent->hideHighlight(&error);
367 } 362 }
368 363
369 Node* InspectorController::highlightedNode() const 364 Node* InspectorController::highlightedNode() const
370 { 365 {
371 return m_overlay->highlightedNode(); 366 return m_overlay->highlightedNode();
372 } 367 }
373 368
374 #if ENABLE(JAVASCRIPT_DEBUGGER)
375 bool InspectorController::profilerEnabled() 369 bool InspectorController::profilerEnabled()
376 { 370 {
377 return m_profilerAgent->enabled(); 371 return m_profilerAgent->enabled();
378 } 372 }
379 373
380 void InspectorController::setProfilerEnabled(bool enable) 374 void InspectorController::setProfilerEnabled(bool enable)
381 { 375 {
382 ErrorString error; 376 ErrorString error;
383 if (enable) 377 if (enable)
384 m_profilerAgent->enable(&error); 378 m_profilerAgent->enable(&error);
385 else 379 else
386 m_profilerAgent->disable(&error); 380 m_profilerAgent->disable(&error);
387 } 381 }
388 382
389 void InspectorController::resume() 383 void InspectorController::resume()
390 { 384 {
391 if (m_debuggerAgent) { 385 if (m_debuggerAgent) {
392 ErrorString error; 386 ErrorString error;
393 m_debuggerAgent->resume(&error); 387 m_debuggerAgent->resume(&error);
394 } 388 }
395 } 389 }
396 #endif
397 390
398 void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumRes ourcesContentSize, int maximumSingleResourceContentSize) 391 void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumRes ourcesContentSize, int maximumSingleResourceContentSize)
399 { 392 {
400 m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesCon tentSize, maximumSingleResourceContentSize); 393 m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesCon tentSize, maximumSingleResourceContentSize);
401 } 394 }
402 395
403 void InspectorController::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 396 void InspectorController::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
404 { 397 {
405 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorCo ntroller); 398 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorCo ntroller);
406 info.addMember(m_inspectorAgent, "inspectorAgent"); 399 info.addMember(m_inspectorAgent, "inspectorAgent");
407 info.addMember(m_instrumentingAgents, "instrumentingAgents"); 400 info.addMember(m_instrumentingAgents, "instrumentingAgents");
408 info.addMember(m_injectedScriptManager, "injectedScriptManager"); 401 info.addMember(m_injectedScriptManager, "injectedScriptManager");
409 info.addMember(m_state, "state"); 402 info.addMember(m_state, "state");
410 info.addMember(m_overlay, "overlay"); 403 info.addMember(m_overlay, "overlay");
411 404
412 info.addMember(m_inspectorAgent, "inspectorAgent"); 405 info.addMember(m_inspectorAgent, "inspectorAgent");
413 info.addMember(m_domAgent, "domAgent"); 406 info.addMember(m_domAgent, "domAgent");
414 info.addMember(m_resourceAgent, "resourceAgent"); 407 info.addMember(m_resourceAgent, "resourceAgent");
415 info.addMember(m_pageAgent, "pageAgent"); 408 info.addMember(m_pageAgent, "pageAgent");
416 #if ENABLE(JAVASCRIPT_DEBUGGER)
417 info.addMember(m_debuggerAgent, "debuggerAgent"); 409 info.addMember(m_debuggerAgent, "debuggerAgent");
418 info.addMember(m_domDebuggerAgent, "domDebuggerAgent"); 410 info.addMember(m_domDebuggerAgent, "domDebuggerAgent");
419 info.addMember(m_profilerAgent, "profilerAgent"); 411 info.addMember(m_profilerAgent, "profilerAgent");
420 #endif
421 412
422 info.addMember(m_inspectorBackendDispatcher, "inspectorBackendDispatcher"); 413 info.addMember(m_inspectorBackendDispatcher, "inspectorBackendDispatcher");
423 info.addMember(m_inspectorFrontendClient, "inspectorFrontendClient"); 414 info.addMember(m_inspectorFrontendClient, "inspectorFrontendClient");
424 info.addMember(m_inspectorFrontend, "inspectorFrontend"); 415 info.addMember(m_inspectorFrontend, "inspectorFrontend");
425 info.addMember(m_page, "page"); 416 info.addMember(m_page, "page");
426 info.addWeakPointer(m_inspectorClient); 417 info.addWeakPointer(m_inspectorClient);
427 info.addMember(m_agents, "agents"); 418 info.addMember(m_agents, "agents");
428 } 419 }
429 420
430 void InspectorController::willProcessTask() 421 void InspectorController::willProcessTask()
431 { 422 {
432 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent()) 423 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent())
433 timelineAgent->willProcessTask(); 424 timelineAgent->willProcessTask();
434 #if ENABLE(JAVASCRIPT_DEBUGGER)
435 m_profilerAgent->willProcessTask(); 425 m_profilerAgent->willProcessTask();
436 #endif
437 } 426 }
438 427
439 void InspectorController::didProcessTask() 428 void InspectorController::didProcessTask()
440 { 429 {
441 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent()) 430 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent())
442 timelineAgent->didProcessTask(); 431 timelineAgent->didProcessTask();
443 #if ENABLE(JAVASCRIPT_DEBUGGER)
444 m_profilerAgent->didProcessTask(); 432 m_profilerAgent->didProcessTask();
445 m_domDebuggerAgent->didProcessTask(); 433 m_domDebuggerAgent->didProcessTask();
446 #endif
447 } 434 }
448 435
449 void InspectorController::didBeginFrame() 436 void InspectorController::didBeginFrame()
450 { 437 {
451 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent()) 438 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspector TimelineAgent())
452 timelineAgent->didBeginFrame(); 439 timelineAgent->didBeginFrame();
453 if (InspectorCanvasAgent* canvasAgent = m_instrumentingAgents->inspectorCanv asAgent()) 440 if (InspectorCanvasAgent* canvasAgent = m_instrumentingAgents->inspectorCanv asAgent())
454 canvasAgent->didBeginFrame(); 441 canvasAgent->didBeginFrame();
455 } 442 }
456 443
(...skipping 17 matching lines...) Expand all
474 461
475 HashMap<String, size_t> InspectorController::processMemoryDistribution() const 462 HashMap<String, size_t> InspectorController::processMemoryDistribution() const
476 { 463 {
477 HashMap<String, size_t> memoryInfo; 464 HashMap<String, size_t> memoryInfo;
478 m_memoryAgent->getProcessMemoryDistributionMap(&memoryInfo); 465 m_memoryAgent->getProcessMemoryDistributionMap(&memoryInfo);
479 return memoryInfo; 466 return memoryInfo;
480 } 467 }
481 468
482 } // namespace WebCore 469 } // namespace WebCore
483 470
484 #endif // ENABLE(INSPECTOR)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698