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

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

Issue 2723273002: [inspector] introduced Debugger.scheduleStepIntoAsync (Closed)
Patch Set: fixed 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
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 f96aaa57b5ea0a2f33efea94994874f08c19b938..af9cb8797a453bbd4e1d09b367f2c5c134d791f1 100644
--- a/src/inspector/v8-debugger-agent-impl.cc
+++ b/src/inspector/v8-debugger-agent-impl.cc
@@ -748,6 +748,28 @@ Response V8DebuggerAgentImpl::stepOut() {
return Response::OK();
}
+void V8DebuggerAgentImpl::scheduleStepIntoAsync(
+ std::unique_ptr<ScheduleStepIntoAsyncCallback> callback) {
+ if (!isPaused()) {
+ callback->sendFailure(Response::Error(kDebuggerNotPaused));
+ return;
+ }
+ if (m_stepIntoAsyncCallback) {
+ m_stepIntoAsyncCallback->sendFailure(Response::Error(
+ "Current scheduled step into async was overriden with new one."));
+ }
+ m_stepIntoAsyncCallback = std::move(callback);
+}
+
+bool V8DebuggerAgentImpl::shouldBreakInScheduledAsyncTask() {
+ if (!m_stepIntoAsyncCallback) return false;
+ m_stepIntoAsyncCallback->sendSuccess();
+ m_stepIntoAsyncCallback.reset();
+ m_scheduledDebuggerStep = NoStep;
+ v8::debug::ClearStepping(m_isolate);
+ return true;
+}
+
Response V8DebuggerAgentImpl::setPauseOnExceptions(
const String16& stringPauseState) {
if (!enabled()) return Response::Error(kDebuggerNotEnabled);
@@ -1238,6 +1260,12 @@ void V8DebuggerAgentImpl::didPause(int contextId,
breakAuxData->setArray("reasons", std::move(reasons));
}
+ if (m_stepIntoAsyncCallback) {
+ m_stepIntoAsyncCallback->sendFailure(
+ Response::Error("No async task was scheduled."));
dgozman 2017/03/03 19:47:06 No async tasks were scheduled before pause.
kozy 2017/03/03 23:14:02 Done.
+ m_stepIntoAsyncCallback.reset();
+ }
+
std::unique_ptr<Array<CallFrame>> protocolCallFrames;
Response response = currentCallFrames(&protocolCallFrames);
if (!response.isSuccess()) protocolCallFrames = Array<CallFrame>::create();

Powered by Google App Engine
This is Rietveld 408576698