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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp

Issue 2122423002: [DevTools] Remove functionDetails from protocol.json (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-generator-details-from-protocol
Patch Set: a Created 4 years, 5 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: third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
index 1ef3bbbaee9ea0998a92926ad33ebb55a2607dbc..4ab9da602e8f81781e1db9a829ba3c5e89ea3312 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -64,6 +64,16 @@ v8::Local<v8::Private> V8InjectedScriptHost::internalLocationPrivate(v8::Isolate
return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8InjectedScriptHost#internalLocation"));
}
+v8::Local<v8::Private> V8InjectedScriptHost::internalScopesPrivate(v8::Isolate* isolate)
+{
+ return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8InjectedScriptHost#internalScopes"));
+}
+
+v8::Local<v8::Private> V8InjectedScriptHost::internalScopePrivate(v8::Isolate* isolate)
+{
+ return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8InjectedScriptHost#internalScope"));
+}
+
void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
@@ -100,6 +110,25 @@ void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Va
v8::Isolate* isolate = info.GetIsolate();
v8::Local<v8::Value> value = info[0];
+ if (value->IsObject()) {
+ v8::Local<v8::Object> obj = value.As<v8::Object>();
+ if (obj->HasPrivate(isolate->GetCurrentContext(), internalEntryPrivate(isolate)).FromMaybe(false)) {
+ info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#entry"));
+ return;
+ }
+ if (obj->HasPrivate(isolate->GetCurrentContext(), internalLocationPrivate(isolate)).FromMaybe(false)) {
+ info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#location"));
+ return;
+ }
+ if (obj->HasPrivate(isolate->GetCurrentContext(), internalScopesPrivate(isolate)).FromMaybe(false)) {
+ info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#scopes"));
+ return;
+ }
+ if (obj->HasPrivate(isolate->GetCurrentContext(), internalScopePrivate(isolate)).FromMaybe(false)) {
+ info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#scope"));
+ return;
+ }
+ }
if (value->IsArray() || value->IsTypedArray() || value->IsArgumentsObject()) {
info.GetReturnValue().Set(toV8StringInternalized(isolate, "array"));
return;
@@ -136,17 +165,6 @@ void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Va
info.GetReturnValue().Set(toV8StringInternalized(isolate, "proxy"));
return;
}
- if (value->IsObject()) {
- v8::Local<v8::Object> obj = value.As<v8::Object>();
- if (obj->HasPrivate(isolate->GetCurrentContext(), internalEntryPrivate(isolate)).FromMaybe(false)) {
- info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#entry"));
- return;
- }
- if (obj->HasPrivate(isolate->GetCurrentContext(), internalLocationPrivate(isolate)).FromMaybe(false)) {
- info.GetReturnValue().Set(toV8StringInternalized(isolate, "internal#location"));
- return;
- }
- }
String16 subtype = unwrapDebugger(info)->client()->valueSubtype(value);
if (!subtype.isEmpty()) {
info.GetReturnValue().Set(toV8String(isolate, subtype));

Powered by Google App Engine
This is Rietveld 408576698