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..46ef8573ede99d90b6c907cfa818e2f0e2d0e990 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
+++ b/third_party/WebKit/Source/devtools/front_end/network/FilterSuggestionBuilder.js |
@@ -79,11 +79,31 @@ Network.FilterSuggestionBuilder = class { |
* @return {!Array.<string>} |
*/ |
_values(key) { |
- var result = this._valueLists[key]; |
+ var result = /** @type {!Array<string>} */ (this._valueLists[key]); |
+ |
if (!result) |
return []; |
- result.sort(); |
+ if (key === Network.NetworkLogView.FilterType.Priority) { |
+ var resultSet = new Set(result); |
+ result = []; |
+ /** @type {!Map<number, !Protocol.Network.ResourcePriority>} */ |
+ var numericToPriorityMap = new Map(); |
+ Components.prioritySymbolToNumericMap().forEach((value, key) => numericToPriorityMap.set(value, key)); |
+ var sortedNumericPriorities = numericToPriorityMap.keysArray(); |
+ sortedNumericPriorities.sortNumbers(); |
+ 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; |
} |