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

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

Issue 2102453003: [DevTools] Move collectionEntries to internalProperties in protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 e7f9bed382349bc0b32e6472c52243f76e168f2c..4f22289247ef09d56bb4378ed1934a06a6181f6e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -46,7 +46,6 @@ v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> contex
setFunctionProperty(context, injectedScriptHost, "formatAccessorsAsProperties", V8InjectedScriptHost::formatAccessorsAsProperties, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "isTypedArray", V8InjectedScriptHost::isTypedArrayCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "subtype", V8InjectedScriptHost::subtypeCallback, debuggerExternal);
- setFunctionProperty(context, injectedScriptHost, "collectionEntries", V8InjectedScriptHost::collectionEntriesCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "getInternalProperties", V8InjectedScriptHost::getInternalPropertiesCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "suppressWarningsAndCallFunction", V8InjectedScriptHost::suppressWarningsAndCallFunctionCallback, debuggerExternal);
setFunctionProperty(context, injectedScriptHost, "bind", V8InjectedScriptHost::bindCallback, debuggerExternal);
@@ -55,6 +54,11 @@ 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"));
+}
+
void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (info.Length() < 1 || !info[0]->IsObject())
@@ -127,6 +131,13 @@ 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;
+ }
+ }
String16 subtype = unwrapDebugger(info)->client()->valueSubtype(value);
if (!subtype.isEmpty()) {
info.GetReturnValue().Set(toV8String(isolate, subtype));
@@ -134,23 +145,12 @@ void V8InjectedScriptHost::subtypeCallback(const v8::FunctionCallbackInfo<v8::Va
}
}
-void V8InjectedScriptHost::collectionEntriesCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- if (info.Length() < 1 || !info[0]->IsObject())
- return;
-
- v8::Local<v8::Object> object = info[0].As<v8::Object>();
- info.GetReturnValue().Set(unwrapDebugger(info)->collectionEntries(object));
-}
-
void V8InjectedScriptHost::getInternalPropertiesCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- if (info.Length() < 1 || !info[0]->IsObject())
+ if (info.Length() < 1)
return;
-
- v8::Local<v8::Object> object = info[0].As<v8::Object>();
v8::Local<v8::Array> properties;
- if (v8::Debug::GetInternalProperties(info.GetIsolate(), object).ToLocal(&properties))
+ if (unwrapDebugger(info)->internalProperties(info.GetIsolate()->GetCurrentContext(), info[0]).ToLocal(&properties))
info.GetReturnValue().Set(properties);
}

Powered by Google App Engine
This is Rietveld 408576698