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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @implements {Network.NetworkColumnExtensionInterface}
5 * @implements {Network.NetworkGroupLookupInterface} 6 * @implements {Network.NetworkGroupLookupInterface}
6 */ 7 */
7 NetworkGroupLookup.NetworkProductGroupLookup = class { 8 NetworkGroupLookup.NetworkProductGroupLookup = class {
8 /** 9 /**
9 * @override 10 * @override
10 * @param {!SDK.NetworkRequest} request 11 * @param {!SDK.NetworkRequest} request
11 * @return {?string} 12 * @return {?string}
12 */ 13 */
13 lookup(request) { 14 lookup(request) {
14 return ProductRegistry.nameForUrl(request.parsedURL); 15 return ProductRegistry.nameForUrl(request.parsedURL);
15 } 16 }
17
18 /**
19 * @override
20 * @param {!SDK.NetworkRequest} request
21 * @return {string}
22 */
23 lookupColumnValue(request) {
24 return this.lookup(request) || '';
25 }
26
27 /**
28 * @override
29 * @param {!SDK.NetworkRequest} aRequest
30 * @param {!SDK.NetworkRequest} bRequest
31 * @return {number}
32 */
33 requestComparator(aRequest, bRequest) {
34 var aValue = this.lookupColumnValue(aRequest);
35 var bValue = this.lookupColumnValue(bRequest);
36 if (aValue === bValue)
37 return aRequest.indentityCompare(bRequest);
38 return aValue > bValue ? 1 : -1;
39 }
16 }; 40 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698