Chromium Code Reviews| Index: Source/devtools/front_end/ConsoleModel.js |
| diff --git a/Source/devtools/front_end/ConsoleModel.js b/Source/devtools/front_end/ConsoleModel.js |
| index cd40513967a322def871d3ae94b53ce2d7a06c99..f93ccce8352d0f6dcebce62fd257f9cdc74348e4 100644 |
| --- a/Source/devtools/front_end/ConsoleModel.js |
| +++ b/Source/devtools/front_end/ConsoleModel.js |
| @@ -39,7 +39,6 @@ WebInspector.ConsoleModel = function(target) |
| this.messages = []; |
| this.warnings = 0; |
| this.errors = 0; |
| - this._interruptRepeatCount = false; |
| this._target = target; |
| this._consoleAgent = target.consoleAgent(); |
| target.registerConsoleDispatcher(new WebInspector.ConsoleDispatcher(this)); |
| @@ -49,7 +48,6 @@ WebInspector.ConsoleModel = function(target) |
| WebInspector.ConsoleModel.Events = { |
| ConsoleCleared: "ConsoleCleared", |
| MessageAdded: "MessageAdded", |
| - RepeatCountUpdated: "RepeatCountUpdated", |
| CommandEvaluated: "CommandEvaluated", |
| } |
| @@ -92,11 +90,6 @@ WebInspector.ConsoleModel.prototype = { |
| this.messages.push(msg); |
| this._incrementErrorWarningCount(msg); |
| - if (isFromBackend) |
| - this._previousMessage = msg; |
| - |
| - this._interruptRepeatCount = !isFromBackend; |
| - |
| this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageAdded, msg); |
| }, |
| @@ -174,10 +167,10 @@ WebInspector.ConsoleModel.prototype = { |
| { |
| switch (msg.level) { |
| case WebInspector.ConsoleMessage.MessageLevel.Warning: |
| - this.warnings += msg.repeatDelta; |
| + this.warnings += 1; |
|
pfeldman
2014/03/25 13:09:32
++
sergeyv
2014/03/25 13:42:56
Done.
|
| break; |
| case WebInspector.ConsoleMessage.MessageLevel.Error: |
| - this.errors += msg.repeatDelta; |
| + this.errors += 1; |
| break; |
| } |
| }, |
| @@ -193,39 +186,10 @@ WebInspector.ConsoleModel.prototype = { |
| this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCleared); |
| this.messages = []; |
| - delete this._previousMessage; |
| - |
| this.errors = 0; |
| this.warnings = 0; |
| }, |
| - /** |
| - * @param {number} count |
| - */ |
| - _messageRepeatCountUpdated: function(count) |
| - { |
| - var msg = this._previousMessage; |
| - if (!msg) |
| - return; |
| - |
| - var prevRepeatCount = msg.totalRepeatCount; |
| - |
| - if (!this._interruptRepeatCount) { |
| - msg.repeatDelta = count - prevRepeatCount; |
| - msg.repeatCount = msg.repeatCount + msg.repeatDelta; |
| - msg.totalRepeatCount = count; |
| - |
| - this._incrementErrorWarningCount(msg); |
| - this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.RepeatCountUpdated, msg); |
| - } else { |
| - var msgCopy = msg.clone(); |
| - msgCopy.totalRepeatCount = count; |
| - msgCopy.repeatCount = (count - prevRepeatCount) || 1; |
| - msgCopy.repeatDelta = msgCopy.repeatCount; |
| - this.addMessage(msgCopy, true); |
| - } |
| - }, |
| - |
| __proto__: WebInspector.Object.prototype |
| } |
| @@ -238,13 +202,12 @@ WebInspector.ConsoleModel.prototype = { |
| * @param {?string=} url |
| * @param {number=} line |
| * @param {number=} column |
| - * @param {number=} repeatCount |
| * @param {!NetworkAgent.RequestId=} requestId |
| * @param {!Array.<!RuntimeAgent.RemoteObject>=} parameters |
| * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace |
| * @param {boolean=} isOutdated |
| */ |
| -WebInspector.ConsoleMessage = function(source, level, messageText, type, url, line, column, repeatCount, requestId, parameters, stackTrace, isOutdated) |
| +WebInspector.ConsoleMessage = function(source, level, messageText, type, url, line, column, requestId, parameters, stackTrace, isOutdated) |
| { |
| this.source = source; |
| this.level = level; |
| @@ -256,15 +219,21 @@ WebInspector.ConsoleMessage = function(source, level, messageText, type, url, li |
| this.parameters = parameters; |
| this.stackTrace = stackTrace; |
| this.isOutdated = isOutdated; |
| - |
| - repeatCount = repeatCount || 1; |
| - this.repeatCount = repeatCount; |
| - this.repeatDelta = repeatCount; |
| - this.totalRepeatCount = repeatCount; |
| this.request = requestId ? WebInspector.networkLog.requestForId(requestId) : null; |
| } |
| WebInspector.ConsoleMessage.prototype = { |
| + |
| + /** |
| + * @return {boolean} |
| + */ |
| + isGroupMessage: function() |
| + { |
| + return this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || |
| + this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed || |
| + this.type === WebInspector.ConsoleMessage.MessageType.EndGroup; |
| + }, |
| + |
| /** |
| * @return {boolean} |
| */ |
| @@ -286,7 +255,6 @@ WebInspector.ConsoleMessage.prototype = { |
| this.url, |
| this.line, |
| this.column, |
| - this.repeatCount, |
| this.request ? this.request.requestId : undefined, |
| this.parameters, |
| this.stackTrace, |
| @@ -294,6 +262,27 @@ WebInspector.ConsoleMessage.prototype = { |
| }, |
| /** |
| + * @param {!Array.<!RuntimeAgent.RemoteObject>=} parameters |
| + * @return {boolean} |
| + */ |
| + _equalParameters: function(parameters) |
| + { |
| + if (!this.parameters && !parameters) |
| + return true; |
| + |
| + if (!this.parameters || !parameters || this.parameters.length !== parameters.length) |
| + return false; |
| + |
| + for (var i = 0; i < parameters.length; ++i) { |
| + // Never treat objects as equal - their properties might change over time. |
| + if (this.parameters[i].type !== parameters[i].type || parameters[i].type === "object" || this.parameters[i].value !== parameters[i].value) |
| + return false; |
| + } |
| + |
| + return true; |
| + }, |
| + |
| + /** |
| * @param {?WebInspector.ConsoleMessage} msg |
| * @return {boolean} |
| */ |
| @@ -324,7 +313,7 @@ WebInspector.ConsoleMessage.prototype = { |
| && (this.line === msg.line) |
| && (this.url === msg.url) |
| && (this.messageText === msg.messageText) |
| - && (this.request === msg.request); |
| + && (this.request === msg.request) && this._equalParameters(msg.parameters); |
|
pfeldman
2014/03/25 13:09:32
inline.
sergeyv
2014/03/25 13:42:56
Done.
|
| } |
| } |
| @@ -401,7 +390,6 @@ WebInspector.ConsoleDispatcher.prototype = { |
| payload.url, |
| payload.line, |
| payload.column, |
| - payload.repeatCount, |
| payload.networkRequestId, |
| payload.parameters, |
| payload.stackTrace, |
| @@ -412,10 +400,7 @@ WebInspector.ConsoleDispatcher.prototype = { |
| /** |
| * @param {number} count |
| */ |
| - messageRepeatCountUpdated: function(count) |
| - { |
| - this._console._messageRepeatCountUpdated(count); |
| - }, |
| + messageRepeatCountUpdated: function(count){}, |
|
pfeldman
2014/03/25 13:09:32
)
{
},
sergeyv
2014/03/25 13:42:56
Done.
|
| messagesCleared: function() |
| { |