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

Unified Diff: Source/devtools/front_end/elements/ElementsSidebarPane.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/elements/ElementsSidebarPane.js
diff --git a/Source/devtools/front_end/elements/ElementsSidebarPane.js b/Source/devtools/front_end/elements/ElementsSidebarPane.js
index a65e6e59e51b31849a118715d09c0f2820c8ea16..e94247dffe25a655ea96aa60736e9933f1f4ab62 100644
--- a/Source/devtools/front_end/elements/ElementsSidebarPane.js
+++ b/Source/devtools/front_end/elements/ElementsSidebarPane.js
@@ -51,12 +51,12 @@ WebInspector.ElementsSidebarPane.prototype = {
},
/**
- * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
* @protected
+ * @return {!Promise.<?>}
*/
- doUpdate: function(finishedCallback)
+ doUpdate: function()
{
- finishedCallback();
+ return Promise.resolve();
},
update: function()
@@ -134,7 +134,7 @@ WebInspector.ElementsSidebarPane.prototype = {
/**
* @constructor
* @param {!WebInspector.Widget} view
- * @param {function(!WebInspector.Throttler.FinishCallback)} doUpdate
+ * @param {function():!Promise.<?>} doUpdate
*/
WebInspector.ElementsSidebarPane._UpdateController = function(view, doUpdate)
{
@@ -153,15 +153,12 @@ WebInspector.ElementsSidebarPane._UpdateController.prototype = {
this._updateThrottler.schedule(innerUpdate.bind(this));
/**
- * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
* @this {WebInspector.ElementsSidebarPane._UpdateController}
+ * @return {!Promise.<?>}
*/
- function innerUpdate(finishedCallback)
+ function innerUpdate()
{
- if (this._view.isShowing())
- this._doUpdate.call(null, finishedCallback);
- else
- finishedCallback();
+ return this._view.isShowing() ? this._doUpdate.call(null) : Promise.resolve();
}
},
« no previous file with comments | « Source/devtools/front_end/elements/ComputedStyleWidget.js ('k') | Source/devtools/front_end/elements/EventListenersWidget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698