[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
pfeldman at chromium.org
pfeldman at chromium.org
Wed Dec 22 11:59:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 89c574320022794d952f0a4985fdd9832027d55f
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 12 15:04:51 2010 +0000
2010-08-12 Pavel Feldman <pfeldman at chromium.org>
Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a1f1257..cd00191 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-12 Pavel Feldman <pfeldman at chromium.org>
+
+ Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests.
+
2010-08-12 Nate Chapin <japhet at chromium.org>
Update chromium's test_expectations.txt and provide new baselines for
diff --git a/LayoutTests/inspector/console-dir-expected.txt b/LayoutTests/inspector/console-dir-expected.txt
index 673fcc2..5e93107 100644
--- a/LayoutTests/inspector/console-dir-expected.txt
+++ b/LayoutTests/inspector/console-dir-expected.txt
@@ -3,24 +3,24 @@ CONSOLE MESSAGE: line 10: [object NodeList]
CONSOLE MESSAGE: line 11: [object XPathResult]
Tests that console logging dumps proper messages.
-Array[2]
- 0 = "test1"
- 1 = "test2"
- length = 2
- __proto__ = Array[0]
-NodeList[1]
- 0 = HTMLHtmlElement
- constructor = NodeListConstructor
- length = 1
- __proto__ = NodeListPrototype
+Array
+>>> 0 = "test1"
+>>> 1 = "test2"
+>>> length = 2
+>>> __proto__ = Array
+NodeList
+>>> 0 = HTMLHtmlElement
+>>> constructor = NodeListConstructor
+>>> length = 1
+>>> __proto__ = NodeListPrototype
XPathResult
- booleanValue = Error: TYPE_ERR: DOM XPath Exception 52
- constructor = XPathResultConstructor
- invalidIteratorState = false
- numberValue = Error: TYPE_ERR: DOM XPath Exception 52
- resultType = 4
- singleNodeValue = Error: TYPE_ERR: DOM XPath Exception 52
- snapshotLength = Error: TYPE_ERR: DOM XPath Exception 52
- stringValue = Error: TYPE_ERR: DOM XPath Exception 52
- __proto__ = XPathResultPrototype
+>>> booleanValue = Error: TYPE_ERR: DOM XPath Exception 52
+>>> constructor = XPathResultConstructor
+>>> invalidIteratorState = false
+>>> numberValue = Error: TYPE_ERR: DOM XPath Exception 52
+>>> resultType = 4
+>>> singleNodeValue = Error: TYPE_ERR: DOM XPath Exception 52
+>>> snapshotLength = Error: TYPE_ERR: DOM XPath Exception 52
+>>> stringValue = Error: TYPE_ERR: DOM XPath Exception 52
+>>> __proto__ = XPathResultPrototype
diff --git a/LayoutTests/inspector/console-dir-global.html b/LayoutTests/inspector/console-dir-global.html
index 93ef6cc..e7e4475 100644
--- a/LayoutTests/inspector/console-dir-global.html
+++ b/LayoutTests/inspector/console-dir-global.html
@@ -26,10 +26,10 @@ function frontend_expandAndDumpConsoleMessages(testController)
function evalCallback(result)
{
- if (result.type === "error")
- testController.notifyDone("Exception:" + result);
- var objectProxy = WebInspector.RemoteObject.fromPayload(result);
- objectProxy.getProperties(false, true, getPropertiesCallback);
+ if (result.isException)
+ testController.notifyDone("Exception:" + result.value);
+ var objectProxy = result.value;
+ InjectedScriptAccess.getDefault().getProperties(objectProxy, false, true, getPropertiesCallback);
}
function getPropertiesCallback(properties)
diff --git a/LayoutTests/inspector/console-dir.html b/LayoutTests/inspector/console-dir.html
index 53f7dbe..8a0b773 100755
--- a/LayoutTests/inspector/console-dir.html
+++ b/LayoutTests/inspector/console-dir.html
@@ -20,7 +20,7 @@ function expandAndDumpConsoleMessages(noNotifyDone) {
output(result[i].title);
var properties = result[i].properties;
for (var j = 0; properties && j < properties.length; ++j)
- output(" " + properties[j].name + " = " + properties[j].value._description);
+ output(">>> " + properties[j].name + " = " + properties[j].value.description);
}
if (!noNotifyDone)
notifyDone();
diff --git a/LayoutTests/inspector/console-format-collections-expected.txt b/LayoutTests/inspector/console-format-collections-expected.txt
index ee24489..e0c44eb 100644
--- a/LayoutTests/inspector/console-format-collections-expected.txt
+++ b/LayoutTests/inspector/console-format-collections-expected.txt
@@ -15,5 +15,5 @@ Tests that console nicely formats HTML Collections and NodeLists.
</p>, <div style="display:none">…</div>, <form id="f">…</form>, <select id="sel" name="sel">…</select>, <option value="1">one</option>, <option value="2">two</option>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">, <div id="output" style="white-space: pre; "></div>]
console-format-collections.html:31[<select id="sel" name="sel">…</select>, <input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">]
console-format-collections.html:35[<input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">]
-console-format-collections.html:41[1, Array[2]]
+console-format-collections.html:41[1, Array]
diff --git a/LayoutTests/inspector/console-format-expected.txt b/LayoutTests/inspector/console-format-expected.txt
index 6e9c2b6..3ec03fb 100644
--- a/LayoutTests/inspector/console-format-expected.txt
+++ b/LayoutTests/inspector/console-format-expected.txt
@@ -39,7 +39,7 @@ console-format.html:13Message format for string
console-format.html:14Object Object
console-format.html:20["test", "test2", undefined, undefined, "test4"]
console-format.html:21["test", "test2", undefined, undefined, "test4"]
-console-format.html:22Array[5]
+console-format.html:22Array
console-format.html:52/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
console-format.html:53[/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i]
"/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i"
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7bd1801..8954325 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,9 @@
2010-08-12 Pavel Feldman <pfeldman at chromium.org>
+ Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests.
+
+2010-08-12 Pavel Feldman <pfeldman at chromium.org>
+
Not reviewed. Adding the file missing in r65241.
* inspector/front-end/RemoteObject.js: Added.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 4bf62d3..58ee2a9 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -4113,6 +4113,7 @@
'inspector/front-end/KeyboardShortcut.js',
'inspector/front-end/MetricsSidebarPane.js',
'inspector/front-end/Object.js',
+ 'inspector/front-end/ObjectProxy.js',
'inspector/front-end/ObjectPropertiesSection.js',
'inspector/front-end/Panel.js',
'inspector/front-end/PanelEnablerView.js',
@@ -4123,7 +4124,6 @@
'inspector/front-end/ProfileView.js',
'inspector/front-end/PropertiesSection.js',
'inspector/front-end/PropertiesSidebarPane.js',
- 'inspector/front-end/RemoteObject.js',
'inspector/front-end/Resource.js',
'inspector/front-end/ResourceCategory.js',
'inspector/front-end/ResourcesPanel.js',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index f95d2c1..463f5d9 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -51260,6 +51260,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\ObjectProxy.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\Panel.js"
>
</File>
@@ -51300,10 +51304,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\RemoteObject.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\Resource.js"
>
</File>
diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js
index e28a364..8519cf2 100644
--- a/WebCore/inspector/front-end/AuditRules.js
+++ b/WebCore/inspector/front-end/AuditRules.js
@@ -724,9 +724,9 @@ WebInspector.AuditRules.CssInHeadRule = function()
WebInspector.AuditRules.CssInHeadRule.prototype = {
doRun: function(resources, result, callback)
{
- function evalCallback(evalResult)
+ function evalCallback(evalResult, isException)
{
- if (!evalResult)
+ if (isException || !evalResult)
return callback(null);
var summary = result.addChild("");
@@ -800,9 +800,9 @@ WebInspector.AuditRules.StylesScriptsOrderRule = function()
WebInspector.AuditRules.StylesScriptsOrderRule.prototype = {
doRun: function(resources, result, callback)
{
- function evalCallback(resultValue)
+ function evalCallback(resultValue, isException)
{
- if (!resultValue)
+ if (isException || !resultValue)
return callback(null);
var lateCssUrls = resultValue[0];
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index ca4fe04..6a4e0d3 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -511,7 +511,7 @@ WebInspector.ConsoleView.prototype = {
function evalCallback(result)
{
- callback(WebInspector.RemoteObject.fromPayload(result));
+ callback(result.value, result.isException);
};
InjectedScriptAccess.getDefault().evaluate(expression, objectGroup, evalCallback);
},
@@ -534,7 +534,7 @@ WebInspector.ConsoleView.prototype = {
this.addMessage(commandMessage);
var self = this;
- function printResult(result)
+ function printResult(result, exception)
{
self.prompt.history.push(str);
self.prompt.historyOffset = 0;
@@ -542,7 +542,7 @@ WebInspector.ConsoleView.prototype = {
WebInspector.applicationSettings.consoleHistory = self.prompt.history.slice(-30);
- self.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
+ self.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
}
this.evalInInspectedWindow(str, "console", printResult);
},
@@ -550,7 +550,7 @@ WebInspector.ConsoleView.prototype = {
_format: function(output, forceObjectFormat)
{
var isProxy = (output != null && typeof output === "object");
- var type = (forceObjectFormat ? "object" : WebInspector.RemoteObject.type(output));
+ var type = (forceObjectFormat ? "object" : Object.proxyType(output));
var formatter = this._customFormatters[type];
if (!formatter || !isProxy) {
@@ -589,12 +589,12 @@ WebInspector.ConsoleView.prototype = {
elem.appendChild(treeOutline.element);
}
- InjectedScriptAccess.get(object.objectId.injectedScriptId).pushNodeToFrontend(object.objectId, printNode);
+ InjectedScriptAccess.get(object.injectedScriptId).pushNodeToFrontend(object, printNode);
},
_formatarray: function(arr, elem)
{
- arr.getOwnProperties(false, this._printArray.bind(this, elem));
+ InjectedScriptAccess.get(arr.injectedScriptId).getProperties(arr, false, false, this._printArray.bind(this, elem));
},
_formatstring: function(output, elem)
@@ -637,8 +637,9 @@ WebInspector.ConsoleView.prototype = {
_formatAsArrayEntry: function(output)
{
+ var type = Object.proxyType(output);
// Prevent infinite expansion of cross-referencing arrays.
- return this._format(output, WebInspector.RemoteObject.type(output) === "array");
+ return this._format(output, type === "array");
}
}
@@ -727,15 +728,12 @@ WebInspector.ConsoleMessage.prototype = {
// Formatting code below assumes that parameters are all wrappers whereas frontend console
// API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here.
- for (var i = 0; i < parameters.length; ++i) {
- if (typeof parameters[i] === "object")
- parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]);
- else
- parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]);
- }
+ for (var i = 0; i < parameters.length; ++i)
+ if (typeof parameters[i] !== "object" && typeof parameters[i] !== "function")
+ parameters[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(parameters[i]);
// There can be string log and string eval result. We distinguish between them based on message type.
- var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
+ var shouldFormatMessage = Object.proxyType(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
// Multiple parameters with the first being a format string. Save unused substitutions.
if (shouldFormatMessage) {
@@ -1050,11 +1048,21 @@ WebInspector.ConsoleCommand.prototype = {
}
}
-WebInspector.ConsoleCommandResult = function(result, originatingCommand)
+WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand)
{
- var level = (result.isError() ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
+ var level = (exception ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
+ var message = result;
+ if (exception) {
+ // Distinguish between strings and errors (no need to quote latter).
+ message = WebInspector.ObjectProxy.wrapPrimitiveValue(result);
+ message.type = "error";
+ }
+ var line = (exception ? result.line : -1);
+ var url = (exception ? result.sourceURL : null);
+
this.originatingCommand = originatingCommand;
- WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, null, 1, null, [result]);
+
+ WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, null, [message]);
}
WebInspector.ConsoleCommandResult.prototype = {
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 57422f6..c41d038 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -33,6 +33,10 @@ WebInspector.DOMNode = function(doc, payload) {
this.ownerDocument = doc;
this.id = payload.id;
+ // injectedScriptId is a node is for DOM nodes which should be converted
+ // to corresponding InjectedScript by the inspector backend. We indicate
+ // this by making injectedScriptId negative.
+ this.injectedScriptId = -payload.id;
this.nodeType = payload.nodeType;
this.nodeName = payload.nodeName;
this.localName = payload.localName;
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 0296737..6713ddc 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -255,7 +255,7 @@ WebInspector.ElementsPanel.prototype = {
this._matchesCountUpdateTimeout = null;
this._searchQuery = query;
- InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
+ InspectorBackend.performSearch(whitespaceTrimmedQuery);
},
searchingForNodeWasEnabled: function()
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 4552fa0..87d85c1 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -413,7 +413,8 @@ WebInspector.ElementsTreeElement.prototype = {
else
this.tooltip = WebInspector.UIString("%d × %d pixels (Natural: %d × %d pixels)", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight);
}
- WebInspector.RemoteObject.fromNode(node).getPropertyValueDescriptions(["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
+ var objectProxy = new WebInspector.ObjectProxy(node.injectedScriptId, node.id);
+ WebInspector.ObjectProxy.getPropertiesAsync(objectProxy, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
},
updateSelection: function()
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index a08c46d..6798845 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -194,10 +194,10 @@ WebInspector.EventListenerBar.prototype = {
// Just build properties in place - no need to reach out for injected script.
var value = this.eventListener[propertyName];
if (value instanceof WebInspector.DOMNode)
- value = WebInspector.RemoteObject.fromNode(value);
+ value = new WebInspector.ObjectProxy(value.injectedScriptId, value.id, [], appropriateSelectorForNode(value), true);
else
- value = WebInspector.RemoteObject.fromPrimitiveValue(value);
- properties.push(new WebInspector.RemoteObjectProperty(propertyName, value));
+ value = WebInspector.ObjectProxy.wrapPrimitiveValue(value);
+ properties.push(new WebInspector.ObjectPropertyProxy(propertyName, value));
}
this.updateProperties(properties);
},
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index f3e3ae9..b8bf9f2 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -50,21 +50,21 @@ InjectedScript.wrapObject = function(object, objectGroupName)
var objectId;
if (typeof object === "object" || typeof object === "function" || InjectedScript._isHTMLAllCollection(object)) {
var id = InjectedScript.lastBoundObjectId++;
- objectId = id;
- InjectedScript.idToWrappedObject[id] = object;
+ objectId = "object#" + id;
+ InjectedScript.idToWrappedObject[objectId] = object;
var group = InjectedScript.objectGroups[objectGroupName];
if (!group) {
group = [];
InjectedScript.objectGroups[objectGroupName] = group;
}
- group.push(id);
- objectId = new InjectedScript.RemoteObjectId("jsobject", id);
+ group.push(objectId);
}
- return InjectedScript.RemoteObject.fromObject(object, objectId);
+ return InjectedScript.createProxyObject(object, objectId);
} catch (e) {
- return InjectedScript.RemoteObject.fromObject("[ Exception: " + e.toString() + " ]");
+ return InjectedScript.createProxyObject("[ Exception: " + e.toString() + " ]");
}
+ return InjectedScript.createProxyObject(object, objectId);
};
InjectedScript.unwrapObject = function(objectId) {
@@ -110,9 +110,9 @@ InjectedScript.getPrototypes = function(nodeId)
return result;
}
-InjectedScript.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate)
+InjectedScript.getProperties = function(objectProxy, ignoreHasOwnProperty, abbreviate)
{
- var object = InjectedScript._objectForId(objectId);
+ var object = InjectedScript._resolveObject(objectProxy);
if (!InjectedScript._isDefined(object))
return false;
var properties = [];
@@ -127,21 +127,22 @@ InjectedScript.getProperties = function(objectId, ignoreHasOwnProperty, abbrevia
var property = {};
property.name = propertyName + "";
+ property.parentObjectProxy = objectProxy;
var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
if (!isGetter) {
try {
var childObject = object[propertyName];
- var path = objectId.path ? objectId.path.slice() : [];
- path.push(propertyName);
- var childObjectId = new InjectedScript.RemoteObjectId(objectId.type, objectId.value, path);
- var childObjectProxy = new InjectedScript.RemoteObject.fromObject(childObject, childObjectId, abbreviate);
+ var childObjectProxy = new InjectedScript.createProxyObject(childObject, objectProxy.objectId, abbreviate);
+ childObjectProxy.path = objectProxy.path ? objectProxy.path.slice() : [];
+ childObjectProxy.path.push(propertyName);
property.value = childObjectProxy;
} catch(e) {
- property.value = new InjectedScript.RemoteObject.fromException(e);
+ property.value = { description: e.toString() };
+ property.isError = true;
}
} else {
// FIXME: this should show something like "getter" (bug 16734).
- property.value = new InjectedScript.RemoteObject.fromObject("\u2014"); // em dash
+ property.value = { description: "\u2014" }; // em dash
property.isGetter = true;
}
properties.push(property);
@@ -149,9 +150,9 @@ InjectedScript.getProperties = function(objectId, ignoreHasOwnProperty, abbrevia
return properties;
}
-InjectedScript.setPropertyValue = function(objectId, propertyName, expression)
+InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression)
{
- var object = InjectedScript._objectForId(objectId);
+ var object = InjectedScript._resolveObject(objectProxy);
if (!InjectedScript._isDefined(object))
return false;
@@ -257,11 +258,20 @@ InjectedScript.evaluate = function(expression, objectGroup)
InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI)
{
+ var result = {};
try {
- return InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
+ result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
+
+ // Handle error that might have happened while describing result.
+ if (result.value.errorText) {
+ result.value = result.value.errorText;
+ result.isException = true;
+ }
} catch (e) {
- return InjectedScript.RemoteObject.fromException(e);
+ result.value = e.toString();
+ result.isException = true;
}
+ return result;
}
InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
@@ -332,6 +342,18 @@ InjectedScript._callFrameForId = function(id)
return callFrame;
}
+InjectedScript._resolveObject = function(objectProxy)
+{
+ var object = InjectedScript._objectForId(objectProxy.objectId);
+ var path = objectProxy.path;
+
+ // Follow the property path.
+ for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i)
+ object = object[path[i]];
+
+ return object;
+}
+
InjectedScript._nodeForId = function(nodeId)
{
if (!nodeId)
@@ -345,71 +367,47 @@ InjectedScript._objectForId = function(objectId)
// - numbers point to DOM Node via the InspectorDOMAgent mapping
// - strings point to console objects cached in InspectorController for lazy evaluation upon them
// - objects contain complex ids and are currently used for scoped objects
- var object;
- if (objectId.type === "node")
- object = InjectedScript._nodeForId(objectId.value);
- else if (objectId.type === "jsobject")
- object = InjectedScript.unwrapObject(objectId.value);
- else if (objectId.type === "scopeObject") {
- var callFrame = InjectedScript._callFrameForId(objectId.value.callFrame);
+ if (typeof objectId === "number")
+ return InjectedScript._nodeForId(objectId);
+ else if (typeof objectId === "string")
+ return InjectedScript.unwrapObject(objectId);
+ else if (typeof objectId === "object") {
+ var callFrame = InjectedScript._callFrameForId(objectId.callFrame);
if (objectId.thisObject)
- object = callFrame.thisObject;
+ return callFrame.thisObject;
else
- object = callFrame.scopeChain[objectId.value.chainIndex];
- } else
- return objectId;
-
- var path = objectId.path;
-
- // Follow the property path.
- for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i)
- object = object[path[i]];
-
- return object;
+ return callFrame.scopeChain[objectId.chainIndex];
+ }
+ return objectId;
}
-InjectedScript.pushNodeToFrontend = function(objectId)
+InjectedScript.pushNodeToFrontend = function(objectProxy)
{
- var object = InjectedScript._objectForId(objectId);
+ var object = InjectedScript._resolveObject(objectProxy);
if (!object || InjectedScript._type(object) !== "node")
return false;
return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
}
-// FIXME: RemoteObjectId and RemoteObject structs must match the WebInspector.* ones. Should reuse same file instead.
-InjectedScript.RemoteObjectId = function(type, value, path)
-{
- this.injectedScriptId = injectedScriptId;
- this.type = type;
- this.value = value;
- this.path = path || [];
-}
-
-InjectedScript.RemoteObject = function(objectId, type, description, hasChildren)
+// Called from within InspectorController on the 'inspected page' side.
+InjectedScript.createProxyObject = function(object, objectId, abbreviate)
{
- this.objectId = objectId;
- this.type = type;
- this.description = description;
- this.hasChildren = hasChildren;
-}
-
-InjectedScript.RemoteObject.fromException = function(e)
-{
- return new InjectedScript.RemoteObject(null, "error", e.toString());
-}
+ var result = {};
+ result.injectedScriptId = injectedScriptId;
+ result.objectId = objectId;
+ result.type = InjectedScript._type(object);
+ if (result.type === "array")
+ result.propertyLength = object.length;
-InjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate)
-{
- var type = InjectedScript._type(object);
- var rawType = typeof object;
- var hasChildren = (rawType === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || rawType === "function";
- var description = "";
+ var type = typeof object;
+
+ result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function";
try {
- var description = InjectedScript._describe(object, abbreviate);
- return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);
+ result.description = InjectedScript._describe(object, abbreviate);
} catch (e) {
- return InjectedScript.RemoteObject.fromException(e);
+ result.errorText = e.toString();
}
+ return result;
}
InjectedScript.evaluateOnSelf = function(funcBody, args)
@@ -444,15 +442,13 @@ InjectedScript.CallFrameProxy.prototype = {
for (var i = 0; i < scopeChain.length; i++) {
var scopeType = callFrame.scopeType(i);
var scopeObject = scopeChain[i];
- var scopeObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, chainIndex: i });
- var scopeObjectProxy = InjectedScript.RemoteObject.fromObject(scopeObject, scopeObjectId, true);
+ var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
switch(scopeType) {
case LOCAL_SCOPE: {
foundLocalScope = true;
scopeObjectProxy.isLocal = true;
- var thisObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, thisObject: true });
- scopeObjectProxy.thisObject = InjectedScript.RemoteObject.fromObject(callFrame.thisObject, thisObjectId, true);
+ scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
break;
}
case CLOSURE_SCOPE: {
@@ -538,10 +534,7 @@ InjectedScript._describe = function(obj, abbreviated)
case "object":
case "node":
case "array":
- var className = InjectedScript._className(obj);
- if (typeof obj.length === "number")
- className += "[" + obj.length + "]";
- return className;
+ return InjectedScript._className(obj);
case "string":
if (!abbreviated)
return obj;
diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js
index aab9546..a32e799 100644
--- a/WebCore/inspector/front-end/ObjectPropertiesSection.js
+++ b/WebCore/inspector/front-end/ObjectPropertiesSection.js
@@ -50,7 +50,7 @@ WebInspector.ObjectPropertiesSection.prototype = {
return;
self.updateProperties(properties);
};
- this.object.getProperties(this.ignoreHasOwnProperty, true, callback);
+ InjectedScriptAccess.get(this.object.injectedScriptId).getProperties(this.object, this.ignoreHasOwnProperty, true, callback);
},
updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
@@ -69,10 +69,8 @@ WebInspector.ObjectPropertiesSection.prototype = {
this.propertiesTreeOutline.removeChildren();
- for (var i = 0; i < properties.length; ++i) {
- properties[i].parentObject = this.object;
+ for (var i = 0; i < properties.length; ++i)
this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));
- }
if (!this.propertiesTreeOutline.children.length) {
var title = "<div class=\"info\">" + this.emptyPlaceholder + "</div>";
@@ -154,7 +152,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
}
};
- this.property.value.getOwnProperties(true, callback.bind(this));
+ InjectedScriptAccess.get(this.property.value.injectedScriptId).getProperties(this.property.value, false, true, callback.bind(this));
},
ondblclick: function(event)
@@ -180,9 +178,11 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.valueElement = document.createElement("span");
this.valueElement.className = "value";
this.valueElement.textContent = this.property.value.description;
+ if (typeof this.property.value.propertyLength !== "undefined")
+ this.valueElement.textContent += " (" + this.property.value.propertyLength + ")";
if (this.property.isGetter)
this.valueElement.addStyleClass("dimmed");
- if (this.property.value.isError())
+ if (this.property.isError)
this.valueElement.addStyleClass("error");
this.listItemElement.removeChildren();
@@ -260,7 +260,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
self.updateSiblings();
}
};
- this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback);
+ InjectedScriptAccess.get(this.property.parentObjectProxy.injectedScriptId).setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trim(), callback);
}
}
diff --git a/WebCore/inspector/front-end/ObjectProxy.js b/WebCore/inspector/front-end/ObjectProxy.js
new file mode 100644
index 0000000..ef139c6
--- /dev/null
+++ b/WebCore/inspector/front-end/ObjectProxy.js
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.ObjectProxy = function(injectedScriptId, objectId, path, description, hasChildren)
+{
+ this.objectId = objectId;
+ this.injectedScriptId = injectedScriptId;
+ this.path = path || [];
+ this.description = description;
+ this.hasChildren = hasChildren;
+}
+
+WebInspector.ObjectProxy.wrapPrimitiveValue = function(value)
+{
+ var proxy = new WebInspector.ObjectProxy();
+ proxy.type = typeof value;
+ proxy.description = value;
+ return proxy;
+}
+
+WebInspector.ObjectProxy.getPropertiesAsync = function(objectProxy, propertiesToQueryFor, callback)
+{
+ function createPropertiesMapThenCallback(propertiesPayload)
+ {
+ if (!propertiesPayload) {
+ callback();
+ return;
+ }
+
+ var result = [];
+ for (var i = 0; i < propertiesPayload.length; ++i)
+ if (propertiesToQueryFor.indexOf(propertiesPayload[i].name) !== -1)
+ result[propertiesPayload[i].name] = propertiesPayload[i].value.description;
+ callback(result);
+ };
+ InjectedScriptAccess.get(objectProxy.injectedScriptId).getProperties(objectProxy, true, false, createPropertiesMapThenCallback);
+}
+
+WebInspector.ObjectPropertyProxy = function(name, value)
+{
+ this.name = name;
+ this.value = value;
+}
diff --git a/WebCore/inspector/front-end/PropertiesSidebarPane.js b/WebCore/inspector/front-end/PropertiesSidebarPane.js
index d64881c..9df6448 100644
--- a/WebCore/inspector/front-end/PropertiesSidebarPane.js
+++ b/WebCore/inspector/front-end/PropertiesSidebarPane.js
@@ -51,14 +51,14 @@ WebInspector.PropertiesSidebarPane.prototype = {
var path = [];
// Get array of prototype user-friendly names.
for (var i = 0; i < prototypes.length; ++i) {
- var prototype = new WebInspector.RemoteObject.fromNode(node, path.slice());
+ var prototype = new WebInspector.ObjectProxy(node.injectedScriptId, node.id, path.slice());
var section = new WebInspector.ObjectPropertiesSection(prototype, prototypes[i], WebInspector.UIString("Prototype"));
self.sections.push(section);
body.appendChild(section.element);
path.push("__proto__");
}
};
- InjectedScriptAccess.get(-node.id).getPrototypes(node.id, callback);
+ InjectedScriptAccess.get(node.injectedScriptId).getPrototypes(node.id, callback);
}
}
diff --git a/WebCore/inspector/front-end/RemoteObject.js b/WebCore/inspector/front-end/RemoteObject.js
deleted file mode 100644
index 6b21677..0000000
--- a/WebCore/inspector/front-end/RemoteObject.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.RemoteObjectId = function(injectedScriptId, type, value, path)
-{
- this.injectedScriptId = injectedScriptId;
- this.type = type;
- this.value = value;
- this.path = path || [];
-}
-
-WebInspector.RemoteObject = function(objectId, type, description, hasChildren)
-{
- this._objectId = objectId;
- this._type = type;
- this._description = description;
- this._hasChildren = hasChildren;
-}
-
-WebInspector.RemoteObject.fromPrimitiveValue = function(value)
-{
- return new WebInspector.RemoteObject(null, typeof value, value);
-}
-
-WebInspector.RemoteObject.fromNode = function(node, path)
-{
- var objectId = new WebInspector.RemoteObjectId(-node.id, "node", node.id, path);
- return new WebInspector.RemoteObject(objectId, "node", appropriateSelectorForNode(node), true);
-}
-
-WebInspector.RemoteObject.fromPayload = function(payload)
-{
- if (typeof payload === "object")
- return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.description, payload.hasChildren);
- // FIXME: make sure we only get here with real payloads in the new DebuggerAgent.js.
- return payload;
-}
-
-WebInspector.RemoteObject.type = function(remoteObject)
-{
- if (remoteObject === null)
- return "null";
-
- var type = typeof remoteObject;
- if (type !== "object" && type !== "function")
- return type;
-
- return remoteObject.type;
-}
-
-WebInspector.RemoteObject.prototype = {
- get objectId()
- {
- return this._objectId;
- },
-
- get type()
- {
- return this._type;
- },
-
- get description()
- {
- return this._description;
- },
-
- get hasChildren()
- {
- return this._hasChildren;
- },
-
- isError: function()
- {
- return this._type === "error";
- },
-
- getPropertyValueDescriptions: function(propertiesToQueryFor, callback)
- {
- function createPropertiesMapThenCallback(propertiesPayload)
- {
- if (!propertiesPayload) {
- callback();
- return;
- }
-
- var result = {};
- for (var i = 0; i < propertiesPayload.length; ++i)
- if (propertiesToQueryFor.indexOf(propertiesPayload[i].name) !== -1)
- result[propertiesPayload[i].name] = propertiesPayload[i].value.description;
- callback(result);
- }
- this.getProperties(true, false, createPropertiesMapThenCallback);
- },
-
- getOwnProperties: function(abbreviate, callback)
- {
- this.getProperties(false, abbreviate, callback);
- },
-
- getProperties: function(ignoreHasOwnProperty, abbreviate, callback)
- {
- if (!this._objectId) {
- callback([]);
- return;
- }
- function remoteObjectBinder(properties)
- {
- for (var i = 0; properties && i < properties.length; ++i)
- properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);
- callback(properties);
- }
- InjectedScriptAccess.get(this._objectId.injectedScriptId).getProperties(this._objectId, ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
- },
-
- setPropertyValue: function(name, value, callback)
- {
- if (!this._objectId) {
- callback(false);
- return;
- }
- InjectedScriptAccess.get(this._objectId.injectedScriptId).setPropertyValue(this._objectId, name, value, callback);
- }
-}
-
-WebInspector.RemoteObjectProperty = function(name, value)
-{
- this.name = name;
- this.value = value;
-}
diff --git a/WebCore/inspector/front-end/ScopeChainSidebarPane.js b/WebCore/inspector/front-end/ScopeChainSidebarPane.js
index d3190a9..fdfcd38 100644
--- a/WebCore/inspector/front-end/ScopeChainSidebarPane.js
+++ b/WebCore/inspector/front-end/ScopeChainSidebarPane.js
@@ -60,7 +60,7 @@ WebInspector.ScopeChainSidebarPane.prototype = {
emptyPlaceholder = WebInspector.UIString("No Variables");
subtitle = null;
if (scopeObjectProxy.thisObject)
- extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(scopeObjectProxy.thisObject)) ];
+ extraProperties = [ new WebInspector.ObjectPropertyProxy("this", scopeObjectProxy.thisObject) ];
} else if (scopeObjectProxy.isClosure) {
title = WebInspector.UIString("Closure");
emptyPlaceholder = WebInspector.UIString("No Variables");
@@ -77,7 +77,7 @@ WebInspector.ScopeChainSidebarPane.prototype = {
if (!title || title === subtitle)
subtitle = null;
- var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(scopeObjectProxy), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);
+ var section = new WebInspector.ObjectPropertiesSection(scopeObjectProxy, title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);
section.editInSelectedCallFrameWhenPaused = true;
section.pane = this;
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 16e60cb..44c1dba 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -387,9 +387,9 @@ WebInspector.ScriptsPanel.prototype = {
updateInterface = true;
var self = this;
- function updatingCallbackWrapper(result)
+ function updatingCallbackWrapper(result, exception)
{
- callback(result);
+ callback(result, exception);
if (updateInterface)
self.sidebarPanes.scopechain.update(selectedCallFrame);
}
@@ -401,7 +401,7 @@ WebInspector.ScriptsPanel.prototype = {
function evalCallback(result)
{
if (result)
- callback(WebInspector.RemoteObject.fromPayload(result));
+ callback(result.value, result.isException);
}
InjectedScriptAccess.get(callFrame.injectedScriptId).evaluateInCallFrame(callFrame.id, code, objectGroup, evalCallback);
},
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 01a8ec2..73c3e2a 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -625,9 +625,9 @@ WebInspector.SourceFrame.prototype = {
popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
}
- function evaluateCallback(result)
+ function evaluateCallback(result, exception)
{
- if (result.isError())
+ if (exception)
return;
if (!WebInspector.panels.scripts.paused)
return;
@@ -699,11 +699,11 @@ WebInspector.SourceFrame.prototype = {
return;
var expression = selection.getRangeAt(0).toString().trim();
- WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result) {
+ WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result, exception) {
WebInspector.showConsole();
var commandMessage = new WebInspector.ConsoleCommand(expression);
WebInspector.console.addMessage(commandMessage);
- WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
+ WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
});
},
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index 28dad23..b530ab6 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -90,10 +90,24 @@ WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0";
WebInspector.WatchExpressionsSection.prototype = {
update: function()
{
- function appendResult(expression, watchIndex, result)
+ function appendResult(expression, watchIndex, result, exception)
{
- var property = new WebInspector.RemoteObjectProperty(expression, result);
+ if (exception) {
+ // Exception results are not wrappers, but text messages.
+ result = WebInspector.ObjectProxy.wrapPrimitiveValue(result);
+ } else if (result.type === "string") {
+ // Evaluation result is intentionally not abbreviated. However, we'd like to distinguish between null and "null"
+ result.description = "\"" + result.description + "\"";
+ }
+
+ var property = new WebInspector.ObjectPropertyProxy(expression, result);
property.watchIndex = watchIndex;
+ property.isException = exception;
+
+ // For newly added, empty expressions, set description to "",
+ // since otherwise you get DOMWindow
+ if (property.name === WebInspector.WatchExpressionsSection.NewWatchExpression)
+ property.value.description = "";
// To clarify what's going on here:
// In the outer function, we calculate the number of properties
@@ -208,7 +222,7 @@ WebInspector.WatchExpressionTreeElement.prototype = {
{
WebInspector.ObjectPropertyTreeElement.prototype.update.call(this);
- if (this.property.value.isError())
+ if (this.property.isException)
this.valueElement.addStyleClass("watch-expressions-error-level");
var deleteButton = document.createElement("input");
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index febcad6..a54936c 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -52,6 +52,7 @@
<file>MetricsSidebarPane.js</file>
<file>Object.js</file>
<file>ObjectPropertiesSection.js</file>
+ <file>ObjectProxy.js</file>
<file>Panel.js</file>
<file>PanelEnablerView.js</file>
<file>Placard.js</file>
@@ -61,7 +62,6 @@
<file>ProfileView.js</file>
<file>PropertiesSection.js</file>
<file>PropertiesSidebarPane.js</file>
- <file>RemoteObject.js</file>
<file>Resource.js</file>
<file>ResourceCategory.js</file>
<file>ResourcesPanel.js</file>
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 14e2cdc..48e95bb 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -73,7 +73,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="SidebarTreeElement.js"></script>
<script type="text/javascript" src="Section.js"></script>
<script type="text/javascript" src="PropertiesSection.js"></script>
- <script type="text/javascript" src="RemoteObject.js"></script>
+ <script type="text/javascript" src="ObjectProxy.js"></script>
<script type="text/javascript" src="ObjectPropertiesSection.js"></script>
<script type="text/javascript" src="BreakpointsSidebarPane.js"></script>
<script type="text/javascript" src="CallStackSidebarPane.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 6816d23..4e8e633 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1467,6 +1467,12 @@ WebInspector.log = function(message, messageLevel)
// remember 'this' for setInterval() callback
var self = this;
+ // return indication if we can actually log a message
+ function isLogAvailable()
+ {
+ return WebInspector.ConsoleMessage && WebInspector.ObjectProxy && self.console;
+ }
+
// flush the queue of pending messages
function flushQueue()
{
@@ -1504,7 +1510,7 @@ WebInspector.log = function(message, messageLevel)
WebInspector.log.repeatCount = repeatCount;
// ConsoleMessage expects a proxy object
- message = new WebInspector.RemoteObject.fromPrimitiveValue(message);
+ message = new WebInspector.ObjectProxy(null, null, [], message, false);
// post the message
var msg = new WebInspector.ConsoleMessage(
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 66cf284..dd3e761 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -26,6 +26,18 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+Object.proxyType = function(objectProxy)
+{
+ if (objectProxy === null)
+ return "null";
+
+ var type = typeof objectProxy;
+ if (type !== "object" && type !== "function")
+ return type;
+
+ return objectProxy.type;
+}
+
Object.properties = function(obj)
{
var properties = [];
@@ -835,7 +847,7 @@ String.tokenizeFormatString = function(format)
String.standardFormatters = {
d: function(substitution)
{
- if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
+ if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
substitution = substitution.description;
substitution = parseInt(substitution);
return !isNaN(substitution) ? substitution : 0;
@@ -843,7 +855,7 @@ String.standardFormatters = {
f: function(substitution, token)
{
- if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
+ if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
substitution = substitution.description;
substitution = parseFloat(substitution);
if (substitution && token.precision > -1)
@@ -853,7 +865,7 @@ String.standardFormatters = {
s: function(substitution)
{
- if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) !== "null")
+ if (typeof substitution == "object" && Object.proxyType(substitution) !== "null")
substitution = substitution.description;
return substitution;
},
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list