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

Side by Side Diff: Source/devtools/front_end/network/NetworkPanel.js

Issue 621303002: DevTools: NetworkPanel: add filter for running requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 WebInspector.NetworkLogView.defaultColumnsVisibility = { 92 WebInspector.NetworkLogView.defaultColumnsVisibility = {
93 method: true, status: true, scheme: false, domain: false, remoteAddress: fal se, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true, connectionId: false, 93 method: true, status: true, scheme: false, domain: false, remoteAddress: fal se, type: true, initiator: true, cookies: false, setCookies: false, size: true, time: true, connectionId: false,
94 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false 94 "Cache-Control": false, "Connection": false, "Content-Encoding": false, "Con tent-Length": false, "ETag": false, "Keep-Alive": false, "Last-Modified": false, "Server": false, "Vary": false
95 }; 95 };
96 WebInspector.NetworkLogView._defaultRefreshDelay = 500; 96 WebInspector.NetworkLogView._defaultRefreshDelay = 500;
97 97
98 /** @enum {string} */ 98 /** @enum {string} */
99 WebInspector.NetworkLogView.FilterType = { 99 WebInspector.NetworkLogView.FilterType = {
100 Domain: "Domain", 100 Domain: "Domain",
101 HasResponseHeader: "HasResponseHeader", 101 HasResponseHeader: "HasResponseHeader",
102 Is: "Is",
102 Method: "Method", 103 Method: "Method",
103 MimeType: "MimeType", 104 MimeType: "MimeType",
104 Scheme: "Scheme", 105 Scheme: "Scheme",
105 SetCookieDomain: "SetCookieDomain", 106 SetCookieDomain: "SetCookieDomain",
106 SetCookieName: "SetCookieName", 107 SetCookieName: "SetCookieName",
107 SetCookieValue: "SetCookieValue", 108 SetCookieValue: "SetCookieValue",
108 StatusCode: "StatusCode" 109 StatusCode: "StatusCode"
109 }; 110 };
110 111
112 /** @enum {string} */
113 WebInspector.NetworkLogView.IsFilterType = {
114 Running: "running"
115 };
116
111 /** @type {!Array.<string>} */ 117 /** @type {!Array.<string>} */
112 WebInspector.NetworkLogView._searchKeys = Object.values(WebInspector.NetworkLogV iew.FilterType); 118 WebInspector.NetworkLogView._searchKeys = Object.values(WebInspector.NetworkLogV iew.FilterType);
113 119
114 /** @type {!Object.<string, string>} */ 120 /** @type {!Object.<string, string>} */
115 WebInspector.NetworkLogView._columnTitles = { 121 WebInspector.NetworkLogView._columnTitles = {
116 "name": WebInspector.UIString("Name"), 122 "name": WebInspector.UIString("Name"),
117 "method": WebInspector.UIString("Method"), 123 "method": WebInspector.UIString("Method"),
118 "status": WebInspector.UIString("Status"), 124 "status": WebInspector.UIString("Status"),
119 "scheme": WebInspector.UIString("Scheme"), 125 "scheme": WebInspector.UIString("Scheme"),
120 "domain": WebInspector.UIString("Domain"), 126 "domain": WebInspector.UIString("Domain"),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 187
182 var dataURLSetting = WebInspector.settings.networkHideDataURL; 188 var dataURLSetting = WebInspector.settings.networkHideDataURL;
183 this._dataURLFilterUI = new WebInspector.CheckboxFilterUI("hide-data-url ", WebInspector.UIString("Hide data URLs"), true, dataURLSetting); 189 this._dataURLFilterUI = new WebInspector.CheckboxFilterUI("hide-data-url ", WebInspector.UIString("Hide data URLs"), true, dataURLSetting);
184 this._dataURLFilterUI.addEventListener(WebInspector.FilterUI.Events.Filt erChanged, this._filterChanged.bind(this), this); 190 this._dataURLFilterUI.addEventListener(WebInspector.FilterUI.Events.Filt erChanged, this._filterChanged.bind(this), this);
185 this._filterBar.addFilter(this._dataURLFilterUI); 191 this._filterBar.addFilter(this._dataURLFilterUI);
186 }, 192 },
187 193
188 _resetSuggestionBuilder: function() 194 _resetSuggestionBuilder: function()
189 { 195 {
190 this._suggestionBuilder = new WebInspector.FilterSuggestionBuilder(WebIn spector.NetworkLogView._searchKeys); 196 this._suggestionBuilder = new WebInspector.FilterSuggestionBuilder(WebIn spector.NetworkLogView._searchKeys);
197 this._suggestionBuilder.addItem(WebInspector.NetworkLogView.FilterType.I s, WebInspector.NetworkLogView.IsFilterType.Running);
191 this._textFilterUI.setSuggestionBuilder(this._suggestionBuilder); 198 this._textFilterUI.setSuggestionBuilder(this._suggestionBuilder);
192 }, 199 },
193 200
194 /** 201 /**
195 * @param {!WebInspector.Event} event 202 * @param {!WebInspector.Event} event
196 */ 203 */
197 _filterChanged: function(event) 204 _filterChanged: function(event)
198 { 205 {
199 this._removeAllNodeHighlights(); 206 this._removeAllNodeHighlights();
200 this._parseFilterQuery(this._textFilterUI.value()); 207 this._parseFilterQuery(this._textFilterUI.value());
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 * @return {!WebInspector.NetworkLogView.Filter} 1491 * @return {!WebInspector.NetworkLogView.Filter}
1485 */ 1492 */
1486 _createFilter: function(type, value) { 1493 _createFilter: function(type, value) {
1487 switch (type) { 1494 switch (type) {
1488 case WebInspector.NetworkLogView.FilterType.Domain: 1495 case WebInspector.NetworkLogView.FilterType.Domain:
1489 return WebInspector.NetworkLogView._requestDomainFilter.bind(null, v alue); 1496 return WebInspector.NetworkLogView._requestDomainFilter.bind(null, v alue);
1490 1497
1491 case WebInspector.NetworkLogView.FilterType.HasResponseHeader: 1498 case WebInspector.NetworkLogView.FilterType.HasResponseHeader:
1492 return WebInspector.NetworkLogView._requestResponseHeaderFilter.bind (null, value); 1499 return WebInspector.NetworkLogView._requestResponseHeaderFilter.bind (null, value);
1493 1500
1501 case WebInspector.NetworkLogView.FilterType.Is:
1502 if (value.toLowerCase() === WebInspector.NetworkLogView.IsFilterType .Running)
1503 return WebInspector.NetworkLogView._runningRequestFilter;
1504 break;
1505
1494 case WebInspector.NetworkLogView.FilterType.Method: 1506 case WebInspector.NetworkLogView.FilterType.Method:
1495 return WebInspector.NetworkLogView._requestMethodFilter.bind(null, v alue); 1507 return WebInspector.NetworkLogView._requestMethodFilter.bind(null, v alue);
1496 1508
1497 case WebInspector.NetworkLogView.FilterType.MimeType: 1509 case WebInspector.NetworkLogView.FilterType.MimeType:
1498 return WebInspector.NetworkLogView._requestMimeTypeFilter.bind(null, value); 1510 return WebInspector.NetworkLogView._requestMimeTypeFilter.bind(null, value);
1499 1511
1500 case WebInspector.NetworkLogView.FilterType.Scheme: 1512 case WebInspector.NetworkLogView.FilterType.Scheme:
1501 return WebInspector.NetworkLogView._requestSchemeFilter.bind(null, v alue); 1513 return WebInspector.NetworkLogView._requestSchemeFilter.bind(null, v alue);
1502 1514
1503 case WebInspector.NetworkLogView.FilterType.SetCookieDomain: 1515 case WebInspector.NetworkLogView.FilterType.SetCookieDomain:
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 * @param {string} value 1706 * @param {string} value
1695 * @param {!WebInspector.NetworkRequest} request 1707 * @param {!WebInspector.NetworkRequest} request
1696 * @return {boolean} 1708 * @return {boolean}
1697 */ 1709 */
1698 WebInspector.NetworkLogView._requestDomainFilter = function(value, request) 1710 WebInspector.NetworkLogView._requestDomainFilter = function(value, request)
1699 { 1711 {
1700 return request.domain === value; 1712 return request.domain === value;
1701 } 1713 }
1702 1714
1703 /** 1715 /**
1716 * @param {!WebInspector.NetworkRequest} request
1717 * @return {boolean}
1718 */
1719 WebInspector.NetworkLogView._runningRequestFilter = function(request)
1720 {
1721 return !request.finished;
1722 }
1723
1724 /**
1704 * @param {string} value 1725 * @param {string} value
1705 * @param {!WebInspector.NetworkRequest} request 1726 * @param {!WebInspector.NetworkRequest} request
1706 * @return {boolean} 1727 * @return {boolean}
1707 */ 1728 */
1708 WebInspector.NetworkLogView._requestResponseHeaderFilter = function(value, reque st) 1729 WebInspector.NetworkLogView._requestResponseHeaderFilter = function(value, reque st)
1709 { 1730 {
1710 return request.responseHeaderValue(value) !== undefined; 1731 return request.responseHeaderValue(value) !== undefined;
1711 } 1732 }
1712 1733
1713 /** 1734 /**
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 3127
3107 WebInspector.NetworkPanelFactory.prototype = { 3128 WebInspector.NetworkPanelFactory.prototype = {
3108 /** 3129 /**
3109 * @return {!WebInspector.Panel} 3130 * @return {!WebInspector.Panel}
3110 */ 3131 */
3111 createPanel: function() 3132 createPanel: function()
3112 { 3133 {
3113 return WebInspector.NetworkPanel._instance(); 3134 return WebInspector.NetworkPanel._instance();
3114 } 3135 }
3115 } 3136 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698