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

Unified Diff: Source/devtools/front_end/emulation/ResponsiveDesignView.js

Issue 1285183006: DevTools: WI.Throttler goes promisified. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cc
Patch Set: remove dependent patchset Created 5 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
Index: Source/devtools/front_end/emulation/ResponsiveDesignView.js
diff --git a/Source/devtools/front_end/emulation/ResponsiveDesignView.js b/Source/devtools/front_end/emulation/ResponsiveDesignView.js
index 29b10378f89c88a1845d42b02a69a1dc084977b1..e9c1c8102daba370ca128e62f624b60898ee97c7 100644
--- a/Source/devtools/front_end/emulation/ResponsiveDesignView.js
+++ b/Source/devtools/front_end/emulation/ResponsiveDesignView.js
@@ -787,12 +787,12 @@ WebInspector.ResponsiveDesignView.prototype = {
},
/**
- * @param {!WebInspector.Throttler.FinishCallback} finishCallback
+ * @return {!Promise.<?>}
*/
- _updateUIThrottled: function(finishCallback)
+ _updateUIThrottled: function()
{
this._updateUI();
- finishCallback();
+ return Promise.resolve();
},
/**
@@ -804,10 +804,10 @@ WebInspector.ResponsiveDesignView.prototype = {
this._pageScaleFactorThrottler.schedule(updatePageScaleFactor.bind(this));
/**
- * @param {!WebInspector.Throttler.FinishCallback} finishCallback
+ * @return {!Promise.<?>}
* @this {WebInspector.ResponsiveDesignView}
*/
- function updatePageScaleFactor(finishCallback)
+ function updatePageScaleFactor()
{
if (this._target && this._viewport) {
var value = this._viewport.pageScaleFactor;
@@ -816,7 +816,7 @@ WebInspector.ResponsiveDesignView.prototype = {
value = Math.max(this._viewport.minimumPageScaleFactor, value);
this._target.emulationAgent().setPageScaleFactor(value);
}
- finishCallback();
+ return Promise.resolve();
}
},
@@ -825,14 +825,14 @@ WebInspector.ResponsiveDesignView.prototype = {
this._pageScaleFactorThrottler.schedule(updatePageScaleFactor.bind(this));
/**
- * @param {!WebInspector.Throttler.FinishCallback} finishCallback
+ * @return {!Promise.<?>}
* @this {WebInspector.ResponsiveDesignView}
*/
- function updatePageScaleFactor(finishCallback)
+ function updatePageScaleFactor()
{
if (this._target && this._viewport && this._viewport.minimumPageScaleFactor <= 1 && this._viewport.maximumPageScaleFactor >= 1)
this._target.emulationAgent().setPageScaleFactor(1);
- finishCallback();
+ return Promise.resolve();
}
},
« no previous file with comments | « Source/devtools/front_end/emulation/OverridesSupport.js ('k') | Source/devtools/front_end/network/NetworkTimeCalculator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698