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

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: Doctype Created 3 years, 11 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 | « third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js ('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 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 return; 939 return;
931 940
932 Network.NetworkLogView._subdomains(request.domain) 941 Network.NetworkLogView._subdomains(request.domain)
933 .forEach( 942 .forEach(
934 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain)); 943 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain));
935 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod); 944 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod);
936 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType); 945 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType);
937 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme); 946 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme);
938 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode); 947 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode);
939 948
949 var priority = request.initialPriority();
950 if (priority) {
951 this._suggestionBuilder.addItem(
952 Network.NetworkLogView.FilterType.Priority, Components.uiLabelForPrior ity(priority));
953 }
954
940 if (request.mixedContentType !== 'none') { 955 if (request.mixedContentType !== 'none') {
941 this._suggestionBuilder.addItem( 956 this._suggestionBuilder.addItem(
942 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All); 957 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All);
943 } 958 }
944 959
945 if (request.mixedContentType === 'optionally-blockable') { 960 if (request.mixedContentType === 'optionally-blockable') {
946 this._suggestionBuilder.addItem( 961 this._suggestionBuilder.addItem(
947 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed); 962 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed);
948 } 963 }
949 964
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 1454
1440 case Network.NetworkLogView.FilterType.SetCookieDomain: 1455 case Network.NetworkLogView.FilterType.SetCookieDomain:
1441 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue); 1456 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue);
1442 1457
1443 case Network.NetworkLogView.FilterType.SetCookieName: 1458 case Network.NetworkLogView.FilterType.SetCookieName:
1444 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue); 1459 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue);
1445 1460
1446 case Network.NetworkLogView.FilterType.SetCookieValue: 1461 case Network.NetworkLogView.FilterType.SetCookieValue:
1447 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue); 1462 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue);
1448 1463
1464 case Network.NetworkLogView.FilterType.Priority:
1465 return Network.NetworkLogView._requestPriorityFilter.bind(null, Componen ts.uiLabelToPriority(value));
1466
1449 case Network.NetworkLogView.FilterType.StatusCode: 1467 case Network.NetworkLogView.FilterType.StatusCode:
1450 return Network.NetworkLogView._statusCodeFilter.bind(null, value); 1468 return Network.NetworkLogView._statusCodeFilter.bind(null, value);
1451 } 1469 }
1452 return null; 1470 return null;
1453 } 1471 }
1454 1472
1455 /** 1473 /**
1456 * @param {string} value 1474 * @param {string} value
1457 * @return {?Network.NetworkLogView.Filter} 1475 * @return {?Network.NetworkLogView.Filter}
1458 */ 1476 */
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 1690
1673 /** @enum {string} */ 1691 /** @enum {string} */
1674 Network.NetworkLogView.FilterType = { 1692 Network.NetworkLogView.FilterType = {
1675 Domain: 'domain', 1693 Domain: 'domain',
1676 HasResponseHeader: 'has-response-header', 1694 HasResponseHeader: 'has-response-header',
1677 Is: 'is', 1695 Is: 'is',
1678 LargerThan: 'larger-than', 1696 LargerThan: 'larger-than',
1679 Method: 'method', 1697 Method: 'method',
1680 MimeType: 'mime-type', 1698 MimeType: 'mime-type',
1681 MixedContent: 'mixed-content', 1699 MixedContent: 'mixed-content',
1700 Priority: 'priority',
1682 Scheme: 'scheme', 1701 Scheme: 'scheme',
1683 SetCookieDomain: 'set-cookie-domain', 1702 SetCookieDomain: 'set-cookie-domain',
1684 SetCookieName: 'set-cookie-name', 1703 SetCookieName: 'set-cookie-name',
1685 SetCookieValue: 'set-cookie-value', 1704 SetCookieValue: 'set-cookie-value',
1686 StatusCode: 'status-code' 1705 StatusCode: 'status-code'
1687 }; 1706 };
1688 1707
1689 /** @enum {string} */ 1708 /** @enum {string} */
1690 Network.NetworkLogView.MixedContentFilterValues = { 1709 Network.NetworkLogView.MixedContentFilterValues = {
1691 All: 'all', 1710 All: 'all',
1692 Displayed: 'displayed', 1711 Displayed: 'displayed',
1693 Blocked: 'blocked', 1712 Blocked: 'blocked',
1694 BlockOverridden: 'block-overridden' 1713 BlockOverridden: 'block-overridden'
1695 }; 1714 };
1696 1715
1697 /** @enum {string} */ 1716 /** @enum {string} */
1698 Network.NetworkLogView.IsFilterType = { 1717 Network.NetworkLogView.IsFilterType = {
1699 Running: 'running', 1718 Running: 'running',
1700 FromCache: 'from-cache' 1719 FromCache: 'from-cache'
1701 }; 1720 };
1702 1721
1703 /** @type {!Array<string>} */ 1722 /** @type {!Array<string>} */
1704 Network.NetworkLogView._searchKeys = 1723 Network.NetworkLogView._searchKeys =
1705 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); 1724 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]);
1706 1725
1707 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1726 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1708 Network.NetworkLogView.Filter; 1727 Network.NetworkLogView.Filter;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698