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

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

Issue 2698743003: [Devtools] Prepared network panel for Group Lookup Interface (Closed)
Patch Set: changes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b408c94daa1016ebf62d75f9c10c5c399288bd46..e83ecc02250e6abeac606dcb77585a5dadacfa76 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -57,6 +57,9 @@ Network.NetworkLogView = class extends UI.VBox {
this._durationCalculator = new Network.NetworkTransferDurationCalculator();
this._calculator = this._timeCalculator;
+ /** @type {?Network.NetworkGroupLookupInterface} */
+ this._activeGroupLookup = null;
+
/**
* @this {Network.NetworkLogView}
*/
@@ -345,6 +348,14 @@ Network.NetworkLogView = class extends UI.VBox {
}
/**
+ * @param {?Network.NetworkGroupLookupInterface} grouping
+ */
+ setGrouping(grouping) {
+ this._activeGroupLookup = grouping;
+ this._invalidateAllItems();
+ }
+
+ /**
* @param {!SDK.NetworkRequest} request
* @return {?Network.NetworkRequestNode}
*/
@@ -846,25 +857,21 @@ Network.NetworkLogView = class extends UI.VBox {
/**
* @param {!Network.NetworkRequestNode} node
- * @return {!Network.NetworkNode}
+ * @return {?Network.NetworkNode}
*/
_parentNodeForInsert(node) {
- if (!Runtime.experiments.isEnabled('networkGroupingRequests'))
- return /** @type {!Network.NetworkNode} */ (this._dataGrid.rootNode());
+ if (!this._activeGroupLookup)
+ return this._dataGrid.rootNode();
- var request = node.request();
- // TODO(allada) Make this dynamic and allow multiple grouping types.
- var groupKey = request.connectionId;
- var group = this._nodeGroups.get(groupKey);
+ var groupName = this._activeGroupLookup.lookup(node.request());
+ if (!groupName)
+ return this._dataGrid.rootNode();
+
+ var group = this._nodeGroups.get(groupName);
if (group)
return group;
-
- var parsedURL = request.url().asParsedURL();
- var host = '';
- if (parsedURL)
- host = parsedURL.host;
- group = new Network.NetworkGroupNode(this, host + ' - ' + groupKey);
- this._nodeGroups.set(groupKey, group);
+ group = new Network.NetworkGroupNode(this, groupName);
+ this._nodeGroups.set(groupName, group);
return group;
}
@@ -1779,3 +1786,16 @@ Network.NetworkLogView._searchKeys =
/** @typedef {function(!SDK.NetworkRequest): boolean} */
Network.NetworkLogView.Filter;
+
+/**
+ * @interface
+ */
+Network.NetworkGroupLookupInterface = function() {};
+
+Network.NetworkGroupLookupInterface.prototype = {
+ /**
+ * @param {!SDK.NetworkRequest} request
+ * @return {?string}
+ */
+ lookup(request) {}
+};
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698