Index: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
index bf764a52096169df731f5bea8c61e9ae39a9b900..ba2ab8420ccbb2501dcbce5259aa6907508bfc44 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
@@ -412,6 +412,49 @@ WebInspector.RuntimeDispatcher.prototype = { |
/** |
* @override |
+ * @param {string} type |
+ * @param {!Array.<!RuntimeAgent.RemoteObject>} args |
+ * @param {number} executionContextId |
+ * @param {number} timestamp |
+ * @param {!RuntimeAgent.StackTrace=} stackTrace |
+ */ |
+ consoleAPICalled: function(type, args, executionContextId, timestamp, stackTrace) |
+ { |
+ var level = WebInspector.ConsoleMessage.MessageLevel.Log; |
+ if (type === WebInspector.ConsoleMessage.MessageType.Debug) |
+ level = WebInspector.ConsoleMessage.MessageLevel.Debug; |
+ if (type === WebInspector.ConsoleMessage.MessageType.Error || type === WebInspector.ConsoleMessage.MessageType.Assert) |
+ level = WebInspector.ConsoleMessage.MessageLevel.Error; |
+ if (type === WebInspector.ConsoleMessage.MessageType.Warning) |
+ level = WebInspector.ConsoleMessage.MessageLevel.Warning; |
+ if (type === WebInspector.ConsoleMessage.MessageType.Info) |
+ level = WebInspector.ConsoleMessage.MessageLevel.Info; |
+ var message = ""; |
+ if (args.length && typeof args[0].value === "string") |
+ message = args[0].value; |
+ else if (args.length && args[0].description) |
+ message = args[0].description; |
+ var callFrame = stackTrace && stackTrace.callFrames.length ? stackTrace.callFrames[0] : null; |
+ var consoleMessage = new WebInspector.ConsoleMessage( |
+ this._runtimeModel.target(), |
+ WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, |
+ level, |
+ /** @type {string} */ (message), |
+ type, |
+ callFrame ? callFrame.url : undefined, |
+ callFrame ? callFrame.lineNumber + 1 : undefined, |
+ callFrame ? callFrame.columnNumber + 1 : undefined, |
+ undefined, |
+ args, |
+ stackTrace, |
+ timestamp, |
+ executionContextId, |
+ undefined); |
+ this._runtimeModel.target().consoleModel.addMessage(consoleMessage); |
+ }, |
+ |
+ /** |
+ * @override |
* @param {!RuntimeAgent.RemoteObject} payload |
* @param {!Object=} hints |
*/ |