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

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

Issue 2562193002: Add filtering by priority in the Network filter area. (Closed)
Patch Set: After reveiw Created 3 years, 12 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
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 */ 207 */
208 static _requestMethodFilter(value, request) { 208 static _requestMethodFilter(value, request) {
209 return request.requestMethod === value; 209 return request.requestMethod === value;
210 } 210 }
211 211
212 /** 212 /**
213 * @param {string} value 213 * @param {string} value
214 * @param {!SDK.NetworkRequest} request 214 * @param {!SDK.NetworkRequest} request
215 * @return {boolean} 215 * @return {boolean}
216 */ 216 */
217 static _requestPriorityFilter(value, request) {
218 return request.initialPriority() === value;
219 }
220
221 /**
222 * @param {string} value
223 * @param {!SDK.NetworkRequest} request
224 * @return {boolean}
225 */
217 static _requestMimeTypeFilter(value, request) { 226 static _requestMimeTypeFilter(value, request) {
218 return request.mimeType === value; 227 return request.mimeType === value;
219 } 228 }
220 229
221 /** 230 /**
222 * @param {!Network.NetworkLogView.MixedContentFilterValues} value 231 * @param {!Network.NetworkLogView.MixedContentFilterValues} value
223 * @param {!SDK.NetworkRequest} request 232 * @param {!SDK.NetworkRequest} request
224 * @return {boolean} 233 * @return {boolean}
225 */ 234 */
226 static _requestMixedContentFilter(value, request) { 235 static _requestMixedContentFilter(value, request) {
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 if (!this._nodesByRequestId.get(request.requestId)) 971 if (!this._nodesByRequestId.get(request.requestId))
963 return; 972 return;
964 973
965 Network.NetworkLogView._subdomains(request.domain) 974 Network.NetworkLogView._subdomains(request.domain)
966 .forEach( 975 .forEach(
967 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain)); 976 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain));
968 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod); 977 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod);
969 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType); 978 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType);
970 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme); 979 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme);
971 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode); 980 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode);
981 this._suggestionBuilder.addItem(
allada 2016/12/22 23:57:24 Change this to: var priority = request.initialPri
982 Network.NetworkLogView.FilterType.Priority, Components.uiLabelForPriorit y(request.initialPriority()));
972 983
973 if (request.mixedContentType !== 'none') { 984 if (request.mixedContentType !== 'none') {
974 this._suggestionBuilder.addItem( 985 this._suggestionBuilder.addItem(
975 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All); 986 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All);
976 } 987 }
977 988
978 if (request.mixedContentType === 'optionally-blockable') { 989 if (request.mixedContentType === 'optionally-blockable') {
979 this._suggestionBuilder.addItem( 990 this._suggestionBuilder.addItem(
980 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed); 991 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed);
981 } 992 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 1483
1473 case Network.NetworkLogView.FilterType.SetCookieDomain: 1484 case Network.NetworkLogView.FilterType.SetCookieDomain:
1474 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue); 1485 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue);
1475 1486
1476 case Network.NetworkLogView.FilterType.SetCookieName: 1487 case Network.NetworkLogView.FilterType.SetCookieName:
1477 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue); 1488 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue);
1478 1489
1479 case Network.NetworkLogView.FilterType.SetCookieValue: 1490 case Network.NetworkLogView.FilterType.SetCookieValue:
1480 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue); 1491 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue);
1481 1492
1493 case Network.NetworkLogView.FilterType.Priority:
1494 return Network.NetworkLogView._requestPriorityFilter.bind(null, Componen ts.uiLabelToPriority(value));
1495
1482 case Network.NetworkLogView.FilterType.StatusCode: 1496 case Network.NetworkLogView.FilterType.StatusCode:
1483 return Network.NetworkLogView._statusCodeFilter.bind(null, value); 1497 return Network.NetworkLogView._statusCodeFilter.bind(null, value);
1484 } 1498 }
1485 return null; 1499 return null;
1486 } 1500 }
1487 1501
1488 /** 1502 /**
1489 * @param {string} value 1503 * @param {string} value
1490 * @return {?Network.NetworkLogView.Filter} 1504 * @return {?Network.NetworkLogView.Filter}
1491 */ 1505 */
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 1719
1706 /** @enum {string} */ 1720 /** @enum {string} */
1707 Network.NetworkLogView.FilterType = { 1721 Network.NetworkLogView.FilterType = {
1708 Domain: 'domain', 1722 Domain: 'domain',
1709 HasResponseHeader: 'has-response-header', 1723 HasResponseHeader: 'has-response-header',
1710 Is: 'is', 1724 Is: 'is',
1711 LargerThan: 'larger-than', 1725 LargerThan: 'larger-than',
1712 Method: 'method', 1726 Method: 'method',
1713 MimeType: 'mime-type', 1727 MimeType: 'mime-type',
1714 MixedContent: 'mixed-content', 1728 MixedContent: 'mixed-content',
1729 Priority: 'priority',
1715 Scheme: 'scheme', 1730 Scheme: 'scheme',
1716 SetCookieDomain: 'set-cookie-domain', 1731 SetCookieDomain: 'set-cookie-domain',
1717 SetCookieName: 'set-cookie-name', 1732 SetCookieName: 'set-cookie-name',
1718 SetCookieValue: 'set-cookie-value', 1733 SetCookieValue: 'set-cookie-value',
1719 StatusCode: 'status-code' 1734 StatusCode: 'status-code'
1720 }; 1735 };
1721 1736
1722 /** @enum {string} */ 1737 /** @enum {string} */
1723 Network.NetworkLogView.MixedContentFilterValues = { 1738 Network.NetworkLogView.MixedContentFilterValues = {
1724 All: 'all', 1739 All: 'all',
1725 Displayed: 'displayed', 1740 Displayed: 'displayed',
1726 Blocked: 'blocked', 1741 Blocked: 'blocked',
1727 BlockOverridden: 'block-overridden' 1742 BlockOverridden: 'block-overridden'
1728 }; 1743 };
1729 1744
1730 /** @enum {string} */ 1745 /** @enum {string} */
1731 Network.NetworkLogView.IsFilterType = { 1746 Network.NetworkLogView.IsFilterType = {
1732 Running: 'running', 1747 Running: 'running',
1733 FromCache: 'from-cache' 1748 FromCache: 'from-cache'
1734 }; 1749 };
1735 1750
1736 /** @type {!Array<string>} */ 1751 /** @type {!Array<string>} */
1737 Network.NetworkLogView._searchKeys = 1752 Network.NetworkLogView._searchKeys =
1738 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); 1753 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]);
1739 1754
1740 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1755 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1741 Network.NetworkLogView.Filter; 1756 Network.NetworkLogView.Filter;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698