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

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

Issue 2788793002: [Devtools] Added frame grouping to network panel (Closed)
Patch Set: [Devtools] Added frame grouping to network panel Created 3 years, 8 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
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 if (request.endTime !== -1 && request.endTime < windowStart) 346 if (request.endTime !== -1 && request.endTime < windowStart)
347 return false; 347 return false;
348 return true; 348 return true;
349 } 349 }
350 350
351 /** 351 /**
352 * @param {?Network.NetworkGroupLookupInterface} grouping 352 * @param {?Network.NetworkGroupLookupInterface} grouping
353 */ 353 */
354 setGrouping(grouping) { 354 setGrouping(grouping) {
355 this._activeGroupLookup = grouping; 355 this._activeGroupLookup = grouping;
356 this._nodeGroups.clear();
356 this._invalidateAllItems(); 357 this._invalidateAllItems();
357 } 358 }
358 359
359 /** 360 /**
360 * @param {!SDK.NetworkRequest} request 361 * @param {!SDK.NetworkRequest} request
361 * @return {?Network.NetworkRequestNode} 362 * @return {?Network.NetworkRequestNode}
362 */ 363 */
363 nodeForRequest(request) { 364 nodeForRequest(request) {
364 return this._nodesByRequestId.get(request.requestId()); 365 return this._nodesByRequestId.get(request.requestId());
365 } 366 }
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 868 }
868 869
869 /** 870 /**
870 * @param {!Network.NetworkRequestNode} node 871 * @param {!Network.NetworkRequestNode} node
871 * @return {?Network.NetworkNode} 872 * @return {?Network.NetworkNode}
872 */ 873 */
873 _parentNodeForInsert(node) { 874 _parentNodeForInsert(node) {
874 if (!this._activeGroupLookup) 875 if (!this._activeGroupLookup)
875 return this._dataGrid.rootNode(); 876 return this._dataGrid.rootNode();
876 877
877 var groupName = this._activeGroupLookup.lookup(node.request()); 878 var groupKey = this._activeGroupLookup.groupKeyForRequest(node.request());
878 if (!groupName) 879 if (!groupKey)
879 return this._dataGrid.rootNode(); 880 return this._dataGrid.rootNode();
880 881
881 var group = this._nodeGroups.get(groupName); 882 var group = this._nodeGroups.get(groupKey);
882 if (group) 883 if (group)
883 return group; 884 return group;
884 group = new Network.NetworkGroupNode(this, groupName); 885 group = new Network.NetworkGroupNode(this, this._activeGroupLookup.groupName ForKey(groupKey));
885 group.setColumnExtensions(this._columns.columnExtensions()); 886 group.setColumnExtensions(this._columns.columnExtensions());
886 this._nodeGroups.set(groupName, group); 887 this._nodeGroups.set(groupKey, group);
887 return group; 888 return group;
888 } 889 }
889 890
890 reset() { 891 reset() {
891 this._requestWithHighlightedInitiators = null; 892 this._requestWithHighlightedInitiators = null;
892 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null); 893 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null);
893 894
894 this._clearSearchMatchedList(); 895 this._clearSearchMatchedList();
895 896
896 this._setHoveredNode(null); 897 this._setHoveredNode(null);
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 1796
1796 /** @type {!Array<string>} */ 1797 /** @type {!Array<string>} */
1797 Network.NetworkLogView._searchKeys = 1798 Network.NetworkLogView._searchKeys =
1798 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]); 1799 Object.keys(Network.NetworkLogView.FilterType).map(key => Network.NetworkLog View.FilterType[key]);
1799 1800
1800 /** @typedef {function(!SDK.NetworkRequest): boolean} */ 1801 /** @typedef {function(!SDK.NetworkRequest): boolean} */
1801 Network.NetworkLogView.Filter; 1802 Network.NetworkLogView.Filter;
1802 1803
1803 /** 1804 /**
1804 * @interface 1805 * @interface
1806 * @template T
1805 */ 1807 */
1806 Network.NetworkGroupLookupInterface = function() {}; 1808 Network.NetworkGroupLookupInterface = function() {};
1807 1809
1808 Network.NetworkGroupLookupInterface.prototype = { 1810 Network.NetworkGroupLookupInterface.prototype = {
1809 /** 1811 /**
1810 * @param {!SDK.NetworkRequest} request 1812 * @param {!SDK.NetworkRequest} request
1811 * @return {?string} 1813 * @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.
1812 */ 1814 */
1813 lookup(request) {} 1815 groupKeyForRequest(request) {},
pfeldman 2017/03/31 00:55:06 Also, just say "groupForRequest"
allada 2017/04/03 17:40:52 Done.
1816
1817 /**
1818 * @param {!T} key
1819 * @return {string}
1820 */
1821 groupNameForKey(key) {}
1814 }; 1822 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698