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

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

Issue 2490563002: Revert of DevTools: add the logging aspect into the PerformanceMonitor (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 * @param {!WebInspector.ConsoleViewMessage} viewMessage 504 * @param {!WebInspector.ConsoleViewMessage} viewMessage
505 */ 505 */
506 _consoleMessageAddedForTest(viewMessage) { 506 _consoleMessageAddedForTest(viewMessage) {
507 } 507 }
508 508
509 /** 509 /**
510 * @param {!WebInspector.ConsoleViewMessage} viewMessage 510 * @param {!WebInspector.ConsoleViewMessage} viewMessage
511 */ 511 */
512 _appendMessageToEnd(viewMessage) { 512 _appendMessageToEnd(viewMessage) {
513 if (!this._filter.shouldBeVisible(viewMessage)) { 513 if (!this._filter.shouldBeVisible(viewMessage)) {
514 if (this._filter.shouldBeVisibleByDefault(viewMessage)) 514 this._hiddenByFilterCount++;
515 this._hiddenByFilterCount++;
516 return; 515 return;
517 } 516 }
518 517
519 if (this._tryToCollapseMessages(viewMessage, this._visibleViewMessages.peekL ast())) 518 if (this._tryToCollapseMessages(viewMessage, this._visibleViewMessages.peekL ast()))
520 return; 519 return;
521 520
522 var lastMessage = this._visibleViewMessages.peekLast(); 521 var lastMessage = this._visibleViewMessages.peekLast();
523 if (viewMessage.consoleMessage().type === WebInspector.ConsoleMessage.Messag eType.EndGroup) { 522 if (viewMessage.consoleMessage().type === WebInspector.ConsoleMessage.Messag eType.EndGroup) {
524 if (lastMessage && !this._currentGroup.messagesHidden()) 523 if (lastMessage && !this._currentGroup.messagesHidden())
525 lastMessage.incrementCloseGroupDecorationCount(); 524 lastMessage.incrementCloseGroupDecorationCount();
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 this._messageURLFilters = this._messageURLFiltersSetting.get(); 1063 this._messageURLFilters = this._messageURLFiltersSetting.get();
1065 this._filterChanged = this.dispatchEventToListeners.bind(this, WebInspector. ConsoleViewFilter.Events.FilterChanged); 1064 this._filterChanged = this.dispatchEventToListeners.bind(this, WebInspector. ConsoleViewFilter.Events.FilterChanged);
1066 } 1065 }
1067 1066
1068 addFilters(filterBar) { 1067 addFilters(filterBar) {
1069 this._textFilterUI = new WebInspector.TextFilterUI(true); 1068 this._textFilterUI = new WebInspector.TextFilterUI(true);
1070 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChang ed, this._textFilterChanged, this); 1069 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChang ed, this._textFilterChanged, this);
1071 filterBar.addFilter(this._textFilterUI); 1070 filterBar.addFilter(this._textFilterUI);
1072 1071
1073 this._hideNetworkMessagesCheckbox = new WebInspector.CheckboxFilterUI( 1072 this._hideNetworkMessagesCheckbox = new WebInspector.CheckboxFilterUI(
1074 '', WebInspector.UIString('Hide network'), true, 1073 'hide-network-messages', WebInspector.UIString('Hide network messages'), true,
1075 WebInspector.moduleSetting('hideNetworkMessages')); 1074 WebInspector.moduleSetting('hideNetworkMessages'));
1076 this._hideViolationMessagesCheckbox = new WebInspector.CheckboxFilterUI( 1075 this._hideNetworkMessagesCheckbox.addEventListener(
1077 '', WebInspector.UIString('Hide violations'), false, 1076 WebInspector.FilterUI.Events.FilterChanged, this._filterChanged.bind(thi s), this);
1078 WebInspector.moduleSetting('hideViolationMessages'));
1079 WebInspector.moduleSetting('hideNetworkMessages').addChangeListener(this._fi lterChanged, this);
1080 WebInspector.moduleSetting('hideViolationMessages').addChangeListener(this._ filterChanged, this);
1081 filterBar.addFilter(this._hideNetworkMessagesCheckbox); 1077 filterBar.addFilter(this._hideNetworkMessagesCheckbox);
1082 filterBar.addFilter(this._hideViolationMessagesCheckbox);
1083 1078
1084 var levels = [ 1079 var levels = [
1085 {name: WebInspector.ConsoleMessage.MessageLevel.Error, label: WebInspector .UIString('Errors')}, 1080 {name: WebInspector.ConsoleMessage.MessageLevel.Error, label: WebInspector .UIString('Errors')},
1086 {name: WebInspector.ConsoleMessage.MessageLevel.Warning, label: WebInspect or.UIString('Warnings')}, 1081 {name: WebInspector.ConsoleMessage.MessageLevel.Warning, label: WebInspect or.UIString('Warnings')},
1087 {name: WebInspector.ConsoleMessage.MessageLevel.Info, label: WebInspector. UIString('Info')}, 1082 {name: WebInspector.ConsoleMessage.MessageLevel.Info, label: WebInspector. UIString('Info')},
1088 {name: WebInspector.ConsoleMessage.MessageLevel.Log, label: WebInspector.U IString('Logs')}, 1083 {name: WebInspector.ConsoleMessage.MessageLevel.Log, label: WebInspector.U IString('Logs')},
1089 {name: WebInspector.ConsoleMessage.MessageLevel.Debug, label: WebInspector .UIString('Debug')}, 1084 {name: WebInspector.ConsoleMessage.MessageLevel.Debug, label: WebInspector .UIString('Debug')},
1090 {name: WebInspector.ConsoleMessage.MessageLevel.RevokedError, label: WebIn spector.UIString('Handled')} 1085 {name: WebInspector.ConsoleMessage.MessageLevel.RevokedError, label: WebIn spector.UIString('Handled')}
1091 ]; 1086 ];
1092 this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, this._mes sageLevelFiltersSetting); 1087 this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, this._mes sageLevelFiltersSetting);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 return false; 1139 return false;
1145 if (message.executionContextId && message.executionContextId !== execution Context.id) { 1140 if (message.executionContextId && message.executionContextId !== execution Context.id) {
1146 return false; 1141 return false;
1147 } 1142 }
1148 } 1143 }
1149 1144
1150 if (WebInspector.moduleSetting('hideNetworkMessages').get() && 1145 if (WebInspector.moduleSetting('hideNetworkMessages').get() &&
1151 viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.Mess ageSource.Network) 1146 viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.Mess ageSource.Network)
1152 return false; 1147 return false;
1153 1148
1154 if (WebInspector.moduleSetting('hideViolationMessages').get() &&
1155 viewMessage.consoleMessage().source === WebInspector.ConsoleMessage.Mess ageSource.Violation)
1156 return false;
1157
1158 if (viewMessage.consoleMessage().isGroupMessage()) 1149 if (viewMessage.consoleMessage().isGroupMessage())
1159 return true; 1150 return true;
1160 1151
1161 if (message.type === WebInspector.ConsoleMessage.MessageType.Result || 1152 if (message.type === WebInspector.ConsoleMessage.MessageType.Result ||
1162 message.type === WebInspector.ConsoleMessage.MessageType.Command) 1153 message.type === WebInspector.ConsoleMessage.MessageType.Command)
1163 return true; 1154 return true;
1164 1155
1165 if (message.url && this._messageURLFilters[message.url]) 1156 if (message.url && this._messageURLFilters[message.url])
1166 return false; 1157 return false;
1167 1158
1168 if (message.level && !this._levelFilterUI.accept(message.level)) 1159 if (message.level && !this._levelFilterUI.accept(message.level))
1169 return false; 1160 return false;
1170 1161
1171 if (this._filterRegex) { 1162 if (this._filterRegex) {
1172 this._filterRegex.lastIndex = 0; 1163 this._filterRegex.lastIndex = 0;
1173 if (!viewMessage.matchesFilterRegex(this._filterRegex)) 1164 if (!viewMessage.matchesFilterRegex(this._filterRegex))
1174 return false; 1165 return false;
1175 } 1166 }
1176 1167
1177 return true; 1168 return true;
1178 } 1169 }
1179 1170
1180 /**
1181 * @return {boolean}
1182 */
1183 shouldBeVisibleByDefault(viewMessage) {
1184 return viewMessage.consoleMessage().source !==
1185 WebInspector.ConsoleMessage.MessageSource.Violation;
1186 }
1187
1188 reset() { 1171 reset() {
1189 this._messageURLFilters = {}; 1172 this._messageURLFilters = {};
1190 this._messageURLFiltersSetting.set(this._messageURLFilters); 1173 this._messageURLFiltersSetting.set(this._messageURLFilters);
1191 this._messageLevelFiltersSetting.set({}); 1174 this._messageLevelFiltersSetting.set({});
1192 this._view._showAllMessagesCheckbox.inputElement.checked = true; 1175 this._view._showAllMessagesCheckbox.inputElement.checked = true;
1193 WebInspector.moduleSetting('hideNetworkMessages').set(false); 1176 WebInspector.moduleSetting('hideNetworkMessages').set(false);
1194 WebInspector.moduleSetting('hideViolationMessages').set(true);
1195 this._textFilterUI.setValue(''); 1177 this._textFilterUI.setValue('');
1196 this._filterChanged(); 1178 this._filterChanged();
1197 } 1179 }
1198 }; 1180 };
1199 1181
1200 /** @enum {symbol} */ 1182 /** @enum {symbol} */
1201 WebInspector.ConsoleViewFilter.Events = { 1183 WebInspector.ConsoleViewFilter.Events = {
1202 FilterChanged: Symbol('FilterChanged') 1184 FilterChanged: Symbol('FilterChanged')
1203 }; 1185 };
1204 1186
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 return true; 1326 return true;
1345 } 1327 }
1346 return false; 1328 return false;
1347 } 1329 }
1348 }; 1330 };
1349 1331
1350 /** 1332 /**
1351 * @typedef {{messageIndex: number, matchIndex: number}} 1333 * @typedef {{messageIndex: number, matchIndex: number}}
1352 */ 1334 */
1353 WebInspector.ConsoleView.RegexMatchRange; 1335 WebInspector.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698