| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-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 Loading... |
| 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 "web/WebDevToolsAgentImpl.h" | 31 #include "web/WebDevToolsAgentImpl.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ScriptController.h" | 33 #include "bindings/core/v8/ScriptController.h" |
| 34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
| 35 #include "core/InstrumentingAgents.h" | 35 #include "core/InstrumentingAgents.h" |
| 36 #include "core/frame/FrameHost.h" |
| 36 #include "core/frame/FrameView.h" | 37 #include "core/frame/FrameView.h" |
| 37 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 38 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
| 39 #include "core/inspector/InspectedFrames.h" | 40 #include "core/inspector/InspectedFrames.h" |
| 40 #include "core/inspector/InspectorAnimationAgent.h" | 41 #include "core/inspector/InspectorAnimationAgent.h" |
| 41 #include "core/inspector/InspectorApplicationCacheAgent.h" | 42 #include "core/inspector/InspectorApplicationCacheAgent.h" |
| 42 #include "core/inspector/InspectorCSSAgent.h" | 43 #include "core/inspector/InspectorCSSAgent.h" |
| 43 #include "core/inspector/InspectorDOMAgent.h" | 44 #include "core/inspector/InspectorDOMAgent.h" |
| 44 #include "core/inspector/InspectorDOMDebuggerAgent.h" | 45 #include "core/inspector/InspectorDOMDebuggerAgent.h" |
| 45 #include "core/inspector/InspectorInputAgent.h" | 46 #include "core/inspector/InspectorInputAgent.h" |
| 46 #include "core/inspector/InspectorInstrumentation.h" | 47 #include "core/inspector/InspectorInstrumentation.h" |
| 47 #include "core/inspector/InspectorLayerTreeAgent.h" | 48 #include "core/inspector/InspectorLayerTreeAgent.h" |
| 49 #include "core/inspector/InspectorLogAgent.h" |
| 48 #include "core/inspector/InspectorMemoryAgent.h" | 50 #include "core/inspector/InspectorMemoryAgent.h" |
| 49 #include "core/inspector/InspectorNetworkAgent.h" | 51 #include "core/inspector/InspectorNetworkAgent.h" |
| 50 #include "core/inspector/InspectorPageAgent.h" | 52 #include "core/inspector/InspectorPageAgent.h" |
| 51 #include "core/inspector/InspectorResourceContainer.h" | 53 #include "core/inspector/InspectorResourceContainer.h" |
| 52 #include "core/inspector/InspectorResourceContentLoader.h" | 54 #include "core/inspector/InspectorResourceContentLoader.h" |
| 53 #include "core/inspector/InspectorTaskRunner.h" | 55 #include "core/inspector/InspectorTaskRunner.h" |
| 54 #include "core/inspector/InspectorTracingAgent.h" | 56 #include "core/inspector/InspectorTracingAgent.h" |
| 55 #include "core/inspector/InspectorWorkerAgent.h" | 57 #include "core/inspector/InspectorWorkerAgent.h" |
| 56 #include "core/inspector/LayoutEditor.h" | 58 #include "core/inspector/LayoutEditor.h" |
| 57 #include "core/inspector/MainThreadDebugger.h" | 59 #include "core/inspector/MainThreadDebugger.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) | 305 , m_instrumentingAgents(m_webLocalFrameImpl->frame()->instrumentingAgents()) |
| 304 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF
rameImpl->frame())) | 306 , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalF
rameImpl->frame())) |
| 305 , m_overlay(overlay) | 307 , m_overlay(overlay) |
| 306 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame())) | 308 , m_inspectedFrames(InspectedFrames::create(m_webLocalFrameImpl->frame())) |
| 307 , m_resourceContainer(new InspectorResourceContainer(m_inspectedFrames)) | 309 , m_resourceContainer(new InspectorResourceContainer(m_inspectedFrames)) |
| 308 , m_domAgent(nullptr) | 310 , m_domAgent(nullptr) |
| 309 , m_pageAgent(nullptr) | 311 , m_pageAgent(nullptr) |
| 310 , m_networkAgent(nullptr) | 312 , m_networkAgent(nullptr) |
| 311 , m_layerTreeAgent(nullptr) | 313 , m_layerTreeAgent(nullptr) |
| 312 , m_tracingAgent(nullptr) | 314 , m_tracingAgent(nullptr) |
| 315 , m_logAgent(nullptr) |
| 313 , m_includeViewAgents(includeViewAgents) | 316 , m_includeViewAgents(includeViewAgents) |
| 314 , m_layerTreeId(0) | 317 , m_layerTreeId(0) |
| 315 { | 318 { |
| 316 DCHECK(isMainThread()); | 319 DCHECK(isMainThread()); |
| 317 DCHECK(m_webLocalFrameImpl->frame()); | 320 DCHECK(m_webLocalFrameImpl->frame()); |
| 318 } | 321 } |
| 319 | 322 |
| 320 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() | 323 WebDevToolsAgentImpl::~WebDevToolsAgentImpl() |
| 321 { | 324 { |
| 322 DCHECK(!m_client); | 325 DCHECK(!m_client); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 340 visitor->trace(m_instrumentingAgents); | 343 visitor->trace(m_instrumentingAgents); |
| 341 visitor->trace(m_resourceContentLoader); | 344 visitor->trace(m_resourceContentLoader); |
| 342 visitor->trace(m_overlay); | 345 visitor->trace(m_overlay); |
| 343 visitor->trace(m_inspectedFrames); | 346 visitor->trace(m_inspectedFrames); |
| 344 visitor->trace(m_resourceContainer); | 347 visitor->trace(m_resourceContainer); |
| 345 visitor->trace(m_domAgent); | 348 visitor->trace(m_domAgent); |
| 346 visitor->trace(m_pageAgent); | 349 visitor->trace(m_pageAgent); |
| 347 visitor->trace(m_networkAgent); | 350 visitor->trace(m_networkAgent); |
| 348 visitor->trace(m_layerTreeAgent); | 351 visitor->trace(m_layerTreeAgent); |
| 349 visitor->trace(m_tracingAgent); | 352 visitor->trace(m_tracingAgent); |
| 353 visitor->trace(m_logAgent); |
| 350 visitor->trace(m_session); | 354 visitor->trace(m_session); |
| 351 } | 355 } |
| 352 | 356 |
| 353 void WebDevToolsAgentImpl::willBeDestroyed() | 357 void WebDevToolsAgentImpl::willBeDestroyed() |
| 354 { | 358 { |
| 355 DCHECK(m_webLocalFrameImpl->frame()); | 359 DCHECK(m_webLocalFrameImpl->frame()); |
| 356 DCHECK(m_inspectedFrames->root()->view()); | 360 DCHECK(m_inspectedFrames->root()->view()); |
| 357 detach(); | 361 detach(); |
| 358 m_resourceContentLoader->dispose(); | 362 m_resourceContentLoader->dispose(); |
| 359 m_client = nullptr; | 363 m_client = nullptr; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 m_session->append(tracingAgent); | 403 m_session->append(tracingAgent); |
| 400 | 404 |
| 401 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, m_sessi
on->v8Session())); | 405 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, m_sessi
on->v8Session())); |
| 402 | 406 |
| 403 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get())); | 407 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get())); |
| 404 | 408 |
| 405 InspectorPageAgent* pageAgent = InspectorPageAgent::create(m_inspectedFrames
.get(), this, m_resourceContentLoader.get(), m_session->v8Session()); | 409 InspectorPageAgent* pageAgent = InspectorPageAgent::create(m_inspectedFrames
.get(), this, m_resourceContentLoader.get(), m_session->v8Session()); |
| 406 m_pageAgent = pageAgent; | 410 m_pageAgent = pageAgent; |
| 407 m_session->append(pageAgent); | 411 m_session->append(pageAgent); |
| 408 | 412 |
| 413 m_logAgent = new InspectorLogAgent(&m_inspectedFrames->root()->host()->conso
leMessageStorage()); |
| 414 m_session->append(m_logAgent.get()); |
| 415 |
| 409 m_tracingAgent->setLayerTreeId(m_layerTreeId); | 416 m_tracingAgent->setLayerTreeId(m_layerTreeId); |
| 410 m_networkAgent->setHostId(hostId); | 417 m_networkAgent->setHostId(hostId); |
| 411 | 418 |
| 412 if (m_includeViewAgents) { | 419 if (m_includeViewAgents) { |
| 413 // TODO(dgozman): we should actually pass the view instead of frame, but
during | 420 // TODO(dgozman): we should actually pass the view instead of frame, but
during |
| 414 // remote->local transition we cannot access mainFrameImpl() yet, so we
have to store the | 421 // remote->local transition we cannot access mainFrameImpl() yet, so we
have to store the |
| 415 // frame which will become the main frame later. | 422 // frame which will become the main frame later. |
| 416 m_session->append(InspectorRenderingAgent::create(m_webLocalFrameImpl, m
_overlay.get())); | 423 m_session->append(InspectorRenderingAgent::create(m_webLocalFrameImpl, m
_overlay.get())); |
| 417 m_session->append(InspectorEmulationAgent::create(m_webLocalFrameImpl, t
his)); | 424 m_session->append(InspectorEmulationAgent::create(m_webLocalFrameImpl, t
his)); |
| 418 // TODO(dgozman): migrate each of the following agents to frame once mod
ule is ready. | 425 // TODO(dgozman): migrate each of the following agents to frame once mod
ule is ready. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 433 void WebDevToolsAgentImpl::destroySession() | 440 void WebDevToolsAgentImpl::destroySession() |
| 434 { | 441 { |
| 435 if (m_overlay) | 442 if (m_overlay) |
| 436 m_overlay->clear(); | 443 m_overlay->clear(); |
| 437 | 444 |
| 438 m_tracingAgent.clear(); | 445 m_tracingAgent.clear(); |
| 439 m_layerTreeAgent.clear(); | 446 m_layerTreeAgent.clear(); |
| 440 m_networkAgent.clear(); | 447 m_networkAgent.clear(); |
| 441 m_pageAgent.clear(); | 448 m_pageAgent.clear(); |
| 442 m_domAgent.clear(); | 449 m_domAgent.clear(); |
| 450 m_logAgent.clear(); |
| 443 | 451 |
| 444 m_session->dispose(); | 452 m_session->dispose(); |
| 445 m_session.clear(); | 453 m_session.clear(); |
| 446 | 454 |
| 447 Platform::current()->currentThread()->removeTaskObserver(this); | 455 Platform::current()->currentThread()->removeTaskObserver(this); |
| 448 } | 456 } |
| 449 | 457 |
| 450 void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId) | 458 void WebDevToolsAgentImpl::attach(const WebString& hostId, int sessionId) |
| 451 { | 459 { |
| 452 if (attached()) | 460 if (attached()) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 void WebDevToolsAgentImpl::profilingStopped() | 607 void WebDevToolsAgentImpl::profilingStopped() |
| 600 { | 608 { |
| 601 if (m_overlay) | 609 if (m_overlay) |
| 602 m_overlay->resume(); | 610 m_overlay->resume(); |
| 603 } | 611 } |
| 604 | 612 |
| 605 void WebDevToolsAgentImpl::consoleCleared() | 613 void WebDevToolsAgentImpl::consoleCleared() |
| 606 { | 614 { |
| 607 if (m_domAgent) | 615 if (m_domAgent) |
| 608 m_domAgent->releaseDanglingNodes(); | 616 m_domAgent->releaseDanglingNodes(); |
| 617 if (m_logAgent) |
| 618 m_logAgent->clear(nullptr); |
| 609 } | 619 } |
| 610 | 620 |
| 611 void WebDevToolsAgentImpl::pageLayoutInvalidated(bool resized) | 621 void WebDevToolsAgentImpl::pageLayoutInvalidated(bool resized) |
| 612 { | 622 { |
| 613 if (m_overlay) | 623 if (m_overlay) |
| 614 m_overlay->pageLayoutInvalidated(resized); | 624 m_overlay->pageLayoutInvalidated(resized); |
| 615 } | 625 } |
| 616 | 626 |
| 617 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message) | 627 void WebDevToolsAgentImpl::setPausedInDebuggerMessage(const String& message) |
| 618 { | 628 { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method) | 687 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method) |
| 678 { | 688 { |
| 679 return method == "Debugger.pause" | 689 return method == "Debugger.pause" |
| 680 || method == "Debugger.setBreakpoint" | 690 || method == "Debugger.setBreakpoint" |
| 681 || method == "Debugger.setBreakpointByUrl" | 691 || method == "Debugger.setBreakpointByUrl" |
| 682 || method == "Debugger.removeBreakpoint" | 692 || method == "Debugger.removeBreakpoint" |
| 683 || method == "Debugger.setBreakpointsActive"; | 693 || method == "Debugger.setBreakpointsActive"; |
| 684 } | 694 } |
| 685 | 695 |
| 686 } // namespace blink | 696 } // namespace blink |
| OLD | NEW |