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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2180743002: [Devtools] Fixed regex filtering in the Network panel for Negative lookaheads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed function name to reflect functional changes Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 988
989 /** 989 /**
990 * @param {!WebInspector.NetworkRequest} request 990 * @param {!WebInspector.NetworkRequest} request
991 * @return {boolean} 991 * @return {boolean}
992 */ 992 */
993 _matchRequest: function(request) 993 _matchRequest: function(request)
994 { 994 {
995 var re = this._searchRegex; 995 var re = this._searchRegex;
996 if (!re) 996 if (!re)
997 return false; 997 return false;
998 return re.test(request.name()) || (this._networkLogLargeRowsSetting.get( ) && re.test(request.path())); 998
999 var text = this._networkLogLargeRowsSetting.get() ? request.path() + "/" + request.name() : request.name();
1000 return re.test(text);
999 }, 1001 },
1000 1002
1001 _clearSearchMatchedList: function() 1003 _clearSearchMatchedList: function()
1002 { 1004 {
1003 this._matchedRequestCount = -1; 1005 this._matchedRequestCount = -1;
1004 this._currentMatchedRequestNode = null; 1006 this._currentMatchedRequestNode = null;
1005 this._removeAllHighlights(); 1007 this._removeAllHighlights();
1006 }, 1008 },
1007 1009
1008 _removeAllHighlights: function() 1010 _removeAllHighlights: function()
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 /** @type {?RegExp} */ 1185 /** @type {?RegExp} */
1184 var regex; 1186 var regex;
1185 if (!this._textFilterUI.isRegexChecked() && text[0] === "-" && text.leng th > 1) { 1187 if (!this._textFilterUI.isRegexChecked() && text[0] === "-" && text.leng th > 1) {
1186 negative = true; 1188 negative = true;
1187 text = text.substring(1); 1189 text = text.substring(1);
1188 regex = new RegExp(text.escapeForRegExp(), "i"); 1190 regex = new RegExp(text.escapeForRegExp(), "i");
1189 } else { 1191 } else {
1190 regex = this._textFilterUI.regex(); 1192 regex = this._textFilterUI.regex();
1191 } 1193 }
1192 1194
1193 var filter = WebInspector.NetworkLogView._requestNameOrPathFilter.bind(n ull, regex); 1195 var filter = WebInspector.NetworkLogView._requestNameAndPathFilter.bind( null, regex);
1194 if (negative) 1196 if (negative)
1195 filter = WebInspector.NetworkLogView._negativeFilter.bind(null, filt er); 1197 filter = WebInspector.NetworkLogView._negativeFilter.bind(null, filt er);
1196 return filter; 1198 return filter;
1197 }, 1199 },
1198 1200
1199 /** 1201 /**
1200 * @param {!WebInspector.NetworkLogView.FilterType} type 1202 * @param {!WebInspector.NetworkLogView.FilterType} type
1201 * @param {string} value 1203 * @param {string} value
1202 * @param {boolean} negative 1204 * @param {boolean} negative
1203 * @return {!WebInspector.NetworkLogView.Filter} 1205 * @return {!WebInspector.NetworkLogView.Filter}
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 WebInspector.NetworkLogView._negativeFilter = function(filter, request) 1468 WebInspector.NetworkLogView._negativeFilter = function(filter, request)
1467 { 1469 {
1468 return !filter(request); 1470 return !filter(request);
1469 } 1471 }
1470 1472
1471 /** 1473 /**
1472 * @param {?RegExp} regex 1474 * @param {?RegExp} regex
1473 * @param {!WebInspector.NetworkRequest} request 1475 * @param {!WebInspector.NetworkRequest} request
1474 * @return {boolean} 1476 * @return {boolean}
1475 */ 1477 */
1476 WebInspector.NetworkLogView._requestNameOrPathFilter = function(regex, request) 1478 WebInspector.NetworkLogView._requestNameAndPathFilter = function(regex, request)
lushnikov 2016/08/08 23:13:20 Can we name it _requestPathFilter? It would be sho
1477 { 1479 {
1478 if (!regex) 1480 if (!regex)
1479 return false; 1481 return false;
1480 return regex.test(request.name()) || regex.test(request.path()); 1482
1483 return regex.test(request.path() + "/" + request.name());
1481 } 1484 }
1482 1485
1483 /** 1486 /**
1484 * @param {string} domain 1487 * @param {string} domain
1485 * @return {!Array.<string>} 1488 * @return {!Array.<string>}
1486 */ 1489 */
1487 WebInspector.NetworkLogView._subdomains = function(domain) 1490 WebInspector.NetworkLogView._subdomains = function(domain)
1488 { 1491 {
1489 var result = [domain]; 1492 var result = [domain];
1490 var indexOfPeriod = domain.indexOf("."); 1493 var indexOfPeriod = domain.indexOf(".");
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 return false; 1691 return false;
1689 return true; 1692 return true;
1690 } 1693 }
1691 1694
1692 WebInspector.NetworkLogView.EventTypes = { 1695 WebInspector.NetworkLogView.EventTypes = {
1693 RequestSelected: "RequestSelected", 1696 RequestSelected: "RequestSelected",
1694 SearchCountUpdated: "SearchCountUpdated", 1697 SearchCountUpdated: "SearchCountUpdated",
1695 SearchIndexUpdated: "SearchIndexUpdated", 1698 SearchIndexUpdated: "SearchIndexUpdated",
1696 UpdateRequest: "UpdateRequest" 1699 UpdateRequest: "UpdateRequest"
1697 }; 1700 };
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698