From 6f7eeec89d94e6a1caef53ce80a2e60896eb462e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Tue, 22 Oct 2019 14:38:15 +0200 Subject: [PATCH] Introduce 'replMode' flag for Runtime.evaluate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL adds a boolean flag to Runtime.evaluate that allows REPL mode to be enabled. REPL mode hasn't landed in V8 yet, and the internal API for it is still in flux. R=yangguo@chromium.org Bug: chromium:1004193 Change-Id: I281285e225d3fd2dd4175f3dd967d6562459a203 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1866510 Reviewed-by: Yang Guo Reviewed-by: Peter Marshall Commit-Queue: Simon Zünd Cr-Commit-Position: refs/heads/master@{#64470} --- include/js_protocol.pdl | 2 ++ src/inspector/v8-runtime-agent-impl.cc | 2 +- src/inspector/v8-runtime-agent-impl.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 51f3c6f68a..e01932d5dc 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -1257,6 +1257,8 @@ domain Runtime experimental optional TimeDelta timeout # Disable breakpoints during execution. experimental optional boolean disableBreaks + # Reserved flag for future REPL mode support. Setting this flag has currently no effect. + experimental optional boolean replMode returns # Evaluation result. RemoteObject result diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc index 4dfc210edc..74a5c2b6ef 100644 --- a/src/inspector/v8-runtime-agent-impl.cc +++ b/src/inspector/v8-runtime-agent-impl.cc @@ -235,7 +235,7 @@ void V8RuntimeAgentImpl::evaluate( Maybe executionContextId, Maybe returnByValue, Maybe generatePreview, Maybe userGesture, Maybe awaitPromise, Maybe throwOnSideEffect, - Maybe timeout, Maybe disableBreaks, + Maybe timeout, Maybe disableBreaks, Maybe replMode, std::unique_ptr callback) { TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "EvaluateScript"); diff --git a/src/inspector/v8-runtime-agent-impl.h b/src/inspector/v8-runtime-agent-impl.h index 7ecbafd611..c99cfcef19 100644 --- a/src/inspector/v8-runtime-agent-impl.h +++ b/src/inspector/v8-runtime-agent-impl.h @@ -68,6 +68,7 @@ class V8RuntimeAgentImpl : public protocol::Runtime::Backend { Maybe generatePreview, Maybe userGesture, Maybe awaitPromise, Maybe throwOnSideEffect, Maybe timeout, Maybe disableBreaks, + Maybe replMode, std::unique_ptr) override; void awaitPromise(const String16& promiseObjectId, Maybe returnByValue, Maybe generatePreview,