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

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

Issue 724413002: DevTools: NetworkPanel: tune members visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « LayoutTests/inspector/network/network-filter-updated-requests.html ('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 26 matching lines...) Expand all
37 * @param {!WebInspector.Setting} coulmnsVisibilitySetting 37 * @param {!WebInspector.Setting} coulmnsVisibilitySetting
38 */ 38 */
39 WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting) 39 WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting)
40 { 40 {
41 WebInspector.VBox.call(this); 41 WebInspector.VBox.call(this);
42 this.registerRequiredCSS("network/networkLogView.css"); 42 this.registerRequiredCSS("network/networkLogView.css");
43 this.registerRequiredCSS("ui/filter.css"); 43 this.registerRequiredCSS("ui/filter.css");
44 44
45 this._filterBar = filterBar; 45 this._filterBar = filterBar;
46 this._coulmnsVisibilitySetting = coulmnsVisibilitySetting; 46 this._coulmnsVisibilitySetting = coulmnsVisibilitySetting;
47 this._allowRequestSelection = false;
48 /** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */ 47 /** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */
49 this._nodesByRequestId = new Map(); 48 this._nodesByRequestId = new Map();
50 /** @type {!Object.<string, boolean>} */ 49 /** @type {!Object.<string, boolean>} */
51 this._staleRequestIds = {}; 50 this._staleRequestIds = {};
52 /** @type {number} */ 51 /** @type {number} */
53 this._mainRequestLoadTime = -1; 52 this._mainRequestLoadTime = -1;
54 /** @type {number} */ 53 /** @type {number} */
55 this._mainRequestDOMContentLoadedTime = -1; 54 this._mainRequestDOMContentLoadedTime = -1;
56 this._matchedRequestCount = 0; 55 this._matchedRequestCount = 0;
57 this._highlightedSubstringChanges = []; 56 this._highlightedSubstringChanges = [];
58 57
59 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */ 58 /** @type {!Array.<!WebInspector.NetworkLogView.Filter>} */
60 this._filters = []; 59 this._filters = [];
61 60
62 this._currentMatchedRequestNode = null; 61 this._currentMatchedRequestNode = null;
63 this._currentMatchedRequestIndex = -1; 62 this._currentMatchedRequestIndex = -1;
64 63
65 this._createStatusbarButtons(); 64 this._createStatusbarButtons();
66 this._createStatusBarItems(); 65 this._createStatusBarItems();
67 this._linkifier = new WebInspector.Linkifier(); 66 this._linkifier = new WebInspector.Linkifier();
68 67
69 this._allowPopover = true; 68 this._gridMode = true;
70 69
71 /** @type {number} */ 70 /** @type {number} */
72 this._rowHeight = 0; 71 this._rowHeight = 0;
73 72
74 this._addFilters(); 73 this._addFilters();
75 this._resetSuggestionBuilder(); 74 this._resetSuggestionBuilder();
76 this._initializeView(); 75 this._initializeView();
77 this._toggleRecordButton(true); 76 this._toggleRecordButton(true);
78 77
79 WebInspector.targetManager.observeTargets(this); 78 WebInspector.targetManager.observeTargets(this);
80 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this ); 79 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this );
81 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this ); 80 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestUpdated, this._onRequestUpdated, this );
82 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi s); 81 WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, Web Inspector.NetworkManager.EventTypes.RequestFinished, this._onRequestUpdated, thi s);
83 82
84 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this); 83 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this);
85 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNav igated, this); 84 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNav igated, this);
86 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this); 85 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this);
87 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._domContentLoad edEventFired, this); 86 WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded, this._domContentLoad edEventFired, this);
88 } 87 }
89 88
89 WebInspector.NetworkLogView._isFilteredOutSymbol = Symbol("isFilteredOut");
90 WebInspector.NetworkLogView._isMatchingSearchQuerySymbol = Symbol("isMatchingSea rchQuery");
91
90 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true}; 92 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": tr ue, "wss": true};
91 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"]; 93 WebInspector.NetworkLogView._responseHeaderColumns = ["Cache-Control", "Connecti on", "Content-Encoding", "Content-Length", "ETag", "Keep-Alive", "Last-Modified" , "Server", "Vary"];
92 WebInspector.NetworkLogView.defaultColumnsVisibility = { 94 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, 95 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 96 "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 }; 97 };
96 WebInspector.NetworkLogView._defaultRefreshDelay = 500; 98 WebInspector.NetworkLogView._defaultRefreshDelay = 500;
97 99
98 /** @enum {string} */ 100 /** @enum {string} */
99 WebInspector.NetworkLogView.FilterType = { 101 WebInspector.NetworkLogView.FilterType = {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 */ 162 */
161 targetRemoved: function(target) 163 targetRemoved: function(target)
162 { 164 {
163 }, 165 },
164 166
165 /** 167 /**
166 * @return {boolean} 168 * @return {boolean}
167 */ 169 */
168 allowRequestSelection: function() 170 allowRequestSelection: function()
169 { 171 {
170 return this._allowRequestSelection; 172 return !this._gridMode;
171 }, 173 },
172 174
173 _addFilters: function() 175 _addFilters: function()
174 { 176 {
175 this._textFilterUI = new WebInspector.TextFilterUI(); 177 this._textFilterUI = new WebInspector.TextFilterUI();
176 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this); 178 this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterC hanged, this._filterChanged, this);
177 this._filterBar.addFilter(this._textFilterUI); 179 this._filterBar.addFilter(this._textFilterUI);
178 180
179 var types = []; 181 var types = [];
180 for (var typeId in WebInspector.resourceTypes) { 182 for (var typeId in WebInspector.resourceTypes) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 248
247 /** 249 /**
248 * @return {boolean} 250 * @return {boolean}
249 */ 251 */
250 usesLargeRows: function() 252 usesLargeRows: function()
251 { 253 {
252 return !!WebInspector.settings.resourcesLargeRows.get(); 254 return !!WebInspector.settings.resourcesLargeRows.get();
253 }, 255 },
254 256
255 /** 257 /**
256 * @param {boolean} flag
257 */
258 setAllowPopover: function(flag)
259 {
260 this._allowPopover = flag;
261 },
262
263 /**
264 * @return {!Array.<!Element>} 258 * @return {!Array.<!Element>}
265 */ 259 */
266 elementsToRestoreScrollPositionsFor: function() 260 elementsToRestoreScrollPositionsFor: function()
267 { 261 {
268 if (!this._dataGrid) // Not initialized yet. 262 if (!this._dataGrid) // Not initialized yet.
269 return []; 263 return [];
270 return [this._dataGrid.scrollContainer]; 264 return [this._dataGrid.scrollContainer];
271 }, 265 },
272 266
273 _createTimelineGrid: function() 267 _createTimelineGrid: function()
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 var transferSize = 0; 578 var transferSize = 0;
585 var selectedRequestsNumber = 0; 579 var selectedRequestsNumber = 0;
586 var selectedTransferSize = 0; 580 var selectedTransferSize = 0;
587 var baseTime = -1; 581 var baseTime = -1;
588 var maxTime = -1; 582 var maxTime = -1;
589 var nodes = this._nodesByRequestId.valuesArray(); 583 var nodes = this._nodesByRequestId.valuesArray();
590 for (var i = 0; i < nodes.length; ++i) { 584 for (var i = 0; i < nodes.length; ++i) {
591 var request = nodes[i].request(); 585 var request = nodes[i].request();
592 var requestTransferSize = request.transferSize; 586 var requestTransferSize = request.transferSize;
593 transferSize += requestTransferSize; 587 transferSize += requestTransferSize;
594 if (!nodes[i]._isFilteredOut) { 588 if (!nodes[i][WebInspector.NetworkLogView._isFilteredOutSymbol]) {
595 selectedRequestsNumber++; 589 selectedRequestsNumber++;
596 selectedTransferSize += requestTransferSize; 590 selectedTransferSize += requestTransferSize;
597 } 591 }
598 if (request.url === request.target().resourceTreeModel.inspectedPage URL()) 592 if (request.url === request.target().resourceTreeModel.inspectedPage URL())
599 baseTime = request.startTime; 593 baseTime = request.startTime;
600 if (request.endTime > maxTime) 594 if (request.endTime > maxTime)
601 maxTime = request.endTime; 595 maxTime = request.endTime;
602 } 596 }
603 var text = ""; 597 var text = "";
604 if (selectedRequestsNumber !== requestsNumber) { 598 if (selectedRequestsNumber !== requestsNumber) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 boundariesChanged = calculator.updateBoundariesForEventTime(this._ma inRequestDOMContentLoadedTime) || boundariesChanged; 783 boundariesChanged = calculator.updateBoundariesForEventTime(this._ma inRequestDOMContentLoadedTime) || boundariesChanged;
790 } 784 }
791 785
792 var dataGrid = this._dataGrid; 786 var dataGrid = this._dataGrid;
793 var rootNode = dataGrid.rootNode(); 787 var rootNode = dataGrid.rootNode();
794 var nodesToInsert = []; 788 var nodesToInsert = [];
795 for (var requestId in this._staleRequestIds) { 789 for (var requestId in this._staleRequestIds) {
796 var node = this._nodesByRequestId.get(requestId); 790 var node = this._nodesByRequestId.get(requestId);
797 if (!node) 791 if (!node)
798 continue; 792 continue;
799 if (!node._isFilteredOut) 793 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol])
800 rootNode.removeChild(node); 794 rootNode.removeChild(node);
801 node._isFilteredOut = !this._applyFilter(node); 795 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = !this._appl yFilter(node);
802 if (!node._isFilteredOut) 796 if (!node[WebInspector.NetworkLogView._isFilteredOutSymbol])
803 nodesToInsert.push(node); 797 nodesToInsert.push(node);
804 } 798 }
805 799
806 for (var i = 0; i < nodesToInsert.length; ++i) { 800 for (var i = 0; i < nodesToInsert.length; ++i) {
807 var node = nodesToInsert[i]; 801 var node = nodesToInsert[i];
808 var request = node.request(); 802 var request = node.request();
809 node.refresh(); 803 node.refresh();
810 dataGrid.insertChild(node); 804 dataGrid.insertChild(node);
811 node._isMatchingSearchQuery = this._matchRequest(request); 805 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = thi s._matchRequest(request);
812 if (calculator.updateBoundaries(request)) 806 if (calculator.updateBoundaries(request))
813 boundariesChanged = true; 807 boundariesChanged = true;
814 } 808 }
815 809
816 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false); 810 this._highlightNthMatchedRequestForSearch(this._updateMatchCountAndFindM atchIndex(this._currentMatchedRequestNode), false);
817 811
818 if (boundariesChanged) { 812 if (boundariesChanged) {
819 // The boundaries changed, so all item graphs are stale. 813 // The boundaries changed, so all item graphs are stale.
820 this._updateDividersIfNeeded(); 814 this._updateDividersIfNeeded();
821 var nodes = this._nodesByRequestId.valuesArray(); 815 var nodes = this._nodesByRequestId.valuesArray();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 this._appendRequest(request); 876 this._appendRequest(request);
883 } 877 }
884 }, 878 },
885 879
886 /** 880 /**
887 * @param {!WebInspector.NetworkRequest} request 881 * @param {!WebInspector.NetworkRequest} request
888 */ 882 */
889 _appendRequest: function(request) 883 _appendRequest: function(request)
890 { 884 {
891 var node = new WebInspector.NetworkDataGridNode(this, request); 885 var node = new WebInspector.NetworkDataGridNode(this, request);
886 node[WebInspector.NetworkLogView._isFilteredOutSymbol] = true;
887 node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = false;
892 888
893 // In case of redirect request id is reassigned to a redirected 889 // In case of redirect request id is reassigned to a redirected
894 // request and we need to update _nodesByRequestId and search results. 890 // request and we need to update _nodesByRequestId and search results.
895 var originalRequestNode = this._nodesByRequestId.get(request.requestId); 891 var originalRequestNode = this._nodesByRequestId.get(request.requestId);
896 if (originalRequestNode) 892 if (originalRequestNode)
897 this._nodesByRequestId.set(originalRequestNode.request().requestId, originalRequestNode); 893 this._nodesByRequestId.set(originalRequestNode.request().requestId, originalRequestNode);
898 this._nodesByRequestId.set(request.requestId, node); 894 this._nodesByRequestId.set(request.requestId, node);
899 895
900 // Pull all the redirects of the main request upon commit load. 896 // Pull all the redirects of the main request upon commit load.
901 if (request.redirects) { 897 if (request.redirects) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 requestsToPick.push(request); 970 requestsToPick.push(request);
975 } 971 }
976 972
977 this._reset(); 973 this._reset();
978 974
979 for (var i = 0; i < requestsToPick.length; ++i) 975 for (var i = 0; i < requestsToPick.length; ++i)
980 this._appendRequest(requestsToPick[i]); 976 this._appendRequest(requestsToPick[i]);
981 }, 977 },
982 978
983 /** 979 /**
984 * @param {boolean} detailed 980 * @param {boolean} gridMode
985 */ 981 */
986 switchViewMode: function(detailed) 982 switchViewMode: function(gridMode)
987 { 983 {
988 if (this._detailedMode === detailed) 984 if (this._gridMode === gridMode)
989 return; 985 return;
990 this._detailedMode = detailed; 986 this._gridMode = gridMode;
991 987
992 if (detailed) { 988 if (gridMode) {
993 if (this._dataGrid.selectedNode) 989 if (this._dataGrid.selectedNode)
994 this._dataGrid.selectedNode.selected = false; 990 this._dataGrid.selectedNode.selected = false;
995 } else { 991 } else {
996 this._removeAllNodeHighlights(); 992 this._removeAllNodeHighlights();
997 this._popoverHelper.hidePopover(); 993 this._popoverHelper.hidePopover();
998 } 994 }
999 995
1000 this.element.classList.toggle("brief-mode", !detailed); 996 this.element.classList.toggle("brief-mode", !gridMode);
1001 this._updateColumns(); 997 this._updateColumns();
1002 }, 998 },
1003 999
1004 _toggleLargerRequests: function() 1000 _toggleLargerRequests: function()
1005 { 1001 {
1006 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get()); 1002 WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.reso urcesLargeRows.get());
1007 this._updateRowsSize(); 1003 this._updateRowsSize();
1008 }, 1004 },
1009 1005
1010 /** 1006 /**
(...skipping 15 matching lines...) Expand all
1026 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Row SizeChanged, { largeRows: largeRows }); 1022 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.Row SizeChanged, { largeRows: largeRows });
1027 }, 1023 },
1028 1024
1029 /** 1025 /**
1030 * @param {!Element} element 1026 * @param {!Element} element
1031 * @param {!Event} event 1027 * @param {!Event} event
1032 * @return {!Element|!AnchorBox|undefined} 1028 * @return {!Element|!AnchorBox|undefined}
1033 */ 1029 */
1034 _getPopoverAnchor: function(element, event) 1030 _getPopoverAnchor: function(element, event)
1035 { 1031 {
1036 if (!this._allowPopover) 1032 if (!this._gridMode)
1037 return; 1033 return;
1038 var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") | | element.enclosingNodeOrSelfWithClass("network-graph-label"); 1034 var anchor = element.enclosingNodeOrSelfWithClass("network-graph-bar") | | element.enclosingNodeOrSelfWithClass("network-graph-label");
1039 if (anchor && anchor.parentElement.request && anchor.parentElement.reque st.timing) 1035 if (anchor && anchor.parentElement.request && anchor.parentElement.reque st.timing)
1040 return anchor; 1036 return anchor;
1041 anchor = element.enclosingNodeOrSelfWithClass("network-script-initiated" ); 1037 anchor = element.enclosingNodeOrSelfWithClass("network-script-initiated" );
1042 if (anchor && anchor.request) { 1038 if (anchor && anchor.request) {
1043 var request = /** @type {!WebInspector.NetworkRequest} */ (anchor.re quest); 1039 var request = /** @type {!WebInspector.NetworkRequest} */ (anchor.re quest);
1044 var initiator = anchor.request.initiator(); 1040 var initiator = anchor.request.initiator();
1045 if (initiator && (initiator.stackTrace || initiator.asyncStackTrace) ) 1041 if (initiator && (initiator.stackTrace || initiator.asyncStackTrace) )
1046 return anchor; 1042 return anchor;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 row.createChild("td"); 1105 row.createChild("td");
1110 appendStackTrace.call(this, callFrames); 1106 appendStackTrace.call(this, callFrames);
1111 asyncStackTrace = asyncStackTrace.asyncStackTrace; 1107 asyncStackTrace = asyncStackTrace.asyncStackTrace;
1112 } 1108 }
1113 1109
1114 return framesTable; 1110 return framesTable;
1115 }, 1111 },
1116 1112
1117 _updateColumns: function() 1113 _updateColumns: function()
1118 { 1114 {
1119 var detailedMode = !!this._detailedMode; 1115 var gridMode = this._gridMode;
1120 var visibleColumns = {"name": true}; 1116 var visibleColumns = {"name": true};
1121 if (detailedMode) { 1117 if (gridMode) {
1122 visibleColumns["timeline"] = true; 1118 visibleColumns["timeline"] = true;
1123 var columnsVisibility = this._coulmnsVisibilitySetting.get(); 1119 var columnsVisibility = this._coulmnsVisibilitySetting.get();
1124 for (var columnIdentifier in columnsVisibility) 1120 for (var columnIdentifier in columnsVisibility)
1125 visibleColumns[columnIdentifier] = columnsVisibility[columnIdent ifier]; 1121 visibleColumns[columnIdentifier] = columnsVisibility[columnIdent ifier];
1126 } 1122 }
1127 1123
1128 this._dataGrid.setColumnsVisiblity(visibleColumns); 1124 this._dataGrid.setColumnsVisiblity(visibleColumns);
1129 }, 1125 },
1130 1126
1131 /** 1127 /**
(...skipping 27 matching lines...) Expand all
1159 return this._configurableColumnIDs; 1155 return this._configurableColumnIDs;
1160 }, 1156 },
1161 1157
1162 /** 1158 /**
1163 * @param {!Event} event 1159 * @param {!Event} event
1164 */ 1160 */
1165 _contextMenu: function(event) 1161 _contextMenu: function(event)
1166 { 1162 {
1167 var contextMenu = new WebInspector.ContextMenu(event); 1163 var contextMenu = new WebInspector.ContextMenu(event);
1168 1164
1169 if (this._detailedMode && event.target.isSelfOrDescendant(this._dataGrid .headerTableBody)) { 1165 if (this._gridMode && event.target.isSelfOrDescendant(this._dataGrid.hea derTableBody)) {
1170 var columnsVisibility = this._coulmnsVisibilitySetting.get(); 1166 var columnsVisibility = this._coulmnsVisibilitySetting.get();
1171 var columnIDs = this._getConfigurableColumnIDs(); 1167 var columnIDs = this._getConfigurableColumnIDs();
1172 var columnTitles = WebInspector.NetworkLogView._columnTitles; 1168 var columnTitles = WebInspector.NetworkLogView._columnTitles;
1173 for (var i = 0; i < columnIDs.length; ++i) { 1169 for (var i = 0; i < columnIDs.length; ++i) {
1174 var columnIdentifier = columnIDs[i]; 1170 var columnIdentifier = columnIDs[i];
1175 contextMenu.appendCheckboxItem(columnTitles[columnIdentifier], t his._toggleColumnVisibility.bind(this, columnIdentifier), !!columnsVisibility[co lumnIdentifier]); 1171 contextMenu.appendCheckboxItem(columnTitles[columnIdentifier], t his._toggleColumnVisibility.bind(this, columnIdentifier), !!columnsVisibility[co lumnIdentifier]);
1176 } 1172 }
1177 contextMenu.show(); 1173 contextMenu.show();
1178 return; 1174 return;
1179 } 1175 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 */ 1346 */
1351 _highlightNthMatchedRequestForSearch: function(n, reveal) 1347 _highlightNthMatchedRequestForSearch: function(n, reveal)
1352 { 1348 {
1353 this._removeAllHighlights(); 1349 this._removeAllHighlights();
1354 1350
1355 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ 1351 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */
1356 var nodes = this._dataGrid.rootNode().children; 1352 var nodes = this._dataGrid.rootNode().children;
1357 var matchCount = 0; 1353 var matchCount = 0;
1358 var node = null; 1354 var node = null;
1359 for (var i = 0; i < nodes.length; ++i) { 1355 for (var i = 0; i < nodes.length; ++i) {
1360 if (nodes[i]._isMatchingSearchQuery) { 1356 if (nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymbo l]) {
1361 if (matchCount === n) { 1357 if (matchCount === n) {
1362 node = nodes[i]; 1358 node = nodes[i];
1363 break; 1359 break;
1364 } 1360 }
1365 matchCount++; 1361 matchCount++;
1366 } 1362 }
1367 } 1363 }
1368 if (!node) { 1364 if (!node) {
1369 this._currentMatchedRequestNode = null; 1365 this._currentMatchedRequestNode = null;
1370 return; 1366 return;
(...skipping 23 matching lines...) Expand all
1394 performSearch: function(searchConfig, shouldJump, jumpBackwards) 1390 performSearch: function(searchConfig, shouldJump, jumpBackwards)
1395 { 1391 {
1396 var query = searchConfig.query; 1392 var query = searchConfig.query;
1397 var currentMatchedRequestNode = this._currentMatchedRequestNode; 1393 var currentMatchedRequestNode = this._currentMatchedRequestNode;
1398 this._clearSearchMatchedList(); 1394 this._clearSearchMatchedList();
1399 this._searchRegExp = createPlainTextSearchRegex(query, "i"); 1395 this._searchRegExp = createPlainTextSearchRegex(query, "i");
1400 1396
1401 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ 1397 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */
1402 var nodes = this._dataGrid.rootNode().children; 1398 var nodes = this._dataGrid.rootNode().children;
1403 for (var i = 0; i < nodes.length; ++i) 1399 for (var i = 0; i < nodes.length; ++i)
1404 nodes[i]._isMatchingSearchQuery = this._matchRequest(nodes[i].reques t()); 1400 nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = this._matchRequest(nodes[i].request());
1405 var newMatchedRequestIndex = this._updateMatchCountAndFindMatchIndex(cur rentMatchedRequestNode); 1401 var newMatchedRequestIndex = this._updateMatchCountAndFindMatchIndex(cur rentMatchedRequestNode);
1406 if (!newMatchedRequestIndex && jumpBackwards) 1402 if (!newMatchedRequestIndex && jumpBackwards)
1407 newMatchedRequestIndex = this._matchedRequestCount - 1; 1403 newMatchedRequestIndex = this._matchedRequestCount - 1;
1408 this._highlightNthMatchedRequestForSearch(newMatchedRequestIndex, should Jump); 1404 this._highlightNthMatchedRequestForSearch(newMatchedRequestIndex, should Jump);
1409 }, 1405 },
1410 1406
1411 /** 1407 /**
1412 * @return {boolean} 1408 * @return {boolean}
1413 */ 1409 */
1414 supportsCaseSensitiveSearch: function() 1410 supportsCaseSensitiveSearch: function()
(...skipping 13 matching lines...) Expand all
1428 * @param {?WebInspector.NetworkDataGridNode} node 1424 * @param {?WebInspector.NetworkDataGridNode} node
1429 * @return {number} 1425 * @return {number}
1430 */ 1426 */
1431 _updateMatchCountAndFindMatchIndex: function(node) 1427 _updateMatchCountAndFindMatchIndex: function(node)
1432 { 1428 {
1433 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */ 1429 /** @type {!Array.<!WebInspector.NetworkDataGridNode>} */
1434 var nodes = this._dataGrid.rootNode().children; 1430 var nodes = this._dataGrid.rootNode().children;
1435 var matchCount = 0; 1431 var matchCount = 0;
1436 var matchIndex = 0; 1432 var matchIndex = 0;
1437 for (var i = 0; i < nodes.length; ++i) { 1433 for (var i = 0; i < nodes.length; ++i) {
1438 if (!nodes[i]._isMatchingSearchQuery) 1434 if (!nodes[i][WebInspector.NetworkLogView._isMatchingSearchQuerySymb ol])
1439 continue; 1435 continue;
1440 if (node === nodes[i]) 1436 if (node === nodes[i])
1441 matchIndex = matchCount; 1437 matchIndex = matchCount;
1442 matchCount++; 1438 matchCount++;
1443 } 1439 }
1444 if (this._matchedRequestCount !== matchCount) { 1440 if (this._matchedRequestCount !== matchCount) {
1445 this._matchedRequestCount = matchCount; 1441 this._matchedRequestCount = matchCount;
1446 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes .SearchCountUpdated, matchCount); 1442 this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes .SearchCountUpdated, matchCount);
1447 } 1443 }
1448 return matchIndex; 1444 return matchIndex;
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 2099
2104 _toggleGridMode: function() 2100 _toggleGridMode: function()
2105 { 2101 {
2106 if (this._viewingRequestMode) { 2102 if (this._viewingRequestMode) {
2107 this._viewingRequestMode = false; 2103 this._viewingRequestMode = false;
2108 this.element.classList.remove("viewing-resource"); 2104 this.element.classList.remove("viewing-resource");
2109 this._splitView.hideMain(); 2105 this._splitView.hideMain();
2110 } 2106 }
2111 2107
2112 this._networkLogView.switchViewMode(true); 2108 this._networkLogView.switchViewMode(true);
2113 this._networkLogView.setAllowPopover(true);
2114 this._networkLogView._allowRequestSelection = false;
2115 }, 2109 },
2116 2110
2117 _toggleViewingRequestMode: function() 2111 _toggleViewingRequestMode: function()
2118 { 2112 {
2119 if (this._viewingRequestMode) 2113 if (this._viewingRequestMode)
2120 return; 2114 return;
2121 this._viewingRequestMode = true; 2115 this._viewingRequestMode = true;
2122 2116
2123 this.element.classList.add("viewing-resource"); 2117 this.element.classList.add("viewing-resource");
2124 this._splitView.showBoth(); 2118 this._splitView.showBoth();
2125 this._networkLogView.setAllowPopover(false);
2126 this._networkLogView._allowRequestSelection = true;
2127 this._networkLogView.switchViewMode(false); 2119 this._networkLogView.switchViewMode(false);
2128 }, 2120 },
2129 2121
2130 /** 2122 /**
2131 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig 2123 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
2132 * @param {boolean} shouldJump 2124 * @param {boolean} shouldJump
2133 * @param {boolean=} jumpBackwards 2125 * @param {boolean=} jumpBackwards
2134 */ 2126 */
2135 performSearch: function(searchConfig, shouldJump, jumpBackwards) 2127 performSearch: function(searchConfig, shouldJump, jumpBackwards)
2136 { 2128 {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 * @extends {WebInspector.SortableDataGridNode} 2597 * @extends {WebInspector.SortableDataGridNode}
2606 * @param {!WebInspector.NetworkLogView} parentView 2598 * @param {!WebInspector.NetworkLogView} parentView
2607 * @param {!WebInspector.NetworkRequest} request 2599 * @param {!WebInspector.NetworkRequest} request
2608 */ 2600 */
2609 WebInspector.NetworkDataGridNode = function(parentView, request) 2601 WebInspector.NetworkDataGridNode = function(parentView, request)
2610 { 2602 {
2611 WebInspector.SortableDataGridNode.call(this, {}); 2603 WebInspector.SortableDataGridNode.call(this, {});
2612 this._parentView = parentView; 2604 this._parentView = parentView;
2613 this._request = request; 2605 this._request = request;
2614 this._linkifier = new WebInspector.Linkifier(); 2606 this._linkifier = new WebInspector.Linkifier();
2615 this._isFilteredOut = true;
2616 this._isMatchingSearchQuery = false;
2617 this._staleGraph = true; 2607 this._staleGraph = true;
2618 } 2608 }
2619 2609
2620 WebInspector.NetworkDataGridNode._hoveredRowSymbol = Symbol("hoveredRow"); 2610 WebInspector.NetworkDataGridNode._hoveredRowSymbol = Symbol("hoveredRow");
2621 2611
2622 WebInspector.NetworkDataGridNode.prototype = { 2612 WebInspector.NetworkDataGridNode.prototype = {
2623 /** 2613 /**
2624 * @return {!WebInspector.NetworkRequest} 2614 * @return {!WebInspector.NetworkRequest}
2625 */ 2615 */
2626 request: function() 2616 request: function()
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 this._writeProgress.done(); 3292 this._writeProgress.done();
3303 return; 3293 return;
3304 } 3294 }
3305 const chunkSize = 100000; 3295 const chunkSize = 100000;
3306 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize); 3296 var text = this._text.substring(this._bytesWritten, this._bytesWritten + chunkSize);
3307 this._bytesWritten += text.length; 3297 this._bytesWritten += text.length;
3308 stream.write(text, this._writeNextChunk.bind(this)); 3298 stream.write(text, this._writeNextChunk.bind(this));
3309 this._writeProgress.setWorked(this._bytesWritten); 3299 this._writeProgress.setWorked(this._bytesWritten);
3310 } 3300 }
3311 } 3301 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/network/network-filter-updated-requests.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698