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

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

Issue 2882213004: [inspector] move continueToLocation implementation to debugger (Closed)
Patch Set: ac 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
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index a65cc738e34f2acc4e3f3fae9dc9acb847a1bac4..e9204a04d41972a3122e349f350a55550beb6802 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,36 @@ 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);
+ // TODO(kozyatinskiy): Return actual line and column number.
+ return Response::OK();
+ } else {
+ return Response::Error("Cannot continue to specified location");
+ }
+}
+
+void V8Debugger::clearContinueToLocation() {
+ if (m_continueToLocationBreakpointId.length()) {
+ removeBreakpoint(m_continueToLocationBreakpointId);
+ m_continueToLocationBreakpointId = String16();
+ }
+}
+
Response V8Debugger::setScriptSource(
const String16& sourceID, v8::Local<v8::String> newSource, bool dryRun,
Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails,
@@ -567,6 +598,7 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
hitBreakpointNumber->Int32Value(debuggerContext()).FromJust()));
}
}
+ clearContinueToLocation();
m_pausedContext = pausedContext;
m_executionState = executionState;
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698