| 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 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/inspector/PageDebuggerAgent.h" | 32 #include "core/inspector/PageDebuggerAgent.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/DOMWrapperWorld.h" | 34 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 35 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/frame/FrameConsole.h" | 37 #include "core/frame/FrameConsole.h" |
| 38 #include "core/frame/LocalFrame.h" | 38 #include "core/frame/LocalFrame.h" |
| 39 #include "core/inspector/InjectedScript.h" | 39 #include "core/inspector/InjectedScript.h" |
| 40 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
| 41 #include "core/inspector/InspectorOverlay.h" | |
| 42 #include "core/inspector/InspectorPageAgent.h" | 41 #include "core/inspector/InspectorPageAgent.h" |
| 43 #include "core/inspector/InspectorTraceEvents.h" | 42 #include "core/inspector/InspectorTraceEvents.h" |
| 44 #include "core/inspector/InstrumentingAgents.h" | 43 #include "core/inspector/InstrumentingAgents.h" |
| 45 #include "core/inspector/MainThreadDebugger.h" | 44 #include "core/inspector/MainThreadDebugger.h" |
| 46 #include "core/loader/DocumentLoader.h" | 45 #include "core/loader/DocumentLoader.h" |
| 47 #include "core/page/Page.h" | 46 #include "core/page/Page.h" |
| 48 | 47 |
| 49 using blink::TypeBuilder::Debugger::ExceptionDetails; | 48 using blink::TypeBuilder::Debugger::ExceptionDetails; |
| 50 using blink::TypeBuilder::Debugger::ScriptId; | 49 using blink::TypeBuilder::Debugger::ScriptId; |
| 51 using blink::TypeBuilder::Runtime::RemoteObject; | 50 using blink::TypeBuilder::Runtime::RemoteObject; |
| 52 | 51 |
| 53 namespace blink { | 52 namespace blink { |
| 54 | 53 |
| 55 PassOwnPtrWillBeRawPtr<PageDebuggerAgent> PageDebuggerAgent::create(MainThreadDe
bugger* mainThreadDebugger, InspectorPageAgent* pageAgent, InjectedScriptManager
* injectedScriptManager, InspectorOverlay* overlay) | 54 PassOwnPtrWillBeRawPtr<PageDebuggerAgent> PageDebuggerAgent::create(MainThreadDe
bugger* mainThreadDebugger, InspectorPageAgent* pageAgent, InjectedScriptManager
* injectedScriptManager) |
| 56 { | 55 { |
| 57 return adoptPtrWillBeNoop(new PageDebuggerAgent(mainThreadDebugger, pageAgen
t, injectedScriptManager, overlay)); | 56 return adoptPtrWillBeNoop(new PageDebuggerAgent(mainThreadDebugger, pageAgen
t, injectedScriptManager)); |
| 58 } | 57 } |
| 59 | 58 |
| 60 PageDebuggerAgent::PageDebuggerAgent(MainThreadDebugger* mainThreadDebugger, Ins
pectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, Inspec
torOverlay* overlay) | 59 PageDebuggerAgent::PageDebuggerAgent(MainThreadDebugger* mainThreadDebugger, Ins
pectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager) |
| 61 : InspectorDebuggerAgent(injectedScriptManager, mainThreadDebugger->debugger
(), mainThreadDebugger->contextGroupId(pageAgent->inspectedFrame())) | 60 : InspectorDebuggerAgent(injectedScriptManager, mainThreadDebugger->debugger
(), mainThreadDebugger->contextGroupId(pageAgent->inspectedFrame())) |
| 62 , m_pageAgent(pageAgent) | 61 , m_pageAgent(pageAgent) |
| 63 , m_overlay(overlay) | |
| 64 { | 62 { |
| 65 m_overlay->setListener(this); | |
| 66 } | 63 } |
| 67 | 64 |
| 68 PageDebuggerAgent::~PageDebuggerAgent() | 65 PageDebuggerAgent::~PageDebuggerAgent() |
| 69 { | 66 { |
| 70 } | 67 } |
| 71 | 68 |
| 72 DEFINE_TRACE(PageDebuggerAgent) | 69 DEFINE_TRACE(PageDebuggerAgent) |
| 73 { | 70 { |
| 74 visitor->trace(m_pageAgent); | 71 visitor->trace(m_pageAgent); |
| 75 visitor->trace(m_overlay); | |
| 76 InspectorDebuggerAgent::trace(visitor); | 72 InspectorDebuggerAgent::trace(visitor); |
| 77 } | 73 } |
| 78 | 74 |
| 79 bool PageDebuggerAgent::canExecuteScripts() const | 75 bool PageDebuggerAgent::canExecuteScripts() const |
| 80 { | 76 { |
| 81 ScriptController& scriptController = m_pageAgent->inspectedFrame()->script()
; | 77 ScriptController& scriptController = m_pageAgent->inspectedFrame()->script()
; |
| 82 return scriptController.canExecuteScripts(NotAboutToExecuteScript); | 78 return scriptController.canExecuteScripts(NotAboutToExecuteScript); |
| 83 } | 79 } |
| 84 | 80 |
| 85 void PageDebuggerAgent::enable(ErrorString* errorString) | 81 void PageDebuggerAgent::enable(ErrorString* errorString) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 114 void PageDebuggerAgent::muteConsole() | 110 void PageDebuggerAgent::muteConsole() |
| 115 { | 111 { |
| 116 FrameConsole::mute(); | 112 FrameConsole::mute(); |
| 117 } | 113 } |
| 118 | 114 |
| 119 void PageDebuggerAgent::unmuteConsole() | 115 void PageDebuggerAgent::unmuteConsole() |
| 120 { | 116 { |
| 121 FrameConsole::unmute(); | 117 FrameConsole::unmute(); |
| 122 } | 118 } |
| 123 | 119 |
| 124 void PageDebuggerAgent::overlayResumed() | |
| 125 { | |
| 126 ErrorString error; | |
| 127 resume(&error); | |
| 128 } | |
| 129 | |
| 130 void PageDebuggerAgent::overlaySteppedOver() | |
| 131 { | |
| 132 ErrorString error; | |
| 133 stepOver(&error); | |
| 134 } | |
| 135 | |
| 136 InjectedScript PageDebuggerAgent::defaultInjectedScript() | 120 InjectedScript PageDebuggerAgent::defaultInjectedScript() |
| 137 { | 121 { |
| 138 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedF
rame()); | 122 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedF
rame()); |
| 139 return m_v8DebuggerAgent->injectedScriptManager()->injectedScriptFor(scriptS
tate); | 123 return m_v8DebuggerAgent->injectedScriptManager()->injectedScriptFor(scriptS
tate); |
| 140 } | 124 } |
| 141 | 125 |
| 142 void PageDebuggerAgent::didStartProvisionalLoad(LocalFrame* frame) | 126 void PageDebuggerAgent::didStartProvisionalLoad(LocalFrame* frame) |
| 143 { | 127 { |
| 144 if (frame == m_pageAgent->inspectedFrame()) { | 128 if (frame == m_pageAgent->inspectedFrame()) { |
| 145 ErrorString error; | 129 ErrorString error; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 RefPtrWillBeRawPtr<LocalFrame> protect(frame); | 176 RefPtrWillBeRawPtr<LocalFrame> protect(frame); |
| 193 InspectorDebuggerAgent::runScript(errorString, scriptId, executionContextId,
objectGroup, doNotPauseOnExceptionsAndMuteConsole, result, exceptionDetails); | 177 InspectorDebuggerAgent::runScript(errorString, scriptId, executionContextId,
objectGroup, doNotPauseOnExceptionsAndMuteConsole, result, exceptionDetails); |
| 194 | 178 |
| 195 if (frame) | 179 if (frame) |
| 196 InspectorInstrumentation::didEvaluateScript(cookie); | 180 InspectorInstrumentation::didEvaluateScript(cookie); |
| 197 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update
Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data(
)); | 181 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update
Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data(
)); |
| 198 | 182 |
| 199 } | 183 } |
| 200 | 184 |
| 201 } // namespace blink | 185 } // namespace blink |
| OLD | NEW |