2010-08-12 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2010 13:31:30 +0000 (13:31 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Aug 2010 13:31:30 +0000 (13:31 +0000)
        Reviewed by Yury Semikhatsky.

        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._formatnode):
        (WebInspector.ConsoleView.prototype._formatarray):
        (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
        (WebInspector.ConsoleMessage.prototype._format):
        (WebInspector.ConsoleCommandResult):
        * inspector/front-end/DOMAgent.js:
        (WebInspector.DOMNode):
        * 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.fromErrorMessage):
        (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-12  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Yury Semikhatsky.

        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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65241 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/console-dir-expected.txt
LayoutTests/inspector/console-dir-global.html
LayoutTests/inspector/console-dir.html
LayoutTests/inspector/console-format-collections-expected.txt
LayoutTests/inspector/console-format-expected.txt
WebCore/ChangeLog
WebCore/WebCore.gypi
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/inspector/front-end/AuditRules.js
WebCore/inspector/front-end/ConsoleView.js
WebCore/inspector/front-end/DOMAgent.js
WebCore/inspector/front-end/ElementsPanel.js
WebCore/inspector/front-end/ElementsTreeOutline.js
WebCore/inspector/front-end/EventListenersSidebarPane.js
WebCore/inspector/front-end/InjectedScript.js
WebCore/inspector/front-end/ObjectPropertiesSection.js
WebCore/inspector/front-end/ObjectProxy.js [deleted file]
WebCore/inspector/front-end/PropertiesSidebarPane.js
WebCore/inspector/front-end/ScopeChainSidebarPane.js
WebCore/inspector/front-end/ScriptsPanel.js
WebCore/inspector/front-end/SourceFrame.js
WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
WebCore/inspector/front-end/WebKit.qrc
WebCore/inspector/front-end/inspector.html
WebCore/inspector/front-end/inspector.js
WebCore/inspector/front-end/utilities.js

index 62a48e4..4f3b871 100644 (file)
@@ -1,3 +1,16 @@
+2010-08-12  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        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:
+
 2010-08-12  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed.
index 5e93107..673fcc2 100644 (file)
@@ -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
 
index e7e4475..93ef6cc 100644 (file)
@@ -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)
index 8a0b773..53f7dbe 100755 (executable)
@@ -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();
index e0c44eb..ee24489 100644 (file)
@@ -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]]
 
index 3ec03fb..6e9c2b6 100644 (file)
@@ -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
+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"
index 936dd4a..8c607e6 100644 (file)
@@ -1,3 +1,79 @@
+2010-08-12  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        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._formatnode):
+        (WebInspector.ConsoleView.prototype._formatarray):
+        (WebInspector.ConsoleView.prototype._formatAsArrayEntry):
+        (WebInspector.ConsoleMessage.prototype._format):
+        (WebInspector.ConsoleCommandResult):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMNode):
+        * 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.fromErrorMessage):
+        (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-12  Ben Murdoch  <benm@google.com>
 
         Reviewed by Steve Block.
index 58ee2a9..4bf62d3 100644 (file)
             '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',
             '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',
index 463f5d9..f95d2c1 100644 (file)
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\inspector\front-end\ObjectProxy.js"\r
-                                       >\r
-                               </File>\r
-                               <File\r
                                        RelativePath="..\inspector\front-end\Panel.js"\r
                                        >\r
                                </File>\r
                                        >\r
                                </File>\r
                                <File\r
+                                       RelativePath="..\inspector\front-end\RemoteObject.js"\r
+                                       >\r
+                               </File>\r
+                               <File\r
                                        RelativePath="..\inspector\front-end\Resource.js"\r
                                        >\r
                                </File>\r
index 8519cf2..e28a364 100644 (file)
@@ -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];
index 6a4e0d3..ca4fe04 100644 (file)
@@ -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 = {
index c41d038..57422f6 100644 (file)
@@ -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;
index 6713ddc..0296737 100644 (file)
@@ -255,7 +255,7 @@ WebInspector.ElementsPanel.prototype = {
         this._matchesCountUpdateTimeout = null;
         this._searchQuery = query;
 
-        InspectorBackend.performSearch(whitespaceTrimmedQuery);
+        InspectorBackend.performSearch(whitespaceTrimmedQuery, false);
     },
 
     searchingForNodeWasEnabled: function()
index 87d85c1..4552fa0 100644 (file)
@@ -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()
index 6798845..a08c46d 100644 (file)
@@ -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);
     },
index b8bf9f2..f3e3ae9 100644 (file)
@@ -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;
index a32e799..aab9546 100644 (file)
@@ -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 (file)
index ef139c6..0000000
+++ /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;
-}
index 9df6448..d64881c 100644 (file)
@@ -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);
     }
 }
 
index fdfcd38..d3190a9 100644 (file)
@@ -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;
 
index 44c1dba..16e60cb 100644 (file)
@@ -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);
     },
index 73c3e2a..01a8ec2 100644 (file)
@@ -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));
         });
     },
 
index b530ab6..28dad23 100644 (file)
@@ -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");
index a54936c..febcad6 100644 (file)
@@ -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>
index 48e95bb..14e2cdc 100644 (file)
@@ -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>
index 4e8e633..6816d23 100644 (file)
@@ -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(
index dd3e761..66cf284 100644 (file)
  * 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;
     },