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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js

Issue 2562193002: Add filtering by priority in the Network filter area. (Closed)
Patch Set: Created 4 years 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/components/NetworkConditionsSelector.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js
index fc19d6e08fe92bae648728321f050f37230e72b3..e7f943c1e80009ece963192bc621aad2031c5098 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js
@@ -501,3 +501,19 @@ Components.uiLabelForPriority = function(priority) {
}
return labelMap.get(priority) || Common.UIString('Unknown');
};
+
+/**
+ * @param {string} priorityLabel
+ * @return {string|undefined}
+ */
+Components.getPriorityByPriorityLabel = function(priorityLabel) {
allada 2016/12/12 17:29:57 Instead of doing this lets generate an inverse map
Oleksii Kadurin 2016/12/12 21:13:15 1. 'inverse map' - do you mean every time the func
allada 2016/12/12 23:51:08 We already generate a map one time for ENUM => sym
+ var labelMap = Components.uiLabelForPriority._priorityToUILabel;
+ var result;
+
+ labelMap.forEach(function(value, key) {
+ if (value === priorityLabel)
+ result = key;
+ });
+
+ return result;
+};

Powered by Google App Engine
This is Rietveld 408576698