Index: third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js b/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
index a3ea2f88fbe51b00dfcfab29793ec9a8047c696e..78ef7c1d1113cb4e4143de18f781aa5d4681ecba 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
+++ b/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
@@ -80,10 +80,27 @@ Network.FilterSuggestionBuilder = class { |
*/ |
_values(key) { |
var result = this._valueLists[key]; |
allada
2016/12/20 01:35:00
nit: Just to try and help closure catch any future
|
+ |
if (!result) |
return []; |
- result.sort(); |
+ if (key === Network.NetworkLogView.FilterType.Priority) { |
+ var resultSet = new Set(result); |
+ result = []; |
+ var numericToPriorityMap = Components.symbolicToNumericMap().inverse({regularMap: true}); |
allada
2016/12/20 01:35:00
Lets replace this with:
/** @type {!Map<number, !
|
+ var sortedNumericPriorities = numericToPriorityMap.keysArray().sortNumbers(); |
allada
2016/12/20 01:35:00
Lets make this:
var sortedNumericPriorities = nume
|
+ var sortedPriorities = sortedNumericPriorities.map(value => numericToPriorityMap.get(value)); |
+ var sortedPriorityLabels = sortedPriorities.map(value => Components.uiLabelForPriority(value)); |
+ |
+ for (var value of sortedPriorityLabels) { |
+ if (!resultSet.has(value)) |
+ continue; |
+ result.push(value); |
+ } |
+ } else { |
+ result.sort(); |
+ } |
+ |
return result; |
} |