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

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 groupResultTuple = this._activeGroupLookup.lookupNameForRequest(node.req uest());
878 if (!groupName) 879 if (!groupResultTuple)
879 return this._dataGrid.rootNode(); 880 return this._dataGrid.rootNode();
880 881
881 var group = this._nodeGroups.get(groupName); 882 var groupKey = groupResultTuple[0];
883 var groupName = groupResultTuple[1];
884 var group = this._nodeGroups.get(groupKey);
882 if (group) 885 if (group)
883 return group; 886 return group;
884 group = new Network.NetworkGroupNode(this, groupName); 887 group = new Network.NetworkGroupNode(this, groupName);
885 group.setColumnExtensions(this._columns.columnExtensions()); 888 group.setColumnExtensions(this._columns.columnExtensions());
886 this._nodeGroups.set(groupName, group); 889 this._nodeGroups.set(groupKey, group);
887 return group; 890 return group;
888 } 891 }
889 892
890 reset() { 893 reset() {
891 this._requestWithHighlightedInitiators = null; 894 this._requestWithHighlightedInitiators = null;
892 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null); 895 this.dispatchEventToListeners(Network.NetworkLogView.Events.RequestSelected, null);
893 896
894 this._clearSearchMatchedList(); 897 this._clearSearchMatchedList();
895 898
896 this._setHoveredNode(null); 899 this._setHoveredNode(null);
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 Network.NetworkLogView.Filter; 1804 Network.NetworkLogView.Filter;
1802 1805
1803 /** 1806 /**
1804 * @interface 1807 * @interface
1805 */ 1808 */
1806 Network.NetworkGroupLookupInterface = function() {}; 1809 Network.NetworkGroupLookupInterface = function() {};
1807 1810
1808 Network.NetworkGroupLookupInterface.prototype = { 1811 Network.NetworkGroupLookupInterface.prototype = {
1809 /** 1812 /**
1810 * @param {!SDK.NetworkRequest} request 1813 * @param {!SDK.NetworkRequest} request
1811 * @return {?string} 1814 * @return {?Network.NetworkGroupLookupInterface.LookupKeyNameTuple}
1812 */ 1815 */
1813 lookup(request) {} 1816 lookupNameForRequest(request) {}
1814 }; 1817 };
1818
1819 /**
1820 * @typedef {!Array<string>}
1821 */
1822 Network.NetworkGroupLookupInterface.LookupKeyNameTuple;
pfeldman 2017/03/30 23:45:50 use an objects with key and value fields instead.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698