Chromium Code Reviews| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 784 var nodesToInsert = []; | 784 var nodesToInsert = []; |
| 785 /** @type {!Array<!Network.NetworkRequestNode> } */ | 785 /** @type {!Array<!Network.NetworkRequestNode> } */ |
| 786 var nodesToRefresh = []; | 786 var nodesToRefresh = []; |
| 787 for (var requestId in this._staleRequestIds) { | 787 for (var requestId in this._staleRequestIds) { |
| 788 var node = this._nodesByRequestId.get(requestId); | 788 var node = this._nodesByRequestId.get(requestId); |
| 789 if (!node) | 789 if (!node) |
| 790 continue; | 790 continue; |
| 791 var isFilteredOut = !this._applyFilter(node); | 791 var isFilteredOut = !this._applyFilter(node); |
| 792 if (isFilteredOut && node === this._hoveredNode) | 792 if (isFilteredOut && node === this._hoveredNode) |
| 793 this._setHoveredNode(null); | 793 this._setHoveredNode(null); |
| 794 if (node[Network.NetworkLogView._isFilteredOutSymbol] !== isFilteredOut) { | |
|
dgozman
2017/01/10 00:50:28
Why change this?
allada
2017/01/19 01:31:31
Because the parent may now change and we need to r
| |
| 795 if (!node[Network.NetworkLogView._isFilteredOutSymbol]) | |
| 796 node.parent.removeChild(node); | |
| 797 | 794 |
| 798 node[Network.NetworkLogView._isFilteredOutSymbol] = isFilteredOut; | 795 if (node.parent) |
| 796 node.parent.removeChild(node); | |
| 797 node[Network.NetworkLogView._isFilteredOutSymbol] = isFilteredOut; | |
| 798 if (!node[Network.NetworkLogView._isFilteredOutSymbol]) | |
| 799 nodesToInsert.push(node); | |
| 799 | 800 |
| 800 if (!node[Network.NetworkLogView._isFilteredOutSymbol]) | |
| 801 nodesToInsert.push(node); | |
| 802 } | |
| 803 if (!isFilteredOut) | 801 if (!isFilteredOut) |
| 804 nodesToRefresh.push(node); | 802 nodesToRefresh.push(node); |
| 805 var request = node.request(); | 803 var request = node.request(); |
| 806 this._timeCalculator.updateBoundaries(request); | 804 this._timeCalculator.updateBoundaries(request); |
| 807 this._durationCalculator.updateBoundaries(request); | 805 this._durationCalculator.updateBoundaries(request); |
| 808 } | 806 } |
| 809 | 807 |
| 810 for (var i = 0; i < nodesToInsert.length; ++i) { | 808 for (var i = 0; i < nodesToInsert.length; ++i) { |
| 811 var node = nodesToInsert[i]; | 809 var node = nodesToInsert[i]; |
| 812 var request = node.request(); | 810 var request = node.request(); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 830 /** | 828 /** |
| 831 * @param {!Network.NetworkRequestNode} node | 829 * @param {!Network.NetworkRequestNode} node |
| 832 * @return {!Network.NetworkNode} | 830 * @return {!Network.NetworkNode} |
| 833 */ | 831 */ |
| 834 _parentNodeForInsert(node) { | 832 _parentNodeForInsert(node) { |
| 835 if (!Runtime.experiments.isEnabled('networkGroupingRequests')) | 833 if (!Runtime.experiments.isEnabled('networkGroupingRequests')) |
| 836 return /** @type {!Network.NetworkNode} */ (this._dataGrid.rootNode()); | 834 return /** @type {!Network.NetworkNode} */ (this._dataGrid.rootNode()); |
| 837 | 835 |
| 838 var request = node.request(); | 836 var request = node.request(); |
| 839 // TODO(allada) Make this dynamic and allow multiple grouping types. | 837 // TODO(allada) Make this dynamic and allow multiple grouping types. |
| 840 var groupKey = request.domain; | 838 var groupKey = request.connectionId; |
| 841 var group = this._nodeGroups.get(groupKey); | 839 var group = this._nodeGroups.get(groupKey); |
| 842 if (group) | 840 if (group) |
| 843 return group; | 841 return group; |
| 844 group = new Network.NetworkGroupNode(this, groupKey); | 842 group = new Network.NetworkGroupNode(this, request.url.asParsedURL().host + ' - ' + groupKey); |
|
dgozman
2017/01/10 00:50:28
Don't forget to rebase and use .url() method.
allada
2017/01/19 01:31:31
Done.
| |
| 845 this._nodeGroups.set(groupKey, group); | 843 this._nodeGroups.set(groupKey, group); |
| 846 this._dataGrid.rootNode().appendChild(group); | 844 this._dataGrid.rootNode().appendChild(group); |
| 847 return group; | 845 return group; |
| 848 } | 846 } |
| 849 | 847 |
| 850 reset() { | 848 reset() { |
| 851 this._requestWithHighlightedInitiators = null; | 849 this._requestWithHighlightedInitiators = null; |
| 852 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null); | 850 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null); |
| 853 | 851 |
| 854 this._clearSearchMatchedList(); | 852 this._clearSearchMatchedList(); |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1718 Running: 'running', | 1716 Running: 'running', |
| 1719 FromCache: 'from-cache' | 1717 FromCache: 'from-cache' |
| 1720 }; | 1718 }; |
| 1721 | 1719 |
| 1722 /** @type {!Array<string>} */ | 1720 /** @type {!Array<string>} */ |
| 1723 Network.NetworkLogView._searchKeys = | 1721 Network.NetworkLogView._searchKeys = |
| 1724 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); | 1722 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); |
| 1725 | 1723 |
| 1726 /** @typedef {function(!SDK.NetworkRequest): boolean} */ | 1724 /** @typedef {function(!SDK.NetworkRequest): boolean} */ |
| 1727 Network.NetworkLogView.Filter; | 1725 Network.NetworkLogView.Filter; |
| OLD | NEW |