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

Unified Diff: chrome/browser/resources/net_internals/events_view.js

Issue 10987030: Make about:net-internal's filters work a bit better. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Response to comments, retry upload (First corrupt?) Created 8 years, 3 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: chrome/browser/resources/net_internals/events_view.js
===================================================================
--- chrome/browser/resources/net_internals/events_view.js (revision 158398)
+++ chrome/browser/resources/net_internals/events_view.js (working copy)
@@ -285,9 +285,23 @@
var filterInfo = this.parseDirective_(filterText, directive);
if (filterInfo == null)
break;
- if (!filter[directive])
- filter[directive] = [];
- filter[directive].push(filterInfo.parameter);
+
+ // Split parameters around commas and remove empty elements.
+ var parameters = filterInfo.parameter.split(',');
+ parameters = parameters.filter(function(string) {
+ return string.length > 0;
+ });
+
+ // If there's already a matching filter, take the intersection.
+ // This behavior primarily exists for tests. It is not correct
+ // when one of the 'type' filters is a partial match.
+ if (filter[directive]) {
+ parameters = parameters.filter(function(string) {
+ return filter[directive].indexOf(string) != -1;
+ });
+ }
+
+ filter[directive] = parameters;
filterText = filterInfo.remainingText;
}
}
« no previous file with comments | « chrome/browser/resources/net_internals/dns_view.html ('k') | chrome/browser/resources/net_internals/log_view_painter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698