Web Inspector: Generate Previews more often for RemoteObject interaction
https://bugs.webkit.org/show_bug.cgi?id=141875
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-02-21
Reviewed by Timothy Hatcher.
Source/JavaScriptCore:
* inspector/protocol/Runtime.json:
Add generatePreview to getProperties.
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::getProperties):
(Inspector::InjectedScript::getInternalProperties):
* inspector/InjectedScript.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getProperties):
* inspector/agents/InspectorRuntimeAgent.h:
Plumb the generatePreview boolean through to the injected script.
* inspector/InjectedScriptSource.js:
Add generatePreview for getProperties.
Fix callFunctionOn to generatePreviews if asked.
Source/WebInspectorUI:
* UserInterface/Models/PropertyDescriptor.js:
(WebInspector.PropertyDescriptor.fromPayload):
Fix InternalPropertyDescriptor ingestion. There was no ".internal"
property on these objects, so take a flag.
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype._getPropertyDescriptors):
Fix InternalPropertyDescriptor ingestion by specifying during
importing the internal properties. Also, get previews.
(WebInspector.RemoteObject.prototype.callFunction):
Always get previews when using callFunctionOn.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@180483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/inspector/InjectedScript.cpp b/Source/JavaScriptCore/inspector/InjectedScript.cpp
index 24e80fd..b87e0cc 100644
--- a/Source/JavaScriptCore/inspector/InjectedScript.cpp
+++ b/Source/JavaScriptCore/inspector/InjectedScript.cpp
@@ -107,12 +107,13 @@
*result = BindingTraits<Inspector::Protocol::Debugger::FunctionDetails>::runtimeCast(WTF::move(resultValue));
}
-void InjectedScript::getProperties(ErrorString& errorString, const String& objectId, bool ownProperties, bool ownAndGetterProperties, RefPtr<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
+void InjectedScript::getProperties(ErrorString& errorString, const String& objectId, bool ownProperties, bool ownAndGetterProperties, bool generatePreview, RefPtr<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>* properties)
{
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler());
function.appendArgument(objectId);
function.appendArgument(ownProperties);
function.appendArgument(ownAndGetterProperties);
+ function.appendArgument(generatePreview);
RefPtr<InspectorValue> result;
makeCall(function, &result);
@@ -124,10 +125,11 @@
*properties = BindingTraits<Array<Inspector::Protocol::Runtime::PropertyDescriptor>>::runtimeCast(WTF::move(result));
}
-void InjectedScript::getInternalProperties(ErrorString& errorString, const String& objectId, RefPtr<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>* properties)
+void InjectedScript::getInternalProperties(ErrorString& errorString, const String& objectId, bool generatePreview, RefPtr<Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>* properties)
{
Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getInternalProperties"), inspectorEnvironment()->functionCallHandler());
function.appendArgument(objectId);
+ function.appendArgument(generatePreview);
RefPtr<InspectorValue> result;
makeCall(function, &result);