Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Unified Diff: src/inspector/v8-debugger.cc

Issue 2882213004: [inspector] move continueToLocation implementation to debugger (Closed)
Patch Set: a Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index a65cc738e34f2acc4e3f3fae9dc9acb847a1bac4..cf7dc2a2e0671d845fc33d89f7c8be1d9c6bdd85 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -194,6 +194,7 @@ void V8Debugger::disable() {
if (--m_enableCount) return;
DCHECK(enabled());
clearBreakpoints();
+ clearContinueToLocation();
m_debuggerScript.Reset();
m_debuggerContext.Reset();
allAsyncTasksCanceled();
@@ -411,6 +412,35 @@ void V8Debugger::scheduleStepIntoAsync(
m_stepIntoAsyncCallback = std::move(callback);
}
+Response V8Debugger::continueToLocation(
+ int targetContextGroupId,
+ std::unique_ptr<protocol::Debugger::Location> location) {
+ DCHECK(isPaused());
+ DCHECK(!m_executionState.IsEmpty());
+ DCHECK(targetContextGroupId);
+ m_targetContextGroupId = targetContextGroupId;
+ ScriptBreakpoint breakpoint(location->getScriptId(),
+ location->getLineNumber(),
+ location->getColumnNumber(0), String16());
+ int lineNumber = 0;
+ int columnNumber = 0;
+ m_continueToLocationBreakpointId =
+ setBreakpoint(breakpoint, &lineNumber, &columnNumber);
+ if (!m_continueToLocationBreakpointId.isEmpty()) {
+ continueProgram(targetContextGroupId);
+ return Response::OK();
+ } else {
+ return Response::Error("No breakpoint by passed location");
dgozman 2017/05/16 18:51:04 Cannot continue to specified location
kozy 2017/05/16 19:01:16 Done.
+ }
+}
+
+void V8Debugger::clearContinueToLocation() {
+ if (m_continueToLocationBreakpointId.length()) {
+ removeBreakpoint(m_continueToLocationBreakpointId);
+ }
+ m_continueToLocationBreakpointId = String16();
dgozman 2017/05/16 18:51:04 Move this under if?
kozy 2017/05/16 19:01:16 Done.
+}
+
Response V8Debugger::setScriptSource(
const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun,
Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails,
@@ -567,6 +597,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
hitBreakpointNumber->Int32Value(debuggerContext()).FromJust()));
}
}
+ clearContinueToLocation();
m_pausedContext = pausedContext;
m_executionState = executionState;

Powered by Google App Engine
This is Rietveld 408576698