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

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: changes 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 /** @type {number} */ 67 /** @type {number} */
68 this._rowHeight = !!this._networkLogLargeRowsSetting.get() ? 41 : 21; 68 this._rowHeight = !!this._networkLogLargeRowsSetting.get() ? 41 : 21;
69 } 69 }
70 updateRowHeight.call(this); 70 updateRowHeight.call(this);
71 71
72 this._columns = new Network.NetworkLogViewColumns( 72 this._columns = new Network.NetworkLogViewColumns(
73 this, this._timeCalculator, this._durationCalculator, networkLogLargeRow sSetting); 73 this, this._timeCalculator, this._durationCalculator, networkLogLargeRow sSetting);
74 74
75 /** @type {!Map.<string, !Network.NetworkRequestNode>} */ 75 /** @type {!Map.<string, !Network.NetworkRequestNode>} */
76 this._nodesByRequestId = new Map(); 76 this._nodesByRequestId = new Map();
77 /** @type {!Map.<string, !Network.NetworkGroupNode>} */ 77 /** @type {!Map<*, !Network.NetworkGroupNode>} */
78 this._nodeGroups = new Map(); 78 this._nodeGroups = new Map();
79 /** @type {!Object.<string, boolean>} */ 79 /** @type {!Object.<string, boolean>} */
80 this._staleRequestIds = {}; 80 this._staleRequestIds = {};
81 /** @type {number} */ 81 /** @type {number} */
82 this._mainRequestLoadTime = -1; 82 this._mainRequestLoadTime = -1;
83 /** @type {number} */ 83 /** @type {number} */
84 this._mainRequestDOMContentLoadedTime = -1; 84 this._mainRequestDOMContentLoadedTime = -1;
85 this._matchedRequestCount = 0; 85 this._matchedRequestCount = 0;
86 this._highlightedSubstringChanges = []; 86 this._highlightedSubstringChanges = [];
87 87
(...skipping 258 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.groupForRequest(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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 Network.NetworkLogView.Filter; 1802 Network.NetworkLogView.Filter;
1802 1803
1803 /** 1804 /**
1804 * @interface 1805 * @interface
1805 */ 1806 */
1806 Network.NetworkGroupLookupInterface = function() {}; 1807 Network.NetworkGroupLookupInterface = function() {};
1807 1808
1808 Network.NetworkGroupLookupInterface.prototype = { 1809 Network.NetworkGroupLookupInterface.prototype = {
1809 /** 1810 /**
1810 * @param {!SDK.NetworkRequest} request 1811 * @param {!SDK.NetworkRequest} request
1811 * @return {?string} 1812 * @return {?*}
1812 */ 1813 */
1813 lookup(request) {} 1814 groupForRequest(request) {},
1815
1816 /**
1817 * @param {!*} key
1818 * @return {string}
1819 */
1820 groupNameForKey(key) {}
pfeldman 2017/04/04 20:11:59 nit: groupName(key)
allada 2017/04/04 21:25:56 Done.
1814 }; 1821 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698