| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 static PassOwnPtr<protocol::Debugger::Location> buildProtocolLocation(const Stri
ng16& scriptId, int lineNumber, int columnNumber) | 150 static PassOwnPtr<protocol::Debugger::Location> buildProtocolLocation(const Stri
ng16& scriptId, int lineNumber, int columnNumber) |
| 151 { | 151 { |
| 152 return protocol::Debugger::Location::create() | 152 return protocol::Debugger::Location::create() |
| 153 .setScriptId(scriptId) | 153 .setScriptId(scriptId) |
| 154 .setLineNumber(lineNumber) | 154 .setLineNumber(lineNumber) |
| 155 .setColumnNumber(columnNumber).build(); | 155 .setColumnNumber(columnNumber).build(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 V8DebuggerAgentImpl::V8DebuggerAgentImpl(V8InspectorSessionImpl* session) | 158 V8DebuggerAgentImpl::V8DebuggerAgentImpl(V8InspectorSessionImpl* session, protoc
ol::Frontend::Debugger* frontend, protocol::DictionaryValue* state) |
| 159 : m_debugger(session->debugger()) | 159 : m_debugger(session->debugger()) |
| 160 , m_session(session) | 160 , m_session(session) |
| 161 , m_enabled(false) | 161 , m_enabled(false) |
| 162 , m_state(nullptr) | 162 , m_state(state) |
| 163 , m_frontend(nullptr) | 163 , m_frontend(frontend) |
| 164 , m_isolate(m_debugger->isolate()) | 164 , m_isolate(m_debugger->isolate()) |
| 165 , m_breakReason(protocol::Debugger::Paused::ReasonEnum::Other) | 165 , m_breakReason(protocol::Debugger::Paused::ReasonEnum::Other) |
| 166 , m_scheduledDebuggerStep(NoStep) | 166 , m_scheduledDebuggerStep(NoStep) |
| 167 , m_skipNextDebuggerStepOut(false) | 167 , m_skipNextDebuggerStepOut(false) |
| 168 , m_javaScriptPauseScheduled(false) | 168 , m_javaScriptPauseScheduled(false) |
| 169 , m_steppingFromFramework(false) | 169 , m_steppingFromFramework(false) |
| 170 , m_pausingOnNativeEvent(false) | 170 , m_pausingOnNativeEvent(false) |
| 171 , m_skippedStepFrameCount(0) | 171 , m_skippedStepFrameCount(0) |
| 172 , m_recursionLevelForStepOut(0) | 172 , m_recursionLevelForStepOut(0) |
| 173 , m_recursionLevelForStepFrame(0) | 173 , m_recursionLevelForStepFrame(0) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 void V8DebuggerAgentImpl::internalSetAsyncCallStackDepth(int depth) | 265 void V8DebuggerAgentImpl::internalSetAsyncCallStackDepth(int depth) |
| 266 { | 266 { |
| 267 if (depth <= 0) { | 267 if (depth <= 0) { |
| 268 m_maxAsyncCallStackDepth = 0; | 268 m_maxAsyncCallStackDepth = 0; |
| 269 allAsyncTasksCanceled(); | 269 allAsyncTasksCanceled(); |
| 270 } else { | 270 } else { |
| 271 m_maxAsyncCallStackDepth = depth; | 271 m_maxAsyncCallStackDepth = depth; |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 void V8DebuggerAgentImpl::setInspectorState(protocol::DictionaryValue* state) | |
| 276 { | |
| 277 m_state = state; | |
| 278 } | |
| 279 | |
| 280 void V8DebuggerAgentImpl::clearFrontend() | |
| 281 { | |
| 282 ErrorString error; | |
| 283 disable(&error); | |
| 284 DCHECK(m_frontend); | |
| 285 m_frontend = nullptr; | |
| 286 } | |
| 287 | |
| 288 void V8DebuggerAgentImpl::restore() | 275 void V8DebuggerAgentImpl::restore() |
| 289 { | 276 { |
| 290 DCHECK(!m_enabled); | 277 DCHECK(!m_enabled); |
| 291 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false)) | 278 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false)) |
| 292 return; | 279 return; |
| 293 if (!m_session->client()->canExecuteScripts()) | 280 if (!m_session->client()->canExecuteScripts()) |
| 294 return; | 281 return; |
| 295 | 282 |
| 296 enable(); | 283 enable(); |
| 297 ErrorString error; | 284 ErrorString error; |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 if (!enabled()) | 1446 if (!enabled()) |
| 1460 return; | 1447 return; |
| 1461 m_scheduledDebuggerStep = NoStep; | 1448 m_scheduledDebuggerStep = NoStep; |
| 1462 m_scripts.clear(); | 1449 m_scripts.clear(); |
| 1463 m_blackboxedPositions.clear(); | 1450 m_blackboxedPositions.clear(); |
| 1464 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1451 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1465 allAsyncTasksCanceled(); | 1452 allAsyncTasksCanceled(); |
| 1466 } | 1453 } |
| 1467 | 1454 |
| 1468 } // namespace blink | 1455 } // namespace blink |
| OLD | NEW |