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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Issue 2243043002: DevTools: Do not remove custom CPU throttling value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
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 c35b15008c696939a2cee1c4c01c69678212892d..873d39da12b9f5219f52440fb62f6e109e18cb23 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 @@ WebInspector.TimelinePanel = function()
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 @@ WebInspector.TimelinePanel.prototype = {
]);
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 @@ WebInspector.TimelinePanel.prototype = {
resultPromise.then(text => {
var value = Number.parseFloat(text);
if (value >= 1) {
+ if (isLastOption)
+ this._customCPUThrottlingRate = value;
this._cpuThrottlingManager.setRate(value);
this._populateCPUThrottingCombobox();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698