summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/ConsoleView.js
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-24 07:50:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-24 07:50:47 -0700
commitc570a147a94b126d4172c30914f53dea17b4c8f5 (patch)
tree99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /WebCore/inspector/front-end/ConsoleView.js
parentc952714bc6809a5ad081baaf9fcc04107b92ea3f (diff)
parent6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff)
downloadexternal_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip
external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz
external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes: Merge WebKit at r65615 : Update WebKit revision number Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html Merge WebKit at r65615 : Android-specific results for Geolocation tests. Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer. Merge WebKit at r65615 : processingUserGesture() is now static. Merge WebKit at r65615 : UTF8String() becomes utf8(). Merge WebKit at r65615 : Fix include paths for string headers. Merge WebKit at r65615 : Fix Makefiles. Merge WebKit at r65615 : Fix conflicts. Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'WebCore/inspector/front-end/ConsoleView.js')
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js46
1 files changed, 19 insertions, 27 deletions
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 6a4e0d3..474c362 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -296,7 +296,7 @@ WebInspector.ConsoleView.prototype = {
requestClearMessages: function()
{
- InspectorBackend.clearConsoleMessages(WebInspector.Callback.wrap(this.clearMessages.bind(this)));
+ InspectorBackend.clearConsoleMessages();
},
clearMessages: function()
@@ -342,7 +342,7 @@ WebInspector.ConsoleView.prototype = {
var injectedScriptAccess;
if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) {
var selectedCallFrame = WebInspector.panels.scripts.sidebarPanes.callstack.selectedCallFrame;
- injectedScriptAccess = InjectedScriptAccess.get(selectedCallFrame.injectedScriptId);
+ injectedScriptAccess = InjectedScriptAccess.get(selectedCallFrame.worldId);
} else
injectedScriptAccess = InjectedScriptAccess.getDefault();
injectedScriptAccess.getCompletions(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions);
@@ -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);
+ object.pushNodeToFrontend(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 = {