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

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

Issue 1818473002: [DevTools] Move getInternalProperties to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-call-function-on
Patch Set: Created 4 years, 9 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/InjectedScript.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
index b8715126778052f34f60e844c6eda17b9c026681..bf826987b38137408e87ffe035f3638ea1243873 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp
@@ -115,21 +115,6 @@ void InjectedScript::getProperties(ErrorString* errorString, const String16& obj
*properties = Array<PropertyDescriptor>::parse(result.get(), &errors);
}
-void InjectedScript::getInternalProperties(ErrorString* errorString, const String16& objectId, Maybe<Array<InternalPropertyDescriptor>>* properties, Maybe<protocol::Runtime::ExceptionDetails>* exceptionDetails)
-{
- v8::HandleScope handles(m_isolate);
- V8FunctionCall function(m_manager->debugger(), context(), v8Value(), "getInternalProperties");
- function.appendArgument(objectId);
-
- OwnPtr<protocol::Value> result = makeCallWithExceptionDetails(function, exceptionDetails);
- if (exceptionDetails->isJust())
- return;
- protocol::ErrorSupport errors(errorString);
- OwnPtr<Array<InternalPropertyDescriptor>> array = Array<InternalPropertyDescriptor>::parse(result.get(), &errors);
- if (!errors.hasErrors() && array->length() > 0)
- *properties = array.release();
-}
-
void InjectedScript::releaseObject(const String16& objectId)
{
OwnPtr<protocol::Value> parsedObjectId = protocol::parseJSON(objectId);
@@ -226,9 +211,12 @@ PassOwnPtr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(v8::Local<
return protocol::Runtime::RemoteObject::parse(toProtocolValue(context(), r).get(), &errors);
}
-v8::Local<v8::Value> InjectedScript::findObject(const RemoteObjectId& objectId) const
+bool InjectedScript::findObject(ErrorString* errorString, const RemoteObjectId& objectId, v8::Local<v8::Value>* outObject) const
{
- return m_native->objectForId(objectId.id());
+ *outObject = m_native->objectForId(objectId.id());
+ if (outObject->IsEmpty())
+ *errorString = "Could not find object with given id";
+ return !outObject->IsEmpty();
}
String16 InjectedScript::objectGroupName(const RemoteObjectId& objectId) const
@@ -355,11 +343,9 @@ v8::MaybeLocal<v8::Value> InjectedScript::resolveCallArgument(ErrorString* error
*errorString = "Argument should belong to the same JavaScript world as target object";
return v8::MaybeLocal<v8::Value>();
}
- v8::Local<v8::Value> object = findObject(*remoteObjectId);
- if (object.IsEmpty()) {
- *errorString = "Could not find object with given id";
+ v8::Local<v8::Value> object;
+ if (!findObject(errorString, *remoteObjectId, &object))
return v8::MaybeLocal<v8::Value>();
- }
return object;
}
if (callArgument->hasValue()) {

Powered by Google App Engine
This is Rietveld 408576698