Chromium Code Reviews| 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 12 matching lines...) Expand all Loading... | |
| 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 "web/WebDevToolsAgentImpl.h" | 31 #include "web/WebDevToolsAgentImpl.h" |
| 32 | 32 |
| 33 #include <v8-inspector.h> | |
| 34 #include <memory> | |
| 35 | |
| 33 #include "bindings/core/v8/ScriptController.h" | 36 #include "bindings/core/v8/ScriptController.h" |
| 34 #include "bindings/core/v8/V8Binding.h" | 37 #include "bindings/core/v8/V8Binding.h" |
| 35 #include "core/InstrumentingAgents.h" | 38 #include "core/InstrumentingAgents.h" |
| 36 #include "core/frame/FrameHost.h" | 39 #include "core/frame/FrameHost.h" |
| 37 #include "core/frame/FrameView.h" | 40 #include "core/frame/FrameView.h" |
| 38 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 39 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
| 40 #include "core/inspector/InspectedFrames.h" | 43 #include "core/inspector/InspectedFrames.h" |
| 41 #include "core/inspector/InspectorAnimationAgent.h" | 44 #include "core/inspector/InspectorAnimationAgent.h" |
| 42 #include "core/inspector/InspectorApplicationCacheAgent.h" | 45 #include "core/inspector/InspectorApplicationCacheAgent.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 #include "web/InspectorRenderingAgent.h" | 85 #include "web/InspectorRenderingAgent.h" |
| 83 #include "web/WebFrameWidgetImpl.h" | 86 #include "web/WebFrameWidgetImpl.h" |
| 84 #include "web/WebInputEventConversion.h" | 87 #include "web/WebInputEventConversion.h" |
| 85 #include "web/WebLocalFrameImpl.h" | 88 #include "web/WebLocalFrameImpl.h" |
| 86 #include "web/WebSettingsImpl.h" | 89 #include "web/WebSettingsImpl.h" |
| 87 #include "web/WebViewImpl.h" | 90 #include "web/WebViewImpl.h" |
| 88 #include "wtf/MathExtras.h" | 91 #include "wtf/MathExtras.h" |
| 89 #include "wtf/Noncopyable.h" | 92 #include "wtf/Noncopyable.h" |
| 90 #include "wtf/PtrUtil.h" | 93 #include "wtf/PtrUtil.h" |
| 91 #include "wtf/text/WTFString.h" | 94 #include "wtf/text/WTFString.h" |
| 92 #include <memory> | |
| 93 #include <v8-inspector.h> | |
| 94 | 95 |
| 95 namespace blink { | 96 namespace blink { |
| 96 | 97 |
| 97 namespace { | 98 namespace { |
| 98 | 99 |
| 99 bool isMainFrame(WebLocalFrameImpl* frame) { | 100 bool isMainFrame(WebLocalFrameImpl* frame) { |
| 100 // TODO(dgozman): sometimes view->mainFrameImpl() does return null, even | 101 // TODO(dgozman): sometimes view->mainFrameImpl() does return null, even |
| 101 // though |frame| is meant to be main frame. See http://crbug.com/526162. | 102 // though |frame| is meant to be main frame. See http://crbug.com/526162. |
| 102 return frame->viewImpl() && !frame->parent(); | 103 return frame->viewImpl() && !frame->parent(); |
| 103 } | 104 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 349 | 350 |
| 350 InspectorWorkerAgent* workerAgent = | 351 InspectorWorkerAgent* workerAgent = |
| 351 new InspectorWorkerAgent(m_inspectedFrames.get()); | 352 new InspectorWorkerAgent(m_inspectedFrames.get()); |
| 352 m_session->append(workerAgent); | 353 m_session->append(workerAgent); |
| 353 | 354 |
| 354 InspectorTracingAgent* tracingAgent = | 355 InspectorTracingAgent* tracingAgent = |
| 355 InspectorTracingAgent::create(this, workerAgent, m_inspectedFrames.get()); | 356 InspectorTracingAgent::create(this, workerAgent, m_inspectedFrames.get()); |
| 356 m_tracingAgent = tracingAgent; | 357 m_tracingAgent = tracingAgent; |
| 357 m_session->append(tracingAgent); | 358 m_session->append(tracingAgent); |
| 358 | 359 |
| 360 m_session->append(new InspectorTraceEvents()); | |
|
pfeldman
2017/03/06 23:31:24
Do you want it earlier?
alph
2017/03/07 00:57:48
Done.
| |
| 361 | |
| 359 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, | 362 m_session->append(new InspectorDOMDebuggerAgent(isolate, m_domAgent, |
| 360 m_session->v8Session())); | 363 m_session->v8Session())); |
| 361 | 364 |
| 362 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get())); | 365 m_session->append(InspectorInputAgent::create(m_inspectedFrames.get())); |
| 363 | 366 |
| 364 InspectorPageAgent* pageAgent = InspectorPageAgent::create( | 367 InspectorPageAgent* pageAgent = InspectorPageAgent::create( |
| 365 m_inspectedFrames.get(), this, m_resourceContentLoader.get(), | 368 m_inspectedFrames.get(), this, m_resourceContentLoader.get(), |
| 366 m_session->v8Session()); | 369 m_session->v8Session()); |
| 367 m_pageAgent = pageAgent; | 370 m_pageAgent = pageAgent; |
| 368 m_session->append(pageAgent); | 371 m_session->append(pageAgent); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 } | 649 } |
| 647 | 650 |
| 648 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method) { | 651 bool WebDevToolsAgent::shouldInterruptForMethod(const WebString& method) { |
| 649 return method == "Debugger.pause" || method == "Debugger.setBreakpoint" || | 652 return method == "Debugger.pause" || method == "Debugger.setBreakpoint" || |
| 650 method == "Debugger.setBreakpointByUrl" || | 653 method == "Debugger.setBreakpointByUrl" || |
| 651 method == "Debugger.removeBreakpoint" || | 654 method == "Debugger.removeBreakpoint" || |
| 652 method == "Debugger.setBreakpointsActive"; | 655 method == "Debugger.setBreakpointsActive"; |
| 653 } | 656 } |
| 654 | 657 |
| 655 } // namespace blink | 658 } // namespace blink |
| OLD | NEW |