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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js

Issue 2756583002: [Devtools] Added ability to add extension columns to network (Closed)
Patch Set: changes Created 3 years, 9 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
Index: third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js b/third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js
index e8594675bb6c29548a594c973561218d840e389c..c264d77c74023341d17753232b8edb1a0b8a1563 100644
--- a/third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js
+++ b/third_party/WebKit/Source/devtools/front_end/network_group_lookup/NetworkProductGroupLookup.js
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
+ * @implements {Network.NetworkColumnExtensionInterface}
* @implements {Network.NetworkGroupLookupInterface}
*/
NetworkGroupLookup.NetworkProductGroupLookup = class {
@@ -13,4 +14,27 @@ NetworkGroupLookup.NetworkProductGroupLookup = class {
lookup(request) {
return ProductRegistry.nameForUrl(request.parsedURL);
}
+
+ /**
+ * @override
+ * @param {!SDK.NetworkRequest} request
+ * @return {string}
+ */
+ lookupColumnValue(request) {
+ return this.lookup(request) || '';
+ }
+
+ /**
+ * @override
+ * @param {!SDK.NetworkRequest} aRequest
+ * @param {!SDK.NetworkRequest} bRequest
+ * @return {number}
+ */
+ requestComparator(aRequest, bRequest) {
+ var aValue = this.lookupColumnValue(aRequest);
+ var bValue = this.lookupColumnValue(bRequest);
+ if (aValue === bValue)
+ return aRequest.indentityCompare(bRequest);
+ return aValue > bValue ? 1 : -1;
+ }
};

Powered by Google App Engine
This is Rietveld 408576698