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

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..d4083f60a19ecbd5e954ad2099a035598aec0ec6 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -8,6 +8,7 @@
#include "platform/v8_inspector/InjectedScriptNative.h"
#include "platform/v8_inspector/V8Compat.h"
#include "platform/v8_inspector/V8DebuggerImpl.h"
+#include "platform/v8_inspector/V8InternalValueType.h"
#include "platform/v8_inspector/V8StringUtil.h"
#include "platform/v8_inspector/public/V8DebuggerClient.h"
@@ -54,16 +55,6 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> contex
return injectedScriptHost;
}
-v8::Local<v8::Private> V8InjectedScriptHost::internalEntryPrivate(v8::Isolate* isolate)
-{
- return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8InjectedScriptHost#internalEntry"));
-}
-
-v8::Local<v8::Private> V8InjectedScriptHost::internalLocationPrivate(v8::Isolate* isolate)
-{
- return v8::Private::ForApi(isolate, toV8StringInternalized(isolate, "V8InjectedScriptHost#internalLocation"));
-}
-
void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
@@ -100,6 +91,13 @@ 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::Value> internalType = v8InternalValueTypeFrom(isolate->GetCurrentContext(), v8::Local<v8::Object>::Cast(value));
+ if (internalType->IsString()) {
+ info.GetReturnValue().Set(internalType);
+ return;
+ }
+ }
if (value->IsArray() || value->IsTypedArray() || value->IsArgumentsObject()) {
info.GetReturnValue().Set(toV8StringInternalized(isolate, "array"));
return;
@@ -136,17 +134,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