[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:24 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 8130cd51c2fbda56d028dc11c8253671e07cf84f
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 12 15:37:31 2010 +0000
2010-08-12 Pavel Feldman <pfeldman at chromium.org>
Not reviewed, re-apply r65241 and 65243.
Web Inspector: brush up object proxies, introduce remote object model.
https://bugs.webkit.org/show_bug.cgi?id=43847
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cd00191..693dfa4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,19 @@
2010-08-12 Pavel Feldman <pfeldman at chromium.org>
+ Not reviewed, re-apply r65241 and 65243.
+
+ Web Inspector: brush up object proxies, introduce remote object model.
+ https://bugs.webkit.org/show_bug.cgi?id=43847
+
+ * inspector/console-dir-expected.txt:
+ * inspector/console-dir-global.html:
+ * inspector/console-dir.html:
+ * inspector/console-format-collections-expected.txt:
+ * inspector/console-format-expected.txt:
+ * inspector/console-format.html:
+
+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>
diff --git a/LayoutTests/inspector/console-dir-expected.txt b/LayoutTests/inspector/console-dir-expected.txt
index 5e93107..673fcc2 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
->>> 0 = "test1"
->>> 1 = "test2"
->>> length = 2
->>> __proto__ = Array
-NodeList
->>> 0 = HTMLHtmlElement
->>> constructor = NodeListConstructor
->>> length = 1
->>> __proto__ = NodeListPrototype
+Array[2]
+ 0 = "test1"
+ 1 = "test2"
+ length = 2
+ __proto__ = Array[0]
+NodeList[1]
+ 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 e7e4475..93ef6cc 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.isException)
- testController.notifyDone("Exception:" + result.value);
- var objectProxy = result.value;
- InjectedScriptAccess.getDefault().getProperties(objectProxy, false, true, getPropertiesCallback);
+ if (result.type === "error")
+ testController.notifyDone("Exception:" + result);
+ var objectProxy = WebInspector.RemoteObject.fromPayload(result);
+ objectProxy.getProperties(false, true, getPropertiesCallback);
}
function getPropertiesCallback(properties)
diff --git a/LayoutTests/inspector/console-dir.html b/LayoutTests/inspector/console-dir.html
index 8a0b773..53f7dbe 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 e0c44eb..ee24489 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]
+console-format-collections.html:41[1, Array[2]]
diff --git a/LayoutTests/inspector/console-format-expected.txt b/LayoutTests/inspector/console-format-expected.txt
index 3ec03fb..c3d0593 100644
--- a/LayoutTests/inspector/console-format-expected.txt
+++ b/LayoutTests/inspector/console-format-expected.txt
@@ -39,13 +39,13 @@ 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
+console-format.html:22Array[5]
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"
+/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
console-format.html:52/foo\\bar\sbaz/i
console-format.html:53[/foo\\bar\sbaz/i]
-"/foo\\bar\sbaz/i"
+/foo\\bar\sbaz/i
console-format.html:52test
console-format.html:53["test"]
"test"
@@ -57,27 +57,29 @@ console-format.html:53[Error: Unknown error]
Error: Unknown error
console-format.html:52<body onload="onload()">…</body>
console-format.html:53[<body onload="onload()">…</body>]
-"HTMLBodyElement"
+<body onload="onload()">…</body>
console-format.html:52function () { return 1; }
console-format.html:53[function () { return 1; }]
-"function () { return 1; }"
+function () { return 1; }
console-format.html:52function () {
return 2;
}
console-format.html:53[function () {
return 2;
}]
-"function () {<br> return 2;<br> }"
+function () {
+ return 2;
+ }
console-format.html:520.12
console-format.html:53[0.12]
-"0.12"
+0.12
console-format.html:52http://webkit.org/
console-format.html:53["http://webkit.org/"]
"http://webkit.org/"
console-format.html:52null
console-format.html:53[null]
-"null"
+null
console-format.html:52undefined
console-format.html:53[undefined]
-"undefined"
+undefined
diff --git a/LayoutTests/inspector/console-format.html b/LayoutTests/inspector/console-format.html
index b2ac355..f06a3c0 100755
--- a/LayoutTests/inspector/console-format.html
+++ b/LayoutTests/inspector/console-format.html
@@ -64,14 +64,12 @@ function frontend_evaluateGlobal()
frontend_evalExpression(expression);
}
-function frontend_evalExpression(expression, isDate)
+function frontend_evalExpression(expression)
{
var self = WebInspector.console;
- function printResult(result, exception)
+ function printResult(result)
{
- if (typeof result.description === "string")
- result = result.description.replace(/\n/g, "<br>");
- self.addMessage(new WebInspector.ConsoleCommandResult(result, exception, expression));
+ self.addMessage(new WebInspector.ConsoleCommandResult(result, expression));
}
self.evalInInspectedWindow(expression, "console", printResult);
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 41928ae..d2b3c99 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,81 @@
+2010-08-12 Pavel Feldman <pfeldman at chromium.org>
+
+ Not reviewed, re-apply r65241 and 65243.
+
+ Web Inspector: brush up object proxies, introduce remote object model.
+ https://bugs.webkit.org/show_bug.cgi?id=43847
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/AuditRules.js:
+ (WebInspector.AuditRules.CssInHeadRule.prototype.doRun):
+ (WebInspector.AuditRules.StylesScriptsOrderRule.prototype.doRun):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.doEvalInWindow):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed.printResult):
+ (WebInspector.ConsoleView.prototype._enterKeyPressed):
+ (WebInspector.ConsoleView.prototype._format):
+ (WebInspector.ConsoleView.prototype._formatarray):
+ (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
+ (WebInspector.ConsoleMessage.prototype._format):
+ (WebInspector.ConsoleCommandResult):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMNode):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.performSearch):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._createTooltipForNode):
+ * inspector/front-end/EventListenersSidebarPane.js:
+ ():
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertiesSection.prototype.update):
+ (WebInspector.ObjectPropertiesSection.prototype.updateProperties):
+ (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
+ (WebInspector.ObjectPropertyTreeElement.prototype.update):
+ (WebInspector.ObjectPropertyTreeElement.prototype.applyExpression):
+ * inspector/front-end/ObjectProxy.js: Removed.
+ * inspector/front-end/PropertiesSidebarPane.js:
+ (WebInspector.PropertiesSidebarPane.prototype.update.callback):
+ * inspector/front-end/RemoteObject.js: Added.
+ (WebInspector.RemoteObjectId):
+ (WebInspector.RemoteObject):
+ (WebInspector.RemoteObject.fromPrimitiveValue):
+ (WebInspector.RemoteObject.fromNode):
+ (WebInspector.RemoteObject.fromPayload):
+ (WebInspector.RemoteObject.type):
+ (WebInspector.RemoteObject.prototype.get objectId):
+ (WebInspector.RemoteObject.prototype.get type):
+ (WebInspector.RemoteObject.prototype.get description):
+ (WebInspector.RemoteObject.prototype.get hasChildren):
+ (WebInspector.RemoteObject.prototype.isError):
+ (WebInspector.RemoteObject.prototype.getPropertyValueDescriptions):
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getProperties.remoteObjectBinder):
+ (WebInspector.RemoteObjectProperty):
+ * inspector/front-end/ScopeChainSidebarPane.js:
+ (WebInspector.ScopeChainSidebarPane.prototype.update):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame.updatingCallbackWrapper):
+ (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame):
+ (WebInspector.ScriptsPanel.prototype.doEvalInCallFrame):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._showPopup.evaluateCallback):
+ (WebInspector.SourceFrame.prototype._showPopup):
+ (WebInspector.SourceFrame.prototype._evalSelectionInCallFrame):
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSection.prototype.update):
+ (WebInspector.WatchExpressionTreeElement.prototype.update):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector.log.logMessage):
+ (WebInspector.log):
+ * inspector/front-end/utilities.js:
+ ():
+
2010-08-11 Stephen White <senorblanco at chromium.org>
Reviewed by David Levin.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 58ee2a9..4bf62d3 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -4113,7 +4113,6 @@
'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',
@@ -4124,6 +4123,7 @@
'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 463f5d9..f95d2c1 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -51260,10 +51260,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\ObjectProxy.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\Panel.js"
>
</File>
@@ -51304,6 +51300,10 @@
>
</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 8519cf2..e28a364 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, isException)
+ function evalCallback(evalResult)
{
- if (isException || !evalResult)
+ if (!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, isException)
+ function evalCallback(resultValue)
{
- if (isException || !resultValue)
+ if (!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 6a4e0d3..ca4fe04 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(result.value, result.isException);
+ callback(WebInspector.RemoteObject.fromPayload(result));
};
InjectedScriptAccess.getDefault().evaluate(expression, objectGroup, evalCallback);
},
@@ -534,7 +534,7 @@ WebInspector.ConsoleView.prototype = {
this.addMessage(commandMessage);
var self = this;
- function printResult(result, exception)
+ function printResult(result)
{
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, exception, commandMessage));
+ self.addMessage(new WebInspector.ConsoleCommandResult(result, 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" : Object.proxyType(output));
+ var type = (forceObjectFormat ? "object" : WebInspector.RemoteObject.type(output));
var formatter = this._customFormatters[type];
if (!formatter || !isProxy) {
@@ -589,12 +589,12 @@ WebInspector.ConsoleView.prototype = {
elem.appendChild(treeOutline.element);
}
- InjectedScriptAccess.get(object.injectedScriptId).pushNodeToFrontend(object, printNode);
+ InjectedScriptAccess.get(object.objectId.injectedScriptId).pushNodeToFrontend(object.objectId, printNode);
},
_formatarray: function(arr, elem)
{
- InjectedScriptAccess.get(arr.injectedScriptId).getProperties(arr, false, false, this._printArray.bind(this, elem));
+ arr.getOwnProperties(false, this._printArray.bind(this, elem));
},
_formatstring: function(output, elem)
@@ -637,9 +637,8 @@ WebInspector.ConsoleView.prototype = {
_formatAsArrayEntry: function(output)
{
- var type = Object.proxyType(output);
// Prevent infinite expansion of cross-referencing arrays.
- return this._format(output, type === "array");
+ return this._format(output, WebInspector.RemoteObject.type(output) === "array");
}
}
@@ -728,12 +727,15 @@ 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" && typeof parameters[i] !== "function")
- parameters[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(parameters[i]);
+ 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]);
+ }
// There can be string log and string eval result. We distinguish between them based on message type.
- var shouldFormatMessage = Object.proxyType(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
+ var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;
// Multiple parameters with the first being a format string. Save unused substitutions.
if (shouldFormatMessage) {
@@ -1048,21 +1050,11 @@ WebInspector.ConsoleCommand.prototype = {
}
}
-WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand)
+WebInspector.ConsoleCommandResult = function(result, originatingCommand)
{
- 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);
-
+ var level = (result.isError() ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
this.originatingCommand = originatingCommand;
-
- WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, null, [message]);
+ WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, null, 1, null, [result]);
}
WebInspector.ConsoleCommandResult.prototype = {
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index c41d038..57422f6 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -33,10 +33,6 @@ 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 6713ddc..0296737 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);
+ InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
},
searchingForNodeWasEnabled: function()
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 87d85c1..4552fa0 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -413,8 +413,7 @@ WebInspector.ElementsTreeElement.prototype = {
else
this.tooltip = WebInspector.UIString("%d × %d pixels (Natural: %d × %d pixels)", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight);
}
- var objectProxy = new WebInspector.ObjectProxy(node.injectedScriptId, node.id);
- WebInspector.ObjectProxy.getPropertiesAsync(objectProxy, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this));
+ WebInspector.RemoteObject.fromNode(node).getPropertyValueDescriptions(["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 6798845..a08c46d 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 = new WebInspector.ObjectProxy(value.injectedScriptId, value.id, [], appropriateSelectorForNode(value), true);
+ value = WebInspector.RemoteObject.fromNode(value);
else
- value = WebInspector.ObjectProxy.wrapPrimitiveValue(value);
- properties.push(new WebInspector.ObjectPropertyProxy(propertyName, value));
+ value = WebInspector.RemoteObject.fromPrimitiveValue(value);
+ properties.push(new WebInspector.RemoteObjectProperty(propertyName, value));
}
this.updateProperties(properties);
},
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index b8bf9f2..f3e3ae9 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 = "object#" + id;
- InjectedScript.idToWrappedObject[objectId] = object;
+ objectId = id;
+ InjectedScript.idToWrappedObject[id] = object;
var group = InjectedScript.objectGroups[objectGroupName];
if (!group) {
group = [];
InjectedScript.objectGroups[objectGroupName] = group;
}
- group.push(objectId);
+ group.push(id);
+ objectId = new InjectedScript.RemoteObjectId("jsobject", id);
}
- return InjectedScript.createProxyObject(object, objectId);
+ return InjectedScript.RemoteObject.fromObject(object, objectId);
} catch (e) {
- return InjectedScript.createProxyObject("[ Exception: " + e.toString() + " ]");
+ return InjectedScript.RemoteObject.fromObject("[ 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(objectProxy, ignoreHasOwnProperty, abbreviate)
+InjectedScript.getProperties = function(objectId, ignoreHasOwnProperty, abbreviate)
{
- var object = InjectedScript._resolveObject(objectProxy);
+ var object = InjectedScript._objectForId(objectId);
if (!InjectedScript._isDefined(object))
return false;
var properties = [];
@@ -127,22 +127,21 @@ InjectedScript.getProperties = function(objectProxy, ignoreHasOwnProperty, abbre
var property = {};
property.name = propertyName + "";
- property.parentObjectProxy = objectProxy;
var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
if (!isGetter) {
try {
var childObject = object[propertyName];
- var childObjectProxy = new InjectedScript.createProxyObject(childObject, objectProxy.objectId, abbreviate);
- childObjectProxy.path = objectProxy.path ? objectProxy.path.slice() : [];
- childObjectProxy.path.push(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);
property.value = childObjectProxy;
} catch(e) {
- property.value = { description: e.toString() };
- property.isError = true;
+ property.value = new InjectedScript.RemoteObject.fromException(e);
}
} else {
// FIXME: this should show something like "getter" (bug 16734).
- property.value = { description: "\u2014" }; // em dash
+ property.value = new InjectedScript.RemoteObject.fromObject("\u2014"); // em dash
property.isGetter = true;
}
properties.push(property);
@@ -150,9 +149,9 @@ InjectedScript.getProperties = function(objectProxy, ignoreHasOwnProperty, abbre
return properties;
}
-InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression)
+InjectedScript.setPropertyValue = function(objectId, propertyName, expression)
{
- var object = InjectedScript._resolveObject(objectProxy);
+ var object = InjectedScript._objectForId(objectId);
if (!InjectedScript._isDefined(object))
return false;
@@ -258,20 +257,11 @@ InjectedScript.evaluate = function(expression, objectGroup)
InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI)
{
- var result = {};
try {
- 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;
- }
+ return InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
} catch (e) {
- result.value = e.toString();
- result.isException = true;
+ return InjectedScript.RemoteObject.fromException(e);
}
- return result;
}
InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
@@ -342,18 +332,6 @@ 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)
@@ -367,47 +345,71 @@ 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
- 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);
+ 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 (objectId.thisObject)
- return callFrame.thisObject;
+ object = callFrame.thisObject;
else
- return callFrame.scopeChain[objectId.chainIndex];
- }
- return objectId;
+ 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;
}
-InjectedScript.pushNodeToFrontend = function(objectProxy)
+InjectedScript.pushNodeToFrontend = function(objectId)
{
- var object = InjectedScript._resolveObject(objectProxy);
+ var object = InjectedScript._objectForId(objectId);
if (!object || InjectedScript._type(object) !== "node")
return false;
return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
}
-// Called from within InspectorController on the 'inspected page' side.
-InjectedScript.createProxyObject = function(object, objectId, abbreviate)
+// FIXME: RemoteObjectId and RemoteObject structs must match the WebInspector.* ones. Should reuse same file instead.
+InjectedScript.RemoteObjectId = function(type, value, path)
{
- var result = {};
- result.injectedScriptId = injectedScriptId;
- result.objectId = objectId;
- result.type = InjectedScript._type(object);
- if (result.type === "array")
- result.propertyLength = object.length;
+ this.injectedScriptId = injectedScriptId;
+ this.type = type;
+ this.value = value;
+ this.path = path || [];
+}
- var type = typeof object;
-
- result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function";
+InjectedScript.RemoteObject = function(objectId, type, description, hasChildren)
+{
+ 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());
+}
+
+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 = "";
try {
- result.description = InjectedScript._describe(object, abbreviate);
+ var description = InjectedScript._describe(object, abbreviate);
+ return new InjectedScript.RemoteObject(objectId, type, description, hasChildren);
} catch (e) {
- result.errorText = e.toString();
+ return InjectedScript.RemoteObject.fromException(e);
}
- return result;
}
InjectedScript.evaluateOnSelf = function(funcBody, args)
@@ -442,13 +444,15 @@ InjectedScript.CallFrameProxy.prototype = {
for (var i = 0; i < scopeChain.length; i++) {
var scopeType = callFrame.scopeType(i);
var scopeObject = scopeChain[i];
- var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
+ var scopeObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, chainIndex: i });
+ var scopeObjectProxy = InjectedScript.RemoteObject.fromObject(scopeObject, scopeObjectId, true);
switch(scopeType) {
case LOCAL_SCOPE: {
foundLocalScope = true;
scopeObjectProxy.isLocal = true;
- scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
+ var thisObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, thisObject: true });
+ scopeObjectProxy.thisObject = InjectedScript.RemoteObject.fromObject(callFrame.thisObject, thisObjectId, true);
break;
}
case CLOSURE_SCOPE: {
@@ -534,7 +538,10 @@ InjectedScript._describe = function(obj, abbreviated)
case "object":
case "node":
case "array":
- return InjectedScript._className(obj);
+ var className = InjectedScript._className(obj);
+ if (typeof obj.length === "number")
+ className += "[" + obj.length + "]";
+ return className;
case "string":
if (!abbreviated)
return obj;
diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js
index a32e799..aab9546 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);
};
- InjectedScriptAccess.get(this.object.injectedScriptId).getProperties(this.object, this.ignoreHasOwnProperty, true, callback);
+ this.object.getProperties(this.ignoreHasOwnProperty, true, callback);
},
updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
@@ -69,8 +69,10 @@ WebInspector.ObjectPropertiesSection.prototype = {
this.propertiesTreeOutline.removeChildren();
- for (var i = 0; i < properties.length; ++i)
+ for (var i = 0; i < properties.length; ++i) {
+ properties[i].parentObject = this.object;
this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i]));
+ }
if (!this.propertiesTreeOutline.children.length) {
var title = "<div class=\"info\">" + this.emptyPlaceholder + "</div>";
@@ -152,7 +154,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
}
};
- InjectedScriptAccess.get(this.property.value.injectedScriptId).getProperties(this.property.value, false, true, callback.bind(this));
+ this.property.value.getOwnProperties(true, callback.bind(this));
},
ondblclick: function(event)
@@ -178,11 +180,9 @@ 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.isError)
+ if (this.property.value.isError())
this.valueElement.addStyleClass("error");
this.listItemElement.removeChildren();
@@ -260,7 +260,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
self.updateSiblings();
}
};
- InjectedScriptAccess.get(this.property.parentObjectProxy.injectedScriptId).setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trim(), callback);
+ this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback);
}
}
diff --git a/WebCore/inspector/front-end/ObjectProxy.js b/WebCore/inspector/front-end/ObjectProxy.js
deleted file mode 100644
index ef139c6..0000000
--- a/WebCore/inspector/front-end/ObjectProxy.js
+++ /dev/null
@@ -1,70 +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.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 9df6448..d64881c 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.ObjectProxy(node.injectedScriptId, node.id, path.slice());
+ var prototype = new WebInspector.RemoteObject.fromNode(node, 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.injectedScriptId).getPrototypes(node.id, callback);
+ InjectedScriptAccess.get(-node.id).getPrototypes(node.id, callback);
}
}
diff --git a/WebCore/inspector/front-end/RemoteObject.js b/WebCore/inspector/front-end/RemoteObject.js
new file mode 100644
index 0000000..6b21677
--- /dev/null
+++ b/WebCore/inspector/front-end/RemoteObject.js
@@ -0,0 +1,156 @@
+/*
+ * 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 fdfcd38..d3190a9 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.ObjectPropertyProxy("this", scopeObjectProxy.thisObject) ];
+ extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(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(scopeObjectProxy, title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);
+ var section = new WebInspector.ObjectPropertiesSection(WebInspector.RemoteObject.fromPayload(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 44c1dba..16e60cb 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, exception)
+ function updatingCallbackWrapper(result)
{
- callback(result, exception);
+ callback(result);
if (updateInterface)
self.sidebarPanes.scopechain.update(selectedCallFrame);
}
@@ -401,7 +401,7 @@ WebInspector.ScriptsPanel.prototype = {
function evalCallback(result)
{
if (result)
- callback(result.value, result.isException);
+ callback(WebInspector.RemoteObject.fromPayload(result));
}
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 73c3e2a..01a8ec2 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, exception)
+ function evaluateCallback(result)
{
- if (exception)
+ if (result.isError())
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, exception) {
+ WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result) {
WebInspector.showConsole();
var commandMessage = new WebInspector.ConsoleCommand(expression);
WebInspector.console.addMessage(commandMessage);
- WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage));
+ WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));
});
},
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index b530ab6..28dad23 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -90,24 +90,10 @@ WebInspector.WatchExpressionsSection.NewWatchExpression = "\xA0";
WebInspector.WatchExpressionsSection.prototype = {
update: function()
{
- function appendResult(expression, watchIndex, result, exception)
+ function appendResult(expression, watchIndex, 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);
+ var property = new WebInspector.RemoteObjectProperty(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
@@ -222,7 +208,7 @@ WebInspector.WatchExpressionTreeElement.prototype = {
{
WebInspector.ObjectPropertyTreeElement.prototype.update.call(this);
- if (this.property.isException)
+ if (this.property.value.isError())
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 a54936c..febcad6 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -52,7 +52,6 @@
<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>
@@ -62,6 +61,7 @@
<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 48e95bb..14e2cdc 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="ObjectProxy.js"></script>
+ <script type="text/javascript" src="RemoteObject.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 4e8e633..6816d23 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1467,12 +1467,6 @@ 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()
{
@@ -1510,7 +1504,7 @@ WebInspector.log = function(message, messageLevel)
WebInspector.log.repeatCount = repeatCount;
// ConsoleMessage expects a proxy object
- message = new WebInspector.ObjectProxy(null, null, [], message, false);
+ message = new WebInspector.RemoteObject.fromPrimitiveValue(message);
// 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 dd3e761..66cf284 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -26,18 +26,6 @@
* 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 = [];
@@ -847,7 +835,7 @@ String.tokenizeFormatString = function(format)
String.standardFormatters = {
d: function(substitution)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
substitution = substitution.description;
substitution = parseInt(substitution);
return !isNaN(substitution) ? substitution : 0;
@@ -855,7 +843,7 @@ String.standardFormatters = {
f: function(substitution, token)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")
substitution = substitution.description;
substitution = parseFloat(substitution);
if (substitution && token.precision > -1)
@@ -865,7 +853,7 @@ String.standardFormatters = {
s: function(substitution)
{
- if (typeof substitution == "object" && Object.proxyType(substitution) !== "null")
+ if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) !== "null")
substitution = substitution.description;
return substitution;
},
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list