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

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

Issue 2474073005: DevTools: add the logging aspect into the PerformanceMonitor (Closed)
Patch Set: test fixed Created 4 years, 1 month 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: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index 9006c4e812fef84262178767b0c17eac08430193..62f9f08056410753e7ea290c147a905a6a87aab6 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -511,7 +511,8 @@ WebInspector.ConsoleView = class extends WebInspector.VBox {
*/
_appendMessageToEnd(viewMessage) {
if (!this._filter.shouldBeVisible(viewMessage)) {
- this._hiddenByFilterCount++;
+ if (this._filter.shouldBeVisibleByDefault(viewMessage))
+ this._hiddenByFilterCount++;
return;
}
@@ -1070,11 +1071,15 @@ WebInspector.ConsoleViewFilter = class extends WebInspector.Object {
filterBar.addFilter(this._textFilterUI);
this._hideNetworkMessagesCheckbox = new WebInspector.CheckboxFilterUI(
- 'hide-network-messages', WebInspector.UIString('Hide network messages'), true,
+ '', WebInspector.UIString('Hide network'), true,
WebInspector.moduleSetting('hideNetworkMessages'));
- this._hideNetworkMessagesCheckbox.addEventListener(
- WebInspector.FilterUI.Events.FilterChanged, this._filterChanged.bind(this), this);
+ this._hideViolationMessagesCheckbox = new WebInspector.CheckboxFilterUI(
+ '', WebInspector.UIString('Hide violations'), false,
+ WebInspector.moduleSetting('hideViolationMessages'));
+ WebInspector.moduleSetting('hideNetworkMessages').addChangeListener(this._filterChanged, this);
+ WebInspector.moduleSetting('hideViolationMessages').addChangeListener(this._filterChanged, this);
filterBar.addFilter(this._hideNetworkMessagesCheckbox);
+ filterBar.addFilter(this._hideViolationMessagesCheckbox);
var levels = [
{name: WebInspector.ConsoleMessage.MessageLevel.Error, label: WebInspector.UIString('Errors')},
@@ -1146,6 +1151,10 @@ WebInspector.ConsoleViewFilter = class extends WebInspector.Object {
viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.MessageSource.Network)
return false;
+ if (WebInspector.moduleSetting('hideViolationMessages').get() &&
+ viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.MessageSource.Violation)
+ return false;
+
if (viewMessage.consoleMessage().isGroupMessage())
return true;
@@ -1168,12 +1177,21 @@ WebInspector.ConsoleViewFilter = class extends WebInspector.Object {
return true;
}
+ /**
+ * @return {boolean}
+ */
+ shouldBeVisibleByDefault(viewMessage) {
+ return viewMessage.consoleMessage().source !==
+ WebInspector.ConsoleMessage.MessageSource.Violation;
+ }
+
reset() {
this._messageURLFilters = {};
this._messageURLFiltersSetting.set(this._messageURLFilters);
this._messageLevelFiltersSetting.set({});
this._view._showAllMessagesCheckbox.inputElement.checked = true;
WebInspector.moduleSetting('hideNetworkMessages').set(false);
+ WebInspector.moduleSetting('hideViolationMessages').set(true);
this._textFilterUI.setValue('');
this._filterChanged();
}

Powered by Google App Engine
This is Rietveld 408576698