Log Message
Unreviewed, rolling out r91668. http://trac.webkit.org/changeset/91668 https://bugs.webkit.org/show_bug.cgi?id=65117
Breaks inspector tests on JSC (Requested by pfeldman on #webkit). Patch by Sheriff Bot <[email protected]> on 2011-07-25 Source/WebCore: * inspector/InjectedScript.cpp: (WebCore::InjectedScript::callFunctionOn): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: (.): * inspector/Inspector.json: * inspector/InspectorRuntimeAgent.cpp: (WebCore::InspectorRuntimeAgent::callFunctionOn): LayoutTests: * inspector/runtime/runtime-callFunctionOn-expected.txt: * inspector/runtime/runtime-callFunctionOn.html:
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn-expected.txt
- trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn.html
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/inspector/InjectedScript.cpp
- trunk/Source/WebCore/inspector/InjectedScript.h
- trunk/Source/WebCore/inspector/InjectedScriptSource.js
- trunk/Source/WebCore/inspector/Inspector.json
- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp
Diff
Modified: trunk/LayoutTests/ChangeLog (91671 => 91672)
--- trunk/LayoutTests/ChangeLog 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/LayoutTests/ChangeLog 2011-07-25 17:00:04 UTC (rev 91672)
@@ -1,3 +1,15 @@
+2011-07-25 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r91668.
+ http://trac.webkit.org/changeset/91668
+ https://bugs.webkit.org/show_bug.cgi?id=65117
+
+ Breaks inspector tests on JSC (Requested by pfeldman on
+ #webkit).
+
+ * inspector/runtime/runtime-callFunctionOn-expected.txt:
+ * inspector/runtime/runtime-callFunctionOn.html:
+
2011-07-25 Pavel Podivilov <[email protected]>
Web Inspector: unreviewed, fix pause-in-internal-script expectations.
Modified: trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn-expected.txt (91671 => 91672)
--- trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn-expected.txt 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn-expected.txt 2011-07-25 17:00:04 UTC (rev 91672)
@@ -8,6 +8,4 @@
{"a":1,"b":2}
{"a":1,"b":2}
{"c":1,"d":2}
-4
-undefined
Modified: trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn.html (91671 => 91672)
--- trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn.html 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/LayoutTests/inspector/runtime/runtime-callFunctionOn.html 2011-07-25 17:00:04 UTC (rev 91672)
@@ -37,13 +37,13 @@
function step1(error, result, wasThrown)
{
- function format(aobj1, aobj2, val, undef)
+ function format(aobj1, aobj2)
{
- return JSON.stringify(this) + "\n" + JSON.stringify(aobj1) + "\n" + JSON.stringify(aobj2) + "\n" + val + "\n" + undef;
+ return JSON.stringify(this) + "\n" + JSON.stringify(aobj1) + "\n" + JSON.stringify(aobj2);
}
obj2 = result;
- RuntimeAgent.callFunctionOn(obj1.objectId, format.toString(), [obj1, obj2, {value:4}, {}], step2);
+ RuntimeAgent.callFunctionOn(obj1.objectId, format.toString(), [obj1.objectId, obj2.objectId], step2);
}
function step2(error, result, wasThrown)
Modified: trunk/Source/WebCore/ChangeLog (91671 => 91672)
--- trunk/Source/WebCore/ChangeLog 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/ChangeLog 2011-07-25 17:00:04 UTC (rev 91672)
@@ -1,3 +1,21 @@
+2011-07-25 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r91668.
+ http://trac.webkit.org/changeset/91668
+ https://bugs.webkit.org/show_bug.cgi?id=65117
+
+ Breaks inspector tests on JSC (Requested by pfeldman on
+ #webkit).
+
+ * inspector/InjectedScript.cpp:
+ (WebCore::InjectedScript::callFunctionOn):
+ * inspector/InjectedScript.h:
+ * inspector/InjectedScriptSource.js:
+ (.):
+ * inspector/Inspector.json:
+ * inspector/InspectorRuntimeAgent.cpp:
+ (WebCore::InspectorRuntimeAgent::callFunctionOn):
+
2011-07-25 Pavel Feldman <[email protected]>
Web Inspector: use dedicated type for object id in the protocol.
Modified: trunk/Source/WebCore/inspector/InjectedScript.cpp (91671 => 91672)
--- trunk/Source/WebCore/inspector/InjectedScript.cpp 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/inspector/InjectedScript.cpp 2011-07-25 17:00:04 UTC (rev 91672)
@@ -63,12 +63,19 @@
makeEvalCall(errorString, function, result, wasThrown);
}
-void InjectedScript::callFunctionOn(ErrorString* errorString, const String& objectId, const String& _expression_, const String& arguments, RefPtr<InspectorObject>* result, bool* wasThrown)
+void InjectedScript::callFunctionOn(ErrorString* errorString, const String& objectId, const String& _expression_, PassRefPtr<InspectorArray> arguments, RefPtr<InspectorObject>* result, bool* wasThrown)
{
ScriptFunctionCall function(m_injectedScriptObject, "callFunctionOn");
function.appendArgument(objectId);
function.appendArgument(_expression_);
- function.appendArgument(arguments);
+ for (unsigned i = 0; i < arguments->length(); ++i) {
+ String argumentId;
+ if (!arguments->get(i)->asString(&argumentId)) {
+ *errorString = "Call argument should be an object id";
+ return;
+ }
+ function.appendArgument(argumentId);
+ }
makeEvalCall(errorString, function, result, wasThrown);
}
Modified: trunk/Source/WebCore/inspector/InjectedScript.h (91671 => 91672)
--- trunk/Source/WebCore/inspector/InjectedScript.h 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/inspector/InjectedScript.h 2011-07-25 17:00:04 UTC (rev 91672)
@@ -56,7 +56,7 @@
bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
void evaluate(ErrorString*, const String& _expression_, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown);
- void callFunctionOn(ErrorString*, const String& objectId, const String& _expression_, const String& arguments, RefPtr<InspectorObject>* result, bool* wasThrown);
+ void callFunctionOn(ErrorString*, const String& objectId, const String& _expression_, PassRefPtr<InspectorArray> arguments, RefPtr<InspectorObject>* result, bool* wasThrown);
void evaluateOnCallFrame(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, const String& _expression_, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown);
void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result);
Node* nodeForObjectId(const String& objectId);
Modified: trunk/Source/WebCore/inspector/InjectedScriptSource.js (91671 => 91672)
--- trunk/Source/WebCore/inspector/InjectedScriptSource.js 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/inspector/InjectedScriptSource.js 2011-07-25 17:00:04 UTC (rev 91672)
@@ -277,33 +277,24 @@
return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedScriptHost, _expression_, objectGroup, false, injectCommandLineAPI);
},
- callFunctionOn: function(objectId, _expression_, args)
+ callFunctionOn: function(objectId, _expression_)
{
var parsedObjectId = this._parseObjectId(objectId);
var object = this._objectForId(parsedObjectId);
if (!object)
return "Could not find object with given id";
- if (args) {
- var resolvedArgs = [];
- args = InjectedScriptHost.evaluate(args);
- for (var i = 0; i < args.length; ++i) {
- var objectId = args[i].objectId;
- if (objectId) {
- var parsedArgId = this._parseObjectId(objectId);
- if (!parsedArgId || parsedArgId.injectedScriptId !== injectedScriptId)
- return "Arguments should belong to the same _javascript_ world as the target object.";
+ var resolvedArgs = [];
+ for (var i = 2; i < arguments.length; ++i) {
+ var parsedArgId = this._parseObjectId(arguments[i]);
+ if (!parsedArgId || parsedArgId.injectedScriptId !== injectedScriptId)
+ return "Arguments should belong to the same _javascript_ world as the target object.";
+
+ var resolvedArg = this._objectForId(parsedArgId);
+ if (!resolvedArg)
+ return "Could not find object with given id";
- var resolvedArg = this._objectForId(parsedArgId);
- if (!resolvedArg)
- return "Could not find object with given id";
-
- resolvedArgs.push(resolvedArg);
- } else if (args[i].value)
- resolvedArgs.push(args[i].value);
- else
- resolvedArgs.push(undefined);
- }
+ resolvedArgs.push(resolvedArg);
}
try {
Modified: trunk/Source/WebCore/inspector/Inspector.json (91671 => 91672)
--- trunk/Source/WebCore/inspector/Inspector.json 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/inspector/Inspector.json 2011-07-25 17:00:04 UTC (rev 91672)
@@ -218,11 +218,6 @@
"description": "Runtime domain exposes _javascript_ runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose type, string representation and unique identifier that can be used for further object interaction. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
"types": [
{
- "id": "RemoteObjectId",
- "type": "string",
- "description": "Unique object identifier."
- },
- {
"id": "RemoteObject",
"type": "object",
"description": "Mirror object referencing original _javascript_ object.",
@@ -232,7 +227,7 @@
{ "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
{ "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values)." },
{ "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." }
+ { "name": "objectId", "type": "string", "optional": true, "description": "Unique object identifier (for non-primitive values)." }
]
},
{
@@ -245,15 +240,6 @@
{ "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if exception was thrown on attempt to get the property value, in that case the value propery will contain thrown value." },
{ "name": "isGetter", "type": "boolean", "optional": true, "description": "True if this property is getter." }
]
- },
- {
- "id": "CallArgument",
- "type": "object",
- "description": "Represents function call argument. Either remote object id <code>objectId</code> or primitive <code>value</code> or neither of (for undefined) them should be specified.",
- "properties": [
- { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },
- { "name": "objectId", "$ref": "RemoteObject", "optional": true, "description": "Remote object handle." }
- ]
}
],
"commands": [
@@ -269,25 +255,25 @@
{ "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
{ "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
],
- "description": "Evaluates _expression_ on global object."
+ "description": "Evaluate _expression_ on global object."
},
{
"name": "callFunctionOn",
"parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },
+ { "name": "objectId", "type": "string", "description": "Identifier of the object to call function on." },
{ "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
- { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same _javascript_ world as the target object." }
+ { "name": "arguments", "type": "array", "items": { "type": "string", "description": "Identifier of the argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same _javascript_ world as the target object." }
],
"returns": [
{ "name": "result", "$ref": "RemoteObject", "description": "Call result." },
{ "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
],
- "description": "Calls function with given declaration on the given object."
+ "description": "Call function with given declaration on the given object."
},
{
"name": "getProperties",
"parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
+ { "name": "objectId", "type": "string", "description": "Identifier of the object to return properties for." },
{ "name": "ignoreHasOwnProperty", "type": "boolean", "description": "If true, returns properties belonging to any element of the prototype chain." }
],
"returns": [
@@ -298,7 +284,7 @@
{
"name": "setPropertyValue",
"parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to set property on." },
+ { "name": "objectId", "type": "string", "description": "Identifier of the object to set property on." },
{ "name": "propertyName", "type": "string", "description": "Property name to set value for." },
{ "name": "_expression_", "type": "string", "description": "_expression_ to evaluate." }
],
@@ -307,7 +293,7 @@
{
"name": "releaseObject",
"parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
+ { "name": "objectId", "type": "string", "description": "Identifier of the object to release." }
],
"description": "Releases remote object with given id."
},
@@ -981,7 +967,7 @@
{
"name": "pushNodeToFrontend",
"parameters": [
- { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "_javascript_ object id to convert into node." }
+ { "name": "objectId", "type": "string", "description": "_javascript_ object id to convert into node." }
],
"returns": [
{ "name": "nodeId", "type": "integer", "description": "Node id for given object." }
@@ -1409,7 +1395,7 @@
{
"name": "start",
"parameters": [
- { "name": "maxCallStackDepth", "optional": true, "type": "integer", "description": "Samples _javascript_ stack traces up to <code>maxCallStackDepth</code>, defaults to 5." }
+ { "name": "maxCallStackDepth", "optional": true, "type": "integer", "description": "Samples _javascript_ stack traces up to <code>maxCallStackDepth</code>, defaults to 5." },
],
"description": "Starts capturing instrumentation events."
},
Modified: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp (91671 => 91672)
--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp 2011-07-25 16:40:29 UTC (rev 91671)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp 2011-07-25 17:00:04 UTC (rev 91672)
@@ -89,9 +89,11 @@
*errorString = "Inspected frame has gone";
return;
}
- String arguments;
- if (optionalArguments)
- arguments = (*optionalArguments)->toJSONString();
+ RefPtr<InspectorArray> arguments = InspectorArray::create();
+ if (optionalArguments) {
+ for (unsigned i = 0; i < (*optionalArguments)->length(); ++i)
+ arguments->pushValue((*optionalArguments)->get(i));
+ }
injectedScript.callFunctionOn(errorString, objectId, _expression_, arguments, result, wasThrown);
}
_______________________________________________ webkit-changes mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
