Changeset 65245 in webkit
- Timestamp:
- Aug 12, 2010 8:04:51 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65244 r65245 1 2010-08-12 Pavel Feldman <pfeldman@chromium.org> 2 3 Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests. 4 1 5 2010-08-12 Nate Chapin <japhet@chromium.org> 2 6 -
trunk/LayoutTests/inspector/console-dir-expected.txt
r65241 r65245 4 4 Tests that console logging dumps proper messages. 5 5 6 Array [2]7 8 9 10 __proto__ = Array[0] 11 NodeList [1]12 13 14 15 6 Array 7 >>> 0 = "test1" 8 >>> 1 = "test2" 9 >>> length = 2 10 >>> __proto__ = Array 11 NodeList 12 >>> 0 = HTMLHtmlElement 13 >>> constructor = NodeListConstructor 14 >>> length = 1 15 >>> __proto__ = NodeListPrototype 16 16 XPathResult 17 18 19 20 21 22 23 24 25 17 >>> booleanValue = Error: TYPE_ERR: DOM XPath Exception 52 18 >>> constructor = XPathResultConstructor 19 >>> invalidIteratorState = false 20 >>> numberValue = Error: TYPE_ERR: DOM XPath Exception 52 21 >>> resultType = 4 22 >>> singleNodeValue = Error: TYPE_ERR: DOM XPath Exception 52 23 >>> snapshotLength = Error: TYPE_ERR: DOM XPath Exception 52 24 >>> stringValue = Error: TYPE_ERR: DOM XPath Exception 52 25 >>> __proto__ = XPathResultPrototype 26 26 -
trunk/LayoutTests/inspector/console-dir-global.html
r65241 r65245 27 27 function evalCallback(result) 28 28 { 29 if (result. type === "error")30 testController.notifyDone("Exception:" + result );31 var objectProxy = WebInspector.RemoteObject.fromPayload(result);32 objectProxy.getProperties(false, true, getPropertiesCallback);29 if (result.isException) 30 testController.notifyDone("Exception:" + result.value); 31 var objectProxy = result.value; 32 InjectedScriptAccess.getDefault().getProperties(objectProxy, false, true, getPropertiesCallback); 33 33 } 34 34 -
trunk/LayoutTests/inspector/console-dir.html
r65241 r65245 21 21 var properties = result[i].properties; 22 22 for (var j = 0; properties && j < properties.length; ++j) 23 output(" " + properties[j].name + " = " + properties[j].value._description);23 output(">>> " + properties[j].name + " = " + properties[j].value.description); 24 24 } 25 25 if (!noNotifyDone) -
trunk/LayoutTests/inspector/console-format-collections-expected.txt
r65241 r65245 16 16 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">] 17 17 console-format-collections.html:35[<input type="radio" name="x" value="x1">, <input type="radio" name="x" value="x2">] 18 console-format-collections.html:41[1, Array [2]]18 console-format-collections.html:41[1, Array] 19 19 -
trunk/LayoutTests/inspector/console-format-expected.txt
r65241 r65245 40 40 console-format.html:20["test", "test2", undefined, undefined, "test4"] 41 41 console-format.html:21["test", "test2", undefined, undefined, "test4"] 42 console-format.html:22Array [5]42 console-format.html:22Array 43 43 console-format.html:52/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i 44 44 console-format.html:53[/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] -
trunk/WebCore/ChangeLog
r65243 r65245 1 2010-08-12 Pavel Feldman <pfeldman@chromium.org> 2 3 Not reviewed. Rolling out r65241 and 65243 for breaking inspector tests. 4 1 5 2010-08-12 Pavel Feldman <pfeldman@chromium.org> 2 6 -
trunk/WebCore/WebCore.gypi
r65241 r65245 4114 4114 'inspector/front-end/MetricsSidebarPane.js', 4115 4115 'inspector/front-end/Object.js', 4116 'inspector/front-end/ObjectProxy.js', 4116 4117 'inspector/front-end/ObjectPropertiesSection.js', 4117 4118 'inspector/front-end/Panel.js', … … 4124 4125 'inspector/front-end/PropertiesSection.js', 4125 4126 'inspector/front-end/PropertiesSidebarPane.js', 4126 'inspector/front-end/RemoteObject.js',4127 4127 'inspector/front-end/Resource.js', 4128 4128 'inspector/front-end/ResourceCategory.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r65241 r65245 51261 51261 </File> 51262 51262 <File 51263 RelativePath="..\inspector\front-end\ObjectProxy.js" 51264 > 51265 </File> 51266 <File 51263 51267 RelativePath="..\inspector\front-end\Panel.js" 51264 51268 > … … 51298 51302 <File 51299 51303 RelativePath="..\inspector\front-end\PropertiesSidebarPane.js" 51300 >51301 </File>51302 <File51303 RelativePath="..\inspector\front-end\RemoteObject.js"51304 51304 > 51305 51305 </File> -
trunk/WebCore/inspector/front-end/AuditRules.js
r65241 r65245 725 725 doRun: function(resources, result, callback) 726 726 { 727 function evalCallback(evalResult )728 { 729 if ( !evalResult)727 function evalCallback(evalResult, isException) 728 { 729 if (isException || !evalResult) 730 730 return callback(null); 731 731 … … 801 801 doRun: function(resources, result, callback) 802 802 { 803 function evalCallback(resultValue )804 { 805 if ( !resultValue)803 function evalCallback(resultValue, isException) 804 { 805 if (isException || !resultValue) 806 806 return callback(null); 807 807 -
trunk/WebCore/inspector/front-end/ConsoleView.js
r65241 r65245 512 512 function evalCallback(result) 513 513 { 514 callback( WebInspector.RemoteObject.fromPayload(result));514 callback(result.value, result.isException); 515 515 }; 516 516 InjectedScriptAccess.getDefault().evaluate(expression, objectGroup, evalCallback); … … 535 535 536 536 var self = this; 537 function printResult(result )537 function printResult(result, exception) 538 538 { 539 539 self.prompt.history.push(str); … … 543 543 WebInspector.applicationSettings.consoleHistory = self.prompt.history.slice(-30); 544 544 545 self.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));545 self.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage)); 546 546 } 547 547 this.evalInInspectedWindow(str, "console", printResult); … … 551 551 { 552 552 var isProxy = (output != null && typeof output === "object"); 553 var type = (forceObjectFormat ? "object" : WebInspector.RemoteObject.type(output));553 var type = (forceObjectFormat ? "object" : Object.proxyType(output)); 554 554 555 555 var formatter = this._customFormatters[type]; … … 590 590 } 591 591 592 InjectedScriptAccess.get(object. objectId.injectedScriptId).pushNodeToFrontend(object.objectId, printNode);592 InjectedScriptAccess.get(object.injectedScriptId).pushNodeToFrontend(object, printNode); 593 593 }, 594 594 595 595 _formatarray: function(arr, elem) 596 596 { 597 arr.getOwnProperties(false, this._printArray.bind(this, elem));597 InjectedScriptAccess.get(arr.injectedScriptId).getProperties(arr, false, false, this._printArray.bind(this, elem)); 598 598 }, 599 599 … … 638 638 _formatAsArrayEntry: function(output) 639 639 { 640 var type = Object.proxyType(output); 640 641 // Prevent infinite expansion of cross-referencing arrays. 641 return this._format(output, WebInspector.RemoteObject.type(output)=== "array");642 return this._format(output, type === "array"); 642 643 } 643 644 } … … 728 729 // Formatting code below assumes that parameters are all wrappers whereas frontend console 729 730 // API allows passing arbitrary values as messages (strings, numbers, etc.). Wrap them here. 730 for (var i = 0; i < parameters.length; ++i) { 731 if (typeof parameters[i] === "object") 732 parameters[i] = WebInspector.RemoteObject.fromPayload(parameters[i]); 733 else 734 parameters[i] = WebInspector.RemoteObject.fromPrimitiveValue(parameters[i]); 735 } 731 for (var i = 0; i < parameters.length; ++i) 732 if (typeof parameters[i] !== "object" && typeof parameters[i] !== "function") 733 parameters[i] = WebInspector.ObjectProxy.wrapPrimitiveValue(parameters[i]); 736 734 737 735 // There can be string log and string eval result. We distinguish between them based on message type. 738 var shouldFormatMessage = WebInspector.RemoteObject.type(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result;736 var shouldFormatMessage = Object.proxyType(parameters[0]) === "string" && this.type !== WebInspector.ConsoleMessage.MessageType.Result; 739 737 740 738 // Multiple parameters with the first being a format string. Save unused substitutions. … … 1051 1049 } 1052 1050 1053 WebInspector.ConsoleCommandResult = function(result, originatingCommand)1051 WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand) 1054 1052 { 1055 var level = (result.isError() ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log); 1053 var level = (exception ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log); 1054 var message = result; 1055 if (exception) { 1056 // Distinguish between strings and errors (no need to quote latter). 1057 message = WebInspector.ObjectProxy.wrapPrimitiveValue(result); 1058 message.type = "error"; 1059 } 1060 var line = (exception ? result.line : -1); 1061 var url = (exception ? result.sourceURL : null); 1062 1056 1063 this.originatingCommand = originatingCommand; 1057 WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, null, 1, null, [result]); 1064 1065 WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, line, url, null, 1, null, [message]); 1058 1066 } 1059 1067 -
trunk/WebCore/inspector/front-end/DOMAgent.js
r65241 r65245 34 34 35 35 this.id = payload.id; 36 // injectedScriptId is a node is for DOM nodes which should be converted 37 // to corresponding InjectedScript by the inspector backend. We indicate 38 // this by making injectedScriptId negative. 39 this.injectedScriptId = -payload.id; 36 40 this.nodeType = payload.nodeType; 37 41 this.nodeName = payload.nodeName; -
trunk/WebCore/inspector/front-end/ElementsPanel.js
r65241 r65245 256 256 this._searchQuery = query; 257 257 258 InspectorBackend.performSearch(whitespaceTrimmedQuery , false);258 InspectorBackend.performSearch(whitespaceTrimmedQuery); 259 259 }, 260 260 -
trunk/WebCore/inspector/front-end/ElementsTreeOutline.js
r65241 r65245 414 414 this.tooltip = WebInspector.UIString("%d × %d pixels (Natural: %d × %d pixels)", properties.offsetWidth, properties.offsetHeight, properties.naturalWidth, properties.naturalHeight); 415 415 } 416 WebInspector.RemoteObject.fromNode(node).getPropertyValueDescriptions(["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this)); 416 var objectProxy = new WebInspector.ObjectProxy(node.injectedScriptId, node.id); 417 WebInspector.ObjectProxy.getPropertiesAsync(objectProxy, ["naturalHeight", "naturalWidth", "offsetHeight", "offsetWidth"], setTooltip.bind(this)); 417 418 }, 418 419 -
trunk/WebCore/inspector/front-end/EventListenersSidebarPane.js
r65241 r65245 195 195 var value = this.eventListener[propertyName]; 196 196 if (value instanceof WebInspector.DOMNode) 197 value = WebInspector.RemoteObject.fromNode(value);197 value = new WebInspector.ObjectProxy(value.injectedScriptId, value.id, [], appropriateSelectorForNode(value), true); 198 198 else 199 value = WebInspector. RemoteObject.fromPrimitiveValue(value);200 properties.push(new WebInspector. RemoteObjectProperty(propertyName, value));199 value = WebInspector.ObjectProxy.wrapPrimitiveValue(value); 200 properties.push(new WebInspector.ObjectPropertyProxy(propertyName, value)); 201 201 } 202 202 this.updateProperties(properties); -
trunk/WebCore/inspector/front-end/InjectedScript.js
r65241 r65245 51 51 if (typeof object === "object" || typeof object === "function" || InjectedScript._isHTMLAllCollection(object)) { 52 52 var id = InjectedScript.lastBoundObjectId++; 53 objectId = id;54 InjectedScript.idToWrappedObject[ id] = object;53 objectId = "object#" + id; 54 InjectedScript.idToWrappedObject[objectId] = object; 55 55 56 56 var group = InjectedScript.objectGroups[objectGroupName]; … … 59 59 InjectedScript.objectGroups[objectGroupName] = group; 60 60 } 61 group.push(id); 62 objectId = new InjectedScript.RemoteObjectId("jsobject", id); 63 } 64 return InjectedScript.RemoteObject.fromObject(object, objectId); 61 group.push(objectId); 62 } 63 return InjectedScript.createProxyObject(object, objectId); 65 64 } catch (e) { 66 return InjectedScript.RemoteObject.fromObject("[ Exception: " + e.toString() + " ]"); 67 } 65 return InjectedScript.createProxyObject("[ Exception: " + e.toString() + " ]"); 66 } 67 return InjectedScript.createProxyObject(object, objectId); 68 68 }; 69 69 … … 111 111 } 112 112 113 InjectedScript.getProperties = function(object Id, ignoreHasOwnProperty, abbreviate)114 { 115 var object = InjectedScript._ objectForId(objectId);113 InjectedScript.getProperties = function(objectProxy, ignoreHasOwnProperty, abbreviate) 114 { 115 var object = InjectedScript._resolveObject(objectProxy); 116 116 if (!InjectedScript._isDefined(object)) 117 117 return false; … … 128 128 var property = {}; 129 129 property.name = propertyName + ""; 130 property.parentObjectProxy = objectProxy; 130 131 var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName); 131 132 if (!isGetter) { 132 133 try { 133 134 var childObject = object[propertyName]; 134 var path = objectId.path ? objectId.path.slice() : []; 135 path.push(propertyName); 136 var childObjectId = new InjectedScript.RemoteObjectId(objectId.type, objectId.value, path); 137 var childObjectProxy = new InjectedScript.RemoteObject.fromObject(childObject, childObjectId, abbreviate); 135 var childObjectProxy = new InjectedScript.createProxyObject(childObject, objectProxy.objectId, abbreviate); 136 childObjectProxy.path = objectProxy.path ? objectProxy.path.slice() : []; 137 childObjectProxy.path.push(propertyName); 138 138 property.value = childObjectProxy; 139 139 } catch(e) { 140 property.value = new InjectedScript.RemoteObject.fromException(e); 140 property.value = { description: e.toString() }; 141 property.isError = true; 141 142 } 142 143 } else { 143 144 // FIXME: this should show something like "getter" (bug 16734). 144 property.value = new InjectedScript.RemoteObject.fromObject("\u2014"); // em dash145 property.value = { description: "\u2014" }; // em dash 145 146 property.isGetter = true; 146 147 } … … 150 151 } 151 152 152 InjectedScript.setPropertyValue = function(object Id, propertyName, expression)153 { 154 var object = InjectedScript._ objectForId(objectId);153 InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression) 154 { 155 var object = InjectedScript._resolveObject(objectProxy); 155 156 if (!InjectedScript._isDefined(object)) 156 157 return false; … … 258 259 InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI) 259 260 { 261 var result = {}; 260 262 try { 261 return InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup); 263 result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup); 264 265 // Handle error that might have happened while describing result. 266 if (result.value.errorText) { 267 result.value = result.value.errorText; 268 result.isException = true; 269 } 262 270 } catch (e) { 263 return InjectedScript.RemoteObject.fromException(e); 264 } 271 result.value = e.toString(); 272 result.isException = true; 273 } 274 return result; 265 275 } 266 276 … … 333 343 } 334 344 345 InjectedScript._resolveObject = function(objectProxy) 346 { 347 var object = InjectedScript._objectForId(objectProxy.objectId); 348 var path = objectProxy.path; 349 350 // Follow the property path. 351 for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i) 352 object = object[path[i]]; 353 354 return object; 355 } 356 335 357 InjectedScript._nodeForId = function(nodeId) 336 358 { … … 346 368 // - strings point to console objects cached in InspectorController for lazy evaluation upon them 347 369 // - objects contain complex ids and are currently used for scoped objects 348 var object; 349 if (objectId.type === "node") 350 object = InjectedScript._nodeForId(objectId.value); 351 else if (objectId.type === "jsobject") 352 object = InjectedScript.unwrapObject(objectId.value); 353 else if (objectId.type === "scopeObject") { 354 var callFrame = InjectedScript._callFrameForId(objectId.value.callFrame); 370 if (typeof objectId === "number") 371 return InjectedScript._nodeForId(objectId); 372 else if (typeof objectId === "string") 373 return InjectedScript.unwrapObject(objectId); 374 else if (typeof objectId === "object") { 375 var callFrame = InjectedScript._callFrameForId(objectId.callFrame); 355 376 if (objectId.thisObject) 356 object =callFrame.thisObject;377 return callFrame.thisObject; 357 378 else 358 object = callFrame.scopeChain[objectId.value.chainIndex]; 359 } else 360 return objectId; 361 362 var path = objectId.path; 363 364 // Follow the property path. 365 for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i) 366 object = object[path[i]]; 367 368 return object; 369 } 370 371 InjectedScript.pushNodeToFrontend = function(objectId) 372 { 373 var object = InjectedScript._objectForId(objectId); 379 return callFrame.scopeChain[objectId.chainIndex]; 380 } 381 return objectId; 382 } 383 384 InjectedScript.pushNodeToFrontend = function(objectProxy) 385 { 386 var object = InjectedScript._resolveObject(objectProxy); 374 387 if (!object || InjectedScript._type(object) !== "node") 375 388 return false; … … 377 390 } 378 391 379 // FIXME: RemoteObjectId and RemoteObject structs must match the WebInspector.* ones. Should reuse same file instead. 380 InjectedScript.RemoteObjectId = function(type, value, path) 381 { 382 this.injectedScriptId = injectedScriptId; 383 this.type = type; 384 this.value = value; 385 this.path = path || []; 386 } 387 388 InjectedScript.RemoteObject = function(objectId, type, description, hasChildren) 389 { 390 this.objectId = objectId; 391 this.type = type; 392 this.description = description; 393 this.hasChildren = hasChildren; 394 } 395 396 InjectedScript.RemoteObject.fromException = function(e) 397 { 398 return new InjectedScript.RemoteObject(null, "error", e.toString()); 399 } 400 401 InjectedScript.RemoteObject.fromObject = function(object, objectId, abbreviate) 402 { 403 var type = InjectedScript._type(object); 404 var rawType = typeof object; 405 var hasChildren = (rawType === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || rawType === "function"; 406 var description = ""; 392 // Called from within InspectorController on the 'inspected page' side. 393 InjectedScript.createProxyObject = function(object, objectId, abbreviate) 394 { 395 var result = {}; 396 result.injectedScriptId = injectedScriptId; 397 result.objectId = objectId; 398 result.type = InjectedScript._type(object); 399 if (result.type === "array") 400 result.propertyLength = object.length; 401 402 var type = typeof object; 403 404 result.hasChildren = (type === "object" && object !== null && (Object.getOwnPropertyNames(object).length || !!object.__proto__)) || type === "function"; 407 405 try { 408 var description = InjectedScript._describe(object, abbreviate); 409 return new InjectedScript.RemoteObject(objectId, type, description, hasChildren); 406 result.description = InjectedScript._describe(object, abbreviate); 410 407 } catch (e) { 411 return InjectedScript.RemoteObject.fromException(e); 412 } 408 result.errorText = e.toString(); 409 } 410 return result; 413 411 } 414 412 … … 445 443 var scopeType = callFrame.scopeType(i); 446 444 var scopeObject = scopeChain[i]; 447 var scopeObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, chainIndex: i }); 448 var scopeObjectProxy = InjectedScript.RemoteObject.fromObject(scopeObject, scopeObjectId, true); 445 var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true); 449 446 450 447 switch(scopeType) { … … 452 449 foundLocalScope = true; 453 450 scopeObjectProxy.isLocal = true; 454 var thisObjectId = new InjectedScript.RemoteObjectId("scopeObject", { callFrame: this.id, thisObject: true }); 455 scopeObjectProxy.thisObject = InjectedScript.RemoteObject.fromObject(callFrame.thisObject, thisObjectId, true); 451 scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true); 456 452 break; 457 453 } … … 539 535 case "node": 540 536 case "array": 541 var className = InjectedScript._className(obj); 542 if (typeof obj.length === "number") 543 className += "[" + obj.length + "]"; 544 return className; 537 return InjectedScript._className(obj); 545 538 case "string": 546 539 if (!abbreviated) -
trunk/WebCore/inspector/front-end/ObjectPropertiesSection.js
r65241 r65245 51 51 self.updateProperties(properties); 52 52 }; 53 this.object.getProperties(this.ignoreHasOwnProperty, true, callback);53 InjectedScriptAccess.get(this.object.injectedScriptId).getProperties(this.object, this.ignoreHasOwnProperty, true, callback); 54 54 }, 55 55 … … 70 70 this.propertiesTreeOutline.removeChildren(); 71 71 72 for (var i = 0; i < properties.length; ++i) { 73 properties[i].parentObject = this.object; 72 for (var i = 0; i < properties.length; ++i) 74 73 this.propertiesTreeOutline.appendChild(new rootTreeElementConstructor(properties[i])); 75 }76 74 77 75 if (!this.propertiesTreeOutline.children.length) { … … 155 153 } 156 154 }; 157 this.property.value.getOwnProperties(true, callback.bind(this));155 InjectedScriptAccess.get(this.property.value.injectedScriptId).getProperties(this.property.value, false, true, callback.bind(this)); 158 156 }, 159 157 … … 181 179 this.valueElement.className = "value"; 182 180 this.valueElement.textContent = this.property.value.description; 181 if (typeof this.property.value.propertyLength !== "undefined") 182 this.valueElement.textContent += " (" + this.property.value.propertyLength + ")"; 183 183 if (this.property.isGetter) 184 184 this.valueElement.addStyleClass("dimmed"); 185 if (this.property. value.isError())185 if (this.property.isError) 186 186 this.valueElement.addStyleClass("error"); 187 187 … … 261 261 } 262 262 }; 263 this.property.parentObject.setPropertyValue(this.property.name, expression.trim(), callback);263 InjectedScriptAccess.get(this.property.parentObjectProxy.injectedScriptId).setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trim(), callback); 264 264 } 265 265 } -
trunk/WebCore/inspector/front-end/PropertiesSidebarPane.js
r65241 r65245 52 52 // Get array of prototype user-friendly names. 53 53 for (var i = 0; i < prototypes.length; ++i) { 54 var prototype = new WebInspector. RemoteObject.fromNode(node, path.slice());54 var prototype = new WebInspector.ObjectProxy(node.injectedScriptId, node.id, path.slice()); 55 55 var section = new WebInspector.ObjectPropertiesSection(prototype, prototypes[i], WebInspector.UIString("Prototype")); 56 56 self.sections.push(section); … … 59 59 } 60 60 }; 61 InjectedScriptAccess.get( -node.id).getPrototypes(node.id, callback);61 InjectedScriptAccess.get(node.injectedScriptId).getPrototypes(node.id, callback); 62 62 } 63 63 } -
trunk/WebCore/inspector/front-end/ScopeChainSidebarPane.js
r65241 r65245 61 61 subtitle = null; 62 62 if (scopeObjectProxy.thisObject) 63 extraProperties = [ new WebInspector. RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(scopeObjectProxy.thisObject)) ];63 extraProperties = [ new WebInspector.ObjectPropertyProxy("this", scopeObjectProxy.thisObject) ]; 64 64 } else if (scopeObjectProxy.isClosure) { 65 65 title = WebInspector.UIString("Closure"); … … 78 78 subtitle = null; 79 79 80 var section = new WebInspector.ObjectPropertiesSection( WebInspector.RemoteObject.fromPayload(scopeObjectProxy), title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement);80 var section = new WebInspector.ObjectPropertiesSection(scopeObjectProxy, title, subtitle, emptyPlaceholder, true, extraProperties, WebInspector.ScopeVariableTreeElement); 81 81 section.editInSelectedCallFrameWhenPaused = true; 82 82 section.pane = this; -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r65241 r65245 388 388 389 389 var self = this; 390 function updatingCallbackWrapper(result )390 function updatingCallbackWrapper(result, exception) 391 391 { 392 callback(result );392 callback(result, exception); 393 393 if (updateInterface) 394 394 self.sidebarPanes.scopechain.update(selectedCallFrame); … … 402 402 { 403 403 if (result) 404 callback( WebInspector.RemoteObject.fromPayload(result));404 callback(result.value, result.isException); 405 405 } 406 406 InjectedScriptAccess.get(callFrame.injectedScriptId).evaluateInCallFrame(callFrame.id, code, objectGroup, evalCallback); -
trunk/WebCore/inspector/front-end/SourceFrame.js
r65241 r65245 626 626 } 627 627 628 function evaluateCallback(result )628 function evaluateCallback(result, exception) 629 629 { 630 if ( result.isError())630 if (exception) 631 631 return; 632 632 if (!WebInspector.panels.scripts.paused) … … 700 700 701 701 var expression = selection.getRangeAt(0).toString().trim(); 702 WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result ) {702 WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result, exception) { 703 703 WebInspector.showConsole(); 704 704 var commandMessage = new WebInspector.ConsoleCommand(expression); 705 705 WebInspector.console.addMessage(commandMessage); 706 WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, commandMessage));706 WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(result, exception, commandMessage)); 707 707 }); 708 708 }, -
trunk/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
r65241 r65245 91 91 update: function() 92 92 { 93 function appendResult(expression, watchIndex, result )93 function appendResult(expression, watchIndex, result, exception) 94 94 { 95 var property = new WebInspector.RemoteObjectProperty(expression, result); 95 if (exception) { 96 // Exception results are not wrappers, but text messages. 97 result = WebInspector.ObjectProxy.wrapPrimitiveValue(result); 98 } else if (result.type === "string") { 99 // Evaluation result is intentionally not abbreviated. However, we'd like to distinguish between null and "null" 100 result.description = "\"" + result.description + "\""; 101 } 102 103 var property = new WebInspector.ObjectPropertyProxy(expression, result); 96 104 property.watchIndex = watchIndex; 105 property.isException = exception; 106 107 // For newly added, empty expressions, set description to "", 108 // since otherwise you get DOMWindow 109 if (property.name === WebInspector.WatchExpressionsSection.NewWatchExpression) 110 property.value.description = ""; 97 111 98 112 // To clarify what's going on here: … … 209 223 WebInspector.ObjectPropertyTreeElement.prototype.update.call(this); 210 224 211 if (this.property. value.isError())225 if (this.property.isException) 212 226 this.valueElement.addStyleClass("watch-expressions-error-level"); 213 227 -
trunk/WebCore/inspector/front-end/WebKit.qrc
r65241 r65245 53 53 <file>Object.js</file> 54 54 <file>ObjectPropertiesSection.js</file> 55 <file>ObjectProxy.js</file> 55 56 <file>Panel.js</file> 56 57 <file>PanelEnablerView.js</file> … … 62 63 <file>PropertiesSection.js</file> 63 64 <file>PropertiesSidebarPane.js</file> 64 <file>RemoteObject.js</file>65 65 <file>Resource.js</file> 66 66 <file>ResourceCategory.js</file> -
trunk/WebCore/inspector/front-end/inspector.html
r65241 r65245 74 74 <script type="text/javascript" src="Section.js"></script> 75 75 <script type="text/javascript" src="PropertiesSection.js"></script> 76 <script type="text/javascript" src=" RemoteObject.js"></script>76 <script type="text/javascript" src="ObjectProxy.js"></script> 77 77 <script type="text/javascript" src="ObjectPropertiesSection.js"></script> 78 78 <script type="text/javascript" src="BreakpointsSidebarPane.js"></script> -
trunk/WebCore/inspector/front-end/inspector.js
r65241 r65245 1468 1468 var self = this; 1469 1469 1470 // return indication if we can actually log a message 1471 function isLogAvailable() 1472 { 1473 return WebInspector.ConsoleMessage && WebInspector.ObjectProxy && self.console; 1474 } 1475 1470 1476 // flush the queue of pending messages 1471 1477 function flushQueue() … … 1505 1511 1506 1512 // ConsoleMessage expects a proxy object 1507 message = new WebInspector. RemoteObject.fromPrimitiveValue(message);1513 message = new WebInspector.ObjectProxy(null, null, [], message, false); 1508 1514 1509 1515 // post the message -
trunk/WebCore/inspector/front-end/utilities.js
r65241 r65245 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 Object.proxyType = function(objectProxy) 30 { 31 if (objectProxy === null) 32 return "null"; 33 34 var type = typeof objectProxy; 35 if (type !== "object" && type !== "function") 36 return type; 37 38 return objectProxy.type; 39 } 28 40 29 41 Object.properties = function(obj) … … 836 848 d: function(substitution) 837 849 { 838 if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")850 if (typeof substitution == "object" && Object.proxyType(substitution) === "number") 839 851 substitution = substitution.description; 840 852 substitution = parseInt(substitution); … … 844 856 f: function(substitution, token) 845 857 { 846 if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) === "number")858 if (typeof substitution == "object" && Object.proxyType(substitution) === "number") 847 859 substitution = substitution.description; 848 860 substitution = parseFloat(substitution); … … 854 866 s: function(substitution) 855 867 { 856 if (typeof substitution == "object" && WebInspector.RemoteObject.type(substitution) !== "null")868 if (typeof substitution == "object" && Object.proxyType(substitution) !== "null") 857 869 substitution = substitution.description; 858 870 return substitution;
Note: See TracChangeset
for help on using the changeset viewer.