| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, true); | 189 m_state->setBoolean(DebuggerAgentState::debuggerEnabled, true); |
| 190 debugger().debuggerAgentEnabled(); | 190 debugger().debuggerAgentEnabled(); |
| 191 | 191 |
| 192 std::vector<V8DebuggerParsedScript> compiledScripts; | 192 std::vector<V8DebuggerParsedScript> compiledScripts; |
| 193 debugger().getCompiledScripts(m_session->contextGroupId(), compiledScripts); | 193 debugger().getCompiledScripts(m_session->contextGroupId(), compiledScripts); |
| 194 for (size_t i = 0; i < compiledScripts.size(); i++) | 194 for (size_t i = 0; i < compiledScripts.size(); i++) |
| 195 didParseSource(compiledScripts[i]); | 195 didParseSource(compiledScripts[i]); |
| 196 | 196 |
| 197 // FIXME(WK44513): breakpoints activated flag should be synchronized between
all front-ends | 197 // FIXME(WK44513): breakpoints activated flag should be synchronized between
all front-ends |
| 198 debugger().setBreakpointsActivated(true); | 198 debugger().setBreakpointsActivated(true); |
| 199 m_session->changeInstrumentationCounter(+1); | |
| 200 } | 199 } |
| 201 | 200 |
| 202 bool V8DebuggerAgentImpl::enabled() | 201 bool V8DebuggerAgentImpl::enabled() |
| 203 { | 202 { |
| 204 return m_enabled; | 203 return m_enabled; |
| 205 } | 204 } |
| 206 | 205 |
| 207 void V8DebuggerAgentImpl::enable(ErrorString* errorString) | 206 void V8DebuggerAgentImpl::enable(ErrorString* errorString) |
| 208 { | 207 { |
| 209 if (enabled()) | 208 if (enabled()) |
| 210 return; | 209 return; |
| 211 | 210 |
| 212 if (!m_session->client()->canExecuteScripts()) { | 211 if (!m_session->client()->canExecuteScripts()) { |
| 213 *errorString = "Script execution is prohibited"; | 212 *errorString = "Script execution is prohibited"; |
| 214 return; | 213 return; |
| 215 } | 214 } |
| 216 | 215 |
| 217 enable(); | 216 enable(); |
| 218 } | 217 } |
| 219 | 218 |
| 220 void V8DebuggerAgentImpl::disable(ErrorString*) | 219 void V8DebuggerAgentImpl::disable(ErrorString*) |
| 221 { | 220 { |
| 222 if (!enabled()) | 221 if (!enabled()) |
| 223 return; | 222 return; |
| 224 m_session->changeInstrumentationCounter(-1); | |
| 225 | 223 |
| 226 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); | 224 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); |
| 227 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); | 225 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); |
| 228 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); | 226 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); |
| 229 | 227 |
| 230 if (!m_pausedContext.IsEmpty()) | 228 if (!m_pausedContext.IsEmpty()) |
| 231 debugger().continueProgram(); | 229 debugger().continueProgram(); |
| 232 debugger().debuggerAgentDisabled(); | 230 debugger().debuggerAgentDisabled(); |
| 233 m_pausedContext.Reset(); | 231 m_pausedContext.Reset(); |
| 234 JavaScriptCallFrames emptyCallFrames; | 232 JavaScriptCallFrames emptyCallFrames; |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 { | 1295 { |
| 1298 if (!enabled()) | 1296 if (!enabled()) |
| 1299 return; | 1297 return; |
| 1300 m_scheduledDebuggerStep = NoStep; | 1298 m_scheduledDebuggerStep = NoStep; |
| 1301 m_scripts.clear(); | 1299 m_scripts.clear(); |
| 1302 m_blackboxedPositions.clear(); | 1300 m_blackboxedPositions.clear(); |
| 1303 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1301 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1304 } | 1302 } |
| 1305 | 1303 |
| 1306 } // namespace blink | 1304 } // namespace blink |
| OLD | NEW |