Commit 63811e86 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[inspector] Add `executionContextId` to `Runtime.inspectRequested`.

This properly threads through the `executionContextId` to the request
reported to the DevTools front-end, similarly to how we already report
the `executionContextId` as part of `Runtime.bindingCalled`.

Bug: chromium:1231521
Change-Id: I0a003041aedd8ec661d1b07cdddbcd1f2866a99f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3046187
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75875}
parent 970fa887
......@@ -1672,6 +1672,8 @@ domain Runtime
parameters
RemoteObject object
object hints
# Identifier of the context where the call was made.
experimental optional ExecutionContextId executionContextId
# This domain is deprecated.
deprecated domain Schema
......
......@@ -591,8 +591,8 @@ static void inspectImpl(const v8::FunctionCallbackInfo<v8::Value>& info,
hints->setBoolean("queryObjects", true);
}
if (V8InspectorSessionImpl* session = helper.session(sessionId)) {
session->runtimeAgent()->inspect(std::move(wrappedObject),
std::move(hints));
session->runtimeAgent()->inspect(std::move(wrappedObject), std::move(hints),
helper.contextId());
}
}
......
......@@ -915,9 +915,10 @@ void V8RuntimeAgentImpl::reportExecutionContextDestroyed(
void V8RuntimeAgentImpl::inspect(
std::unique_ptr<protocol::Runtime::RemoteObject> objectToInspect,
std::unique_ptr<protocol::DictionaryValue> hints) {
std::unique_ptr<protocol::DictionaryValue> hints, int executionContextId) {
if (m_enabled)
m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints));
m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints),
executionContextId);
}
void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) {
......
......@@ -129,7 +129,8 @@ class V8RuntimeAgentImpl : public protocol::Runtime::Backend {
void reportExecutionContextCreated(InspectedContext*);
void reportExecutionContextDestroyed(InspectedContext*);
void inspect(std::unique_ptr<protocol::Runtime::RemoteObject> objectToInspect,
std::unique_ptr<protocol::DictionaryValue> hints);
std::unique_ptr<protocol::DictionaryValue> hints,
int executionContextId);
void messageAdded(V8ConsoleMessage*);
bool enabled() const { return m_enabled; }
......
......@@ -40,6 +40,7 @@ Running test: testInspect
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -53,6 +54,7 @@ Running test: testInspect
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -65,6 +67,7 @@ Running test: testInspect
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -77,6 +80,7 @@ Running test: testInspect
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
copyToClipboard : true
}
......@@ -97,6 +101,7 @@ Running test: testInspect
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -123,6 +128,7 @@ Running test: testQueryObjects
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
queryObjects : true
}
......@@ -138,6 +144,7 @@ Is Promise.prototype: true
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
queryObjects : true
}
......@@ -153,6 +160,7 @@ Is Promise.prototype: true
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
queryObjects : true
}
......@@ -168,6 +176,7 @@ Is p: true
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
queryObjects : true
}
......
......@@ -92,6 +92,7 @@ inspectRequested from 1
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -106,6 +107,7 @@ inspectRequested from 1
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -120,6 +122,7 @@ inspectRequested from 2
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -134,6 +137,7 @@ inspectRequested from 2
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -148,6 +152,7 @@ inspectRequested from 1
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -185,6 +190,7 @@ inspectRequested from 2
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......@@ -200,6 +206,7 @@ inspectRequested from 2
{
method : Runtime.inspectRequested
params : {
executionContextId : <executionContextId>
hints : {
}
object : {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment