Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
| index 4cef0d366be55bae10ee8ff96e56376d9abfc7d1..c926e541bfefb8935afcc4b436a18652123495ad 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js |
| @@ -353,6 +353,7 @@ Network.NetworkLogView = class extends UI.VBox { |
| */ |
| setGrouping(grouping) { |
| this._activeGroupLookup = grouping; |
| + this._nodeGroups.clear(); |
| this._invalidateAllItems(); |
| } |
| @@ -874,16 +875,16 @@ Network.NetworkLogView = class extends UI.VBox { |
| if (!this._activeGroupLookup) |
| return this._dataGrid.rootNode(); |
| - var groupName = this._activeGroupLookup.lookup(node.request()); |
| - if (!groupName) |
| + var groupKey = this._activeGroupLookup.groupKeyForRequest(node.request()); |
| + if (!groupKey) |
| return this._dataGrid.rootNode(); |
| - var group = this._nodeGroups.get(groupName); |
| + var group = this._nodeGroups.get(groupKey); |
| if (group) |
| return group; |
| - group = new Network.NetworkGroupNode(this, groupName); |
| + group = new Network.NetworkGroupNode(this, this._activeGroupLookup.groupNameForKey(groupKey)); |
| group.setColumnExtensions(this._columns.columnExtensions()); |
| - this._nodeGroups.set(groupName, group); |
| + this._nodeGroups.set(groupKey, group); |
| return group; |
| } |
| @@ -1802,13 +1803,20 @@ Network.NetworkLogView.Filter; |
| /** |
| * @interface |
| + * @template T |
| */ |
| Network.NetworkGroupLookupInterface = function() {}; |
| Network.NetworkGroupLookupInterface.prototype = { |
| /** |
| * @param {!SDK.NetworkRequest} request |
| - * @return {?string} |
| + * @return {?T} |
|
pfeldman
2017/03/31 00:55:06
It can't be template, it should be an Object or "*
allada
2017/04/03 17:40:52
Done.
|
| + */ |
| + groupKeyForRequest(request) {}, |
|
pfeldman
2017/03/31 00:55:06
Also, just say "groupForRequest"
allada
2017/04/03 17:40:52
Done.
|
| + |
| + /** |
| + * @param {!T} key |
| + * @return {string} |
| */ |
| - lookup(request) {} |
| + groupNameForKey(key) {} |
| }; |