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

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: Changes Created 4 years 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 */ 204 */
205 static _requestMethodFilter(value, request) { 205 static _requestMethodFilter(value, request) {
206 return request.requestMethod === value; 206 return request.requestMethod === value;
207 } 207 }
208 208
209 /** 209 /**
210 * @param {string} value 210 * @param {string} value
211 * @param {!SDK.NetworkRequest} request 211 * @param {!SDK.NetworkRequest} request
212 * @return {boolean} 212 * @return {boolean}
213 */ 213 */
214 static _requestPriorityFilter(value, request) {
215 return request.initialPriority() === value;
216 }
217
218 /**
219 * @param {string} value
220 * @param {!SDK.NetworkRequest} request
221 * @return {boolean}
222 */
214 static _requestMimeTypeFilter(value, request) { 223 static _requestMimeTypeFilter(value, request) {
215 return request.mimeType === value; 224 return request.mimeType === value;
216 } 225 }
217 226
218 /** 227 /**
219 * @param {!Network.NetworkLogView.MixedContentFilterValues} value 228 * @param {!Network.NetworkLogView.MixedContentFilterValues} value
220 * @param {!SDK.NetworkRequest} request 229 * @param {!SDK.NetworkRequest} request
221 * @return {boolean} 230 * @return {boolean}
222 */ 231 */
223 static _requestMixedContentFilter(value, request) { 232 static _requestMixedContentFilter(value, request) {
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 if (!this._nodesByRequestId.get(request.requestId)) 948 if (!this._nodesByRequestId.get(request.requestId))
940 return; 949 return;
941 950
942 Network.NetworkLogView._subdomains(request.domain) 951 Network.NetworkLogView._subdomains(request.domain)
943 .forEach( 952 .forEach(
944 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain)); 953 this._suggestionBuilder.addItem.bind(this._suggestionBuilder, Networ k.NetworkLogView.FilterType.Domain));
945 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod); 954 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Method, re quest.requestMethod);
946 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType); 955 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.MimeType, request.mimeType);
947 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme); 956 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.Scheme, '' + request.scheme);
948 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode); 957 this._suggestionBuilder.addItem(Network.NetworkLogView.FilterType.StatusCode , '' + request.statusCode);
958 this._suggestionBuilder.addItem(
959 Network.NetworkLogView.FilterType.Priority, Components.uiLabelForPriorit y(request.initialPriority()));
Oleksii Kadurin 2016/12/20 21:13:01 WARNING - actual parameter 1 of Components.uiLabel
949 960
950 if (request.mixedContentType !== 'none') { 961 if (request.mixedContentType !== 'none') {
951 this._suggestionBuilder.addItem( 962 this._suggestionBuilder.addItem(
952 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All); 963 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.All);
953 } 964 }
954 965
955 if (request.mixedContentType === 'optionally-blockable') { 966 if (request.mixedContentType === 'optionally-blockable') {
956 this._suggestionBuilder.addItem( 967 this._suggestionBuilder.addItem(
957 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed); 968 Network.NetworkLogView.FilterType.MixedContent, Network.NetworkLogView .MixedContentFilterValues.Displayed);
958 } 969 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 1460
1450 case Network.NetworkLogView.FilterType.SetCookieDomain: 1461 case Network.NetworkLogView.FilterType.SetCookieDomain:
1451 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue); 1462 return Network.NetworkLogView._requestSetCookieDomainFilter.bind(null, v alue);
1452 1463
1453 case Network.NetworkLogView.FilterType.SetCookieName: 1464 case Network.NetworkLogView.FilterType.SetCookieName:
1454 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue); 1465 return Network.NetworkLogView._requestSetCookieNameFilter.bind(null, val ue);
1455 1466
1456 case Network.NetworkLogView.FilterType.SetCookieValue: 1467 case Network.NetworkLogView.FilterType.SetCookieValue:
1457 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue); 1468 return Network.NetworkLogView._requestSetCookieValueFilter.bind(null, va lue);
1458 1469
1470 case Network.NetworkLogView.FilterType.Priority:
1471 return Network.NetworkLogView._requestPriorityFilter.bind(null, Componen ts.uiLabelToPriority(value));
1472
1459 case Network.NetworkLogView.FilterType.StatusCode: 1473 case Network.NetworkLogView.FilterType.StatusCode:
1460 return Network.NetworkLogView._statusCodeFilter.bind(null, value); 1474 return Network.NetworkLogView._statusCodeFilter.bind(null, value);
1461 } 1475 }
1462 return null; 1476 return null;
1463 } 1477 }
1464 1478
1465 /** 1479 /**
1466 * @param {string} value 1480 * @param {string} value
1467 * @return {?Network.NetworkLogView.Filter} 1481 * @return {?Network.NetworkLogView.Filter}
1468 */ 1482 */
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 1696
1683 /** @enum {string} */ 1697 /** @enum {string} */
1684 Network.NetworkLogView.FilterType = { 1698 Network.NetworkLogView.FilterType = {
1685 Domain: 'domain', 1699 Domain: 'domain',
1686 HasResponseHeader: 'has-response-header', 1700 HasResponseHeader: 'has-response-header',
1687 Is: 'is', 1701 Is: 'is',
1688 LargerThan: 'larger-than', 1702 LargerThan: 'larger-than',
1689 Method: 'method', 1703 Method: 'method',
1690 MimeType: 'mime-type', 1704 MimeType: 'mime-type',
1691 MixedContent: 'mixed-content', 1705 MixedContent: 'mixed-content',
1706 Priority: 'priority',
1692 Scheme: 'scheme', 1707 Scheme: 'scheme',
1693 SetCookieDomain: 'set-cookie-domain', 1708 SetCookieDomain: 'set-cookie-domain',
1694 SetCookieName: 'set-cookie-name', 1709 SetCookieName: 'set-cookie-name',
1695 SetCookieValue: 'set-cookie-value', 1710 SetCookieValue: 'set-cookie-value',
1696 StatusCode: 'status-code' 1711 StatusCode: 'status-code'
1697 }; 1712 };
1698 1713
1699 /** @enum {string} */ 1714 /** @enum {string} */
1700 Network.NetworkLogView.MixedContentFilterValues = { 1715 Network.NetworkLogView.MixedContentFilterValues = {
1701 All: 'all', 1716 All: 'all',
1702 Displayed: 'displayed', 1717 Displayed: 'displayed',
1703 Blocked: 'blocked', 1718 Blocked: 'blocked',
1704 BlockOverridden: 'block-overridden' 1719 BlockOverridden: 'block-overridden'
1705 }; 1720 };
1706 1721
1707 /** @enum {string} */ 1722 /** @enum {string} */
1708 Network.NetworkLogView.IsFilterType = { 1723 Network.NetworkLogView.IsFilterType = {
1709 Running: 'running', 1724 Running: 'running',
1710 FromCache: 'from-cache' 1725 FromCache: 'from-cache'
1711 }; 1726 };
1712 1727
1713 /** @type {!Array<string>} */ 1728 /** @type {!Array<string>} */
1714 Network.NetworkLogView._searchKeys = 1729 Network.NetworkLogView._searchKeys =
1715 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); 1730 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]);
1716 1731
1717 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1732 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1718 Network.NetworkLogView.Filter; 1733 Network.NetworkLogView.Filter;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698