Commit 954b3a77 authored by Alfonso Castaño's avatar Alfonso Castaño Committed by Commit Bot

Prepare for moving object description generation to blink (ValueMirror)

This CL is a preliminary work to move the description generation of objects that are not V8 specific to the Embedder. Until now, the description for Nodes and Trusted Types was generated by V8 what was problematic, since Blink (not V8) is who has access to the information required for the description.
Once the refactoring is complete the existing descriptionForNode and descriptionForTrustedType can be deleted from V8.


Corresponding Blink CL: https://chromium-review.googlesource.com/c/chromium/src/+/2502589
Follow-up V8 CL: https://chromium-review.googlesource.com/c/v8/v8/+/2502869

Bug: chromium:1048143
Change-Id: Ia30c207697d7355bf3f8b27f7494349ca41266e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2502342Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Cr-Commit-Position: refs/heads/master@{#70870}
parent aafa16d6
......@@ -181,6 +181,10 @@ class V8_EXPORT V8InspectorClient {
virtual std::unique_ptr<StringBuffer> valueSubtype(v8::Local<v8::Value>) {
return nullptr;
}
virtual std::unique_ptr<StringBuffer> descriptionForValueSubtype(
v8::Local<v8::Context>, v8::Local<v8::Value>) {
return nullptr;
}
virtual bool formatAccessorsAsProperties(v8::Local<v8::Value>) {
return false;
}
......
......@@ -1754,6 +1754,12 @@ std::unique_ptr<ValueMirror> clientMirror(v8::Local<v8::Context> context,
v8::Local<v8::Value> value,
const String16& subtype) {
// TODO(alph): description and length retrieval should move to embedder.
auto descriptionForValueSubtype =
clientFor(context)->descriptionForValueSubtype(context, value);
if (descriptionForValueSubtype) {
return std::make_unique<ObjectMirror>(
value, subtype, toString16(descriptionForValueSubtype->string()));
}
if (subtype == "node") {
return std::make_unique<ObjectMirror>(value, subtype,
descriptionForNode(context, value));
......
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