Chromium Code Reviews| Index: chrome/browser/resources/net_internals/source_row.js |
| =================================================================== |
| --- chrome/browser/resources/net_internals/source_row.js (revision 194509) |
| +++ chrome/browser/resources/net_internals/source_row.js (working copy) |
| @@ -166,60 +166,7 @@ |
| }, |
| matchesFilter: function(filter) { |
|
eroman
2013/04/17 21:38:05
Actually I think this is only used in one place --
mmenke
2013/04/17 22:34:55
Done.
|
| - if (filter.isActive && this.isInactive_) |
| - return false; |
| - if (filter.isInactive && !this.isInactive_) |
| - return false; |
| - if (filter.isError && !this.isError_) |
| - return false; |
| - if (filter.isNotError && this.isError_) |
| - return false; |
| - |
| - // Check source type, if needed. |
| - if (filter.type) { |
| - var i; |
| - var sourceType = this.sourceEntry_.getSourceTypeString().toLowerCase(); |
| - for (i = 0; i < filter.type.length; ++i) { |
| - if (sourceType.search(filter.type[i]) != -1) |
| - break; |
| - } |
| - if (i == filter.type.length) |
| - return false; |
| - } |
| - |
| - // Check source ID, if needed. |
| - if (filter.id) { |
| - if (filter.id.indexOf(this.getSourceId() + '') == -1) |
| - return false; |
| - } |
| - |
| - if (!filter.textFilters) |
| - return true; |
| - |
| - // Used for searching for input strings. Lazily initialized. |
| - var tablePrinter = null; |
| - |
| - for (var i = 0; i < filter.textFilters.length; ++i) { |
| - // The description is not always contained in one of the log entries. |
| - if (this.description_.toLowerCase().indexOf( |
| - filter.textFilters[i]) != -1) { |
| - continue; |
| - } |
| - |
| - // Allow specifying source types by name. |
| - var sourceType = this.sourceEntry_.getSourceTypeString(); |
| - if (sourceType.toLowerCase().indexOf(filter.textFilters[i]) != -1) |
| - continue; |
| - |
| - if (!tablePrinter) { |
| - tablePrinter = createLogEntryTablePrinter( |
| - this.sourceEntry_.getLogEntries(), |
| - SourceTracker.getInstance().getPrivacyStripping()); |
| - } |
| - if (!tablePrinter.search(filter.textFilters[i])) |
| - return false; |
| - } |
| - return true; |
| + return filter(this.sourceEntry_); |
| }, |
| isSelected: function() { |