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