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

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

Issue 2655253004: [inspector] introduced stepIntoAsync for chained callbacks (Closed)
Patch Set: fixed async/await and added tests Created 3 years, 10 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-agent-impl.h ('k') | src/js/promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger-agent-impl.cc
diff --git a/src/inspector/v8-debugger-agent-impl.cc b/src/inspector/v8-debugger-agent-impl.cc
index 7de46a1787818170d3e91cd0902a0b2f977ecfcf..98ef28803cd68e2bcde63e9f8af4038eed3101d8 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -614,14 +614,6 @@ void V8DebuggerAgentImpl::schedulePauseOnNextStatement(
pushBreakDetails(breakReason, std::move(data));
}
-void V8DebuggerAgentImpl::schedulePauseOnNextStatementIfSteppingInto() {
- DCHECK(enabled());
- if (m_scheduledDebuggerStep != StepInto || m_javaScriptPauseScheduled ||
- isPaused())
- return;
- m_debugger->setPauseOnNextStatement(true);
-}
-
void V8DebuggerAgentImpl::cancelPauseOnNextStatement() {
if (m_javaScriptPauseScheduled || isPaused()) return;
popBreakDetails();
@@ -666,6 +658,13 @@ Response V8DebuggerAgentImpl::stepInto() {
return Response::OK();
}
+Response V8DebuggerAgentImpl::stepIntoAsync() {
+ if (!isPaused()) return Response::Error(kDebuggerNotPaused);
+ m_scheduledDebuggerStep = NoStep;
+ m_session->releaseObjectGroup(kBacktraceObjectGroup);
+ return m_debugger->stepIntoScheduledCallback();
+}
+
Response V8DebuggerAgentImpl::stepOut() {
if (!isPaused()) return Response::Error(kDebuggerNotPaused);
m_scheduledDebuggerStep = StepOut;
@@ -845,8 +844,11 @@ Response V8DebuggerAgentImpl::setBlackboxedRanges(
void V8DebuggerAgentImpl::willExecuteScript(int scriptId) {
changeJavaScriptRecursionLevel(+1);
- if (m_scheduledDebuggerStep != StepInto) return;
- schedulePauseOnNextStatementIfSteppingInto();
+ if (m_scheduledDebuggerStep != StepInto || m_javaScriptPauseScheduled ||
+ isPaused()) {
+ return;
+ }
+ m_debugger->setPauseOnNextStatement(true);
}
void V8DebuggerAgentImpl::didExecuteScript() {
@@ -1158,6 +1160,11 @@ void V8DebuggerAgentImpl::didPause(int contextId,
breakAuxData->setArray("reasons", std::move(reasons));
}
+ if (m_debugger->stepIntoScheduledCallbackAvailable()) {
+ if (!breakAuxData) breakAuxData = protocol::DictionaryValue::create();
+ breakAuxData->setBoolean("stepIntoAsyncAvailable", true);
+ }
+
std::unique_ptr<Array<CallFrame>> protocolCallFrames;
Response response = currentCallFrames(&protocolCallFrames);
if (!response.isSuccess()) protocolCallFrames = Array<CallFrame>::create();
@@ -1193,6 +1200,13 @@ void V8DebuggerAgentImpl::breakProgram(
m_breakReason.swap(currentScheduledReason);
}
+void V8DebuggerAgentImpl::breakProgramIfSteppingInto(
+ const String16& breakReason,
+ std::unique_ptr<protocol::DictionaryValue> data) {
+ if (m_scheduledDebuggerStep != StepInto) return;
+ breakProgram(breakReason, std::move(data));
+}
+
void V8DebuggerAgentImpl::breakProgramOnException(
const String16& breakReason,
std::unique_ptr<protocol::DictionaryValue> data) {
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.h ('k') | src/js/promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698