Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2243)

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 1095943002: DevTools: [console] Logged promise rejections do not change state once handled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: for landing Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index 676ab02384638028e793f59677797057ebefcfa4..e61462d485257af1bbc291b4ac24cd2f84cd3543 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -136,6 +136,7 @@ WebInspector.ConsoleView = function()
/** @type {!Array.<!WebInspector.ConsoleViewMessage>} */
this._consoleMessages = [];
+ this._viewMessageSymbol = Symbol("viewMessage");
this._prompt = new WebInspector.TextPromptWithHistory(WebInspector.ExecutionContextSelector.completionsForTextPromptInCurrentContext);
this._prompt.setSuggestBoxEnabled(true);
@@ -206,6 +207,7 @@ WebInspector.ConsoleView.prototype = {
{
WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this);
+ WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated, this._onConsoleMessageUpdated, this);
WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this);
WebInspector.multitargetConsoleModel.messages().forEach(this._addConsoleMessage, this);
},
@@ -560,6 +562,7 @@ WebInspector.ConsoleView.prototype = {
if (message.type === WebInspector.ConsoleMessage.MessageType.Command || message.type === WebInspector.ConsoleMessage.MessageType.Result)
message.timestamp = this._consoleMessages.length ? this._consoleMessages.peekLast().consoleMessage().timestamp : 0;
var viewMessage = this._createViewMessage(message);
+ message[this._viewMessageSymbol] = viewMessage;
var insertAt = insertionIndexForObjectInListSortedByFunction(viewMessage, this._consoleMessages, compareTimestamps, true);
var insertedInMiddle = insertAt < this._consoleMessages.length;
this._consoleMessages.splice(insertAt, 0, viewMessage);
@@ -582,6 +585,19 @@ WebInspector.ConsoleView.prototype = {
},
/**
+ * @param {!WebInspector.Event} event
+ */
+ _onConsoleMessageUpdated: function(event)
+ {
+ var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data);
+ var viewMessage = message[this._viewMessageSymbol];
+ if (viewMessage) {
+ viewMessage.updateMessageElement();
+ this._updateMessageList();
+ }
+ },
+
+ /**
* @param {!WebInspector.ConsoleViewMessage} viewMessage
*/
_consoleMessageAddedForTest: function(viewMessage) { },
@@ -1156,11 +1172,12 @@ WebInspector.ConsoleViewFilter.prototype = {
filterBar.addFilter(this._textFilterUI);
var levels = [
- {name: "error", label: WebInspector.UIString("Errors")},
- {name: "warning", label: WebInspector.UIString("Warnings")},
- {name: "info", label: WebInspector.UIString("Info")},
- {name: "log", label: WebInspector.UIString("Logs")},
- {name: "debug", label: WebInspector.UIString("Debug")}
+ {name: WebInspector.ConsoleMessage.MessageLevel.Error, label: WebInspector.UIString("Errors")},
+ {name: WebInspector.ConsoleMessage.MessageLevel.Warning, label: WebInspector.UIString("Warnings")},
+ {name: WebInspector.ConsoleMessage.MessageLevel.Info, label: WebInspector.UIString("Info")},
+ {name: WebInspector.ConsoleMessage.MessageLevel.Log, label: WebInspector.UIString("Logs")},
+ {name: WebInspector.ConsoleMessage.MessageLevel.Debug, label: WebInspector.UIString("Debug")},
+ {name: WebInspector.ConsoleMessage.MessageLevel.RevokedError, label: WebInspector.UIString("Handled")}
];
this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, this._messageLevelFiltersSetting);
this._levelFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._filterChanged, this);

Powered by Google App Engine
This is Rietveld 408576698