| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 m_enabled = true; | 197 m_enabled = true; |
| 198 debugger().debuggerAgentEnabled(); | 198 debugger().debuggerAgentEnabled(); |
| 199 | 199 |
| 200 protocol::Vector<V8DebuggerParsedScript> compiledScripts; | 200 protocol::Vector<V8DebuggerParsedScript> compiledScripts; |
| 201 debugger().getCompiledScripts(m_session->contextGroupId(), compiledScripts); | 201 debugger().getCompiledScripts(m_session->contextGroupId(), compiledScripts); |
| 202 for (size_t i = 0; i < compiledScripts.size(); i++) | 202 for (size_t i = 0; i < compiledScripts.size(); i++) |
| 203 didParseSource(compiledScripts[i]); | 203 didParseSource(compiledScripts[i]); |
| 204 | 204 |
| 205 // FIXME(WK44513): breakpoints activated flag should be synchronized between
all front-ends | 205 // FIXME(WK44513): breakpoints activated flag should be synchronized between
all front-ends |
| 206 debugger().setBreakpointsActivated(true); | 206 debugger().setBreakpointsActivated(true); |
| 207 m_session->changeInstrumentationCounter(+1); |
| 207 } | 208 } |
| 208 | 209 |
| 209 bool V8DebuggerAgentImpl::enabled() | 210 bool V8DebuggerAgentImpl::enabled() |
| 210 { | 211 { |
| 211 return m_enabled; | 212 return m_enabled; |
| 212 } | 213 } |
| 213 | 214 |
| 214 void V8DebuggerAgentImpl::enable(ErrorString*) | 215 void V8DebuggerAgentImpl::enable(ErrorString*) |
| 215 { | 216 { |
| 216 if (enabled()) | 217 if (enabled()) |
| 217 return; | 218 return; |
| 218 | 219 |
| 219 enable(); | 220 enable(); |
| 220 | 221 |
| 221 ASSERT(m_frontend); | 222 ASSERT(m_frontend); |
| 222 } | 223 } |
| 223 | 224 |
| 224 void V8DebuggerAgentImpl::disable(ErrorString*) | 225 void V8DebuggerAgentImpl::disable(ErrorString*) |
| 225 { | 226 { |
| 226 if (!enabled()) | 227 if (!enabled()) |
| 227 return; | 228 return; |
| 229 m_session->changeInstrumentationCounter(-1); |
| 228 | 230 |
| 229 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); | 231 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); |
| 230 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); | 232 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); |
| 231 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); | 233 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); |
| 232 | 234 |
| 233 if (!m_pausedContext.IsEmpty()) | 235 if (!m_pausedContext.IsEmpty()) |
| 234 debugger().continueProgram(); | 236 debugger().continueProgram(); |
| 235 debugger().debuggerAgentDisabled(); | 237 debugger().debuggerAgentDisabled(); |
| 236 m_pausedContext.Reset(); | 238 m_pausedContext.Reset(); |
| 237 JavaScriptCallFrames emptyCallFrames; | 239 JavaScriptCallFrames emptyCallFrames; |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 if (!enabled()) | 1449 if (!enabled()) |
| 1448 return; | 1450 return; |
| 1449 m_scheduledDebuggerStep = NoStep; | 1451 m_scheduledDebuggerStep = NoStep; |
| 1450 m_scripts.clear(); | 1452 m_scripts.clear(); |
| 1451 m_blackboxedPositions.clear(); | 1453 m_blackboxedPositions.clear(); |
| 1452 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1454 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1453 allAsyncTasksCanceled(); | 1455 allAsyncTasksCanceled(); |
| 1454 } | 1456 } |
| 1455 | 1457 |
| 1456 } // namespace blink | 1458 } // namespace blink |
| OLD | NEW |