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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2694103007: [Devtools] Fixes network group to remove parents if no child (Closed)
Patch Set: Created 3 years, 10 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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 var isFilteredOut = !this._applyFilter(node); 793 var isFilteredOut = !this._applyFilter(node);
794 if (isFilteredOut && node === this._hoveredNode) 794 if (isFilteredOut && node === this._hoveredNode)
795 this._setHoveredNode(null); 795 this._setHoveredNode(null);
796 796
797 if (!isFilteredOut) 797 if (!isFilteredOut)
798 nodesToRefresh.push(node); 798 nodesToRefresh.push(node);
799 var request = node.request(); 799 var request = node.request();
800 this._timeCalculator.updateBoundaries(request); 800 this._timeCalculator.updateBoundaries(request);
801 this._durationCalculator.updateBoundaries(request); 801 this._durationCalculator.updateBoundaries(request);
802 802
803 if (node[Network.NetworkLogView._isFilteredOutSymbol] === isFilteredOut)
pfeldman 2017/02/16 01:55:14 offtopic: why do we actually need this symbol at a
804 continue;
805
806 node[Network.NetworkLogView._isFilteredOutSymbol] = isFilteredOut; 803 node[Network.NetworkLogView._isFilteredOutSymbol] = isFilteredOut;
807 var newParent = this._parentNodeForInsert(node); 804 var newParent = this._parentNodeForInsert(node);
808 var removeFromParent = node.parent && (isFilteredOut || node.parent !== ne wParent); 805 var removeFromParent = node.parent && (isFilteredOut || node.parent !== ne wParent);
809 if (removeFromParent) { 806 if (removeFromParent) {
810 var parent = node.parent; 807 var parent = node.parent;
811 parent.removeChild(node); 808 parent.removeChild(node);
812 while (parent && !parent.hasChildren() && parent.dataGrid && parent.data Grid.rootNode() !== parent) { 809 while (parent && !parent.hasChildren() && parent.dataGrid && parent.data Grid.rootNode() !== parent) {
813 var grandparent = parent.parent; 810 var grandparent = parent.parent;
814 grandparent.removeChild(parent); 811 grandparent.removeChild(parent);
815 parent = grandparent; 812 parent = grandparent;
816 } 813 }
817 } 814 }
818 815
819 if (isFilteredOut) 816 if (!newParent || isFilteredOut)
820 continue; 817 continue;
821 818
822 if (!newParent.dataGrid && !nodesToInsert.has(newParent)) { 819 if (!newParent.dataGrid && !nodesToInsert.has(newParent)) {
823 nodesToInsert.set(newParent, this._dataGrid.rootNode()); 820 nodesToInsert.set(newParent, this._dataGrid.rootNode());
824 nodesToRefresh.push(newParent); 821 nodesToRefresh.push(newParent);
825 } 822 }
826 nodesToInsert.set(node, newParent); 823 nodesToInsert.set(node, newParent);
827 } 824 }
828 825
829 for (var node of nodesToInsert.keys()) { 826 for (var node of nodesToInsert.keys()) {
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 Running: 'running', 1772 Running: 'running',
1776 FromCache: 'from-cache' 1773 FromCache: 'from-cache'
1777 }; 1774 };
1778 1775
1779 /** @type {!Array<string>} */ 1776 /** @type {!Array<string>} */
1780 Network.NetworkLogView._searchKeys = 1777 Network.NetworkLogView._searchKeys =
1781 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); 1778 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]);
1782 1779
1783 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1780 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1784 Network.NetworkLogView.Filter; 1781 Network.NetworkLogView.Filter;
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