DevTools: Do not remove custom CPU throttling value.

BUG=436111

Review-Url: https://codereview.chromium.org/2243043002
Cr-Commit-Position: refs/heads/master@{#411906}
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
index c35b150..873d39d 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -49,6 +49,7 @@
     this._windowEndTime = Infinity;
     this._millisecondsToRecordAfterLoadEvent = 3000;
     this._toggleRecordAction = /** @type {!WebInspector.Action }*/ (WebInspector.actionRegistry.action("timeline.toggle-recording"));
+    this._customCPUThrottlingRate = 0;
 
     /** @type {!Array<!WebInspector.TimelineModel.Filter>} */
     this._filters = [];
@@ -437,10 +438,9 @@
         ]);
         for (var rate of predefinedRates)
             addGroupingOption(rate[1], rate[0]);
-        var customRateText = predefinedRates.has(currentRate)
-            ? WebInspector.UIString("Custom rate\u2026")
-            : WebInspector.UIString("Custom rate (%d\xD7 slowdown)", currentRate);
-        addGroupingOption(customRateText, 0);
+        if (this._customCPUThrottlingRate && !predefinedRates.has(this._customCPUThrottlingRate))
+            addGroupingOption(WebInspector.UIString("Custom rate (%d\xD7 slowdown)", this._customCPUThrottlingRate), this._customCPUThrottlingRate);
+        addGroupingOption(WebInspector.UIString("Set custom rate\u2026"), 0);
     },
 
     _prepareToLoadTimeline: function()
@@ -585,6 +585,8 @@
         resultPromise.then(text => {
             var value = Number.parseFloat(text);
             if (value >= 1) {
+                if (isLastOption)
+                    this._customCPUThrottlingRate = value;
                 this._cpuThrottlingManager.setRate(value);
                 this._populateCPUThrottingCombobox();
             }