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

Unified Diff: Source/devtools/front_end/elements/PlatformFontsWidget.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/PlatformFontsWidget.js
diff --git a/Source/devtools/front_end/elements/PlatformFontsWidget.js b/Source/devtools/front_end/elements/PlatformFontsWidget.js
index 315c31eac55b6b68ec8f64c47dccc2860791c38b..037897bf31f34654ec009aa43d83912f321795ed 100644
--- a/Source/devtools/front_end/elements/PlatformFontsWidget.js
+++ b/Source/devtools/front_end/elements/PlatformFontsWidget.js
@@ -60,21 +60,18 @@ WebInspector.PlatformFontsWidget.createSidebarWrapper = function(sharedModel)
WebInspector.PlatformFontsWidget.prototype = {
/**
* @override
- * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
* @protected
+ * @return {!Promise.<?>}
*/
- doUpdate: function(finishedCallback)
+ doUpdate: function()
{
var cssModel = this._sharedModel.cssModel();
var node = this._sharedModel.node();
- if (!node || !cssModel) {
- finishedCallback();
- return;
- }
- cssModel.platformFontsPromise(node.id)
+ if (!node || !cssModel)
+ return Promise.resolve();
+
+ return cssModel.platformFontsPromise(node.id)
.then(this._refreshUI.bind(this, node))
- .then(finishedCallback)
- .catch(/** @type {function()} */(finishedCallback));
},
/**
« no previous file with comments | « Source/devtools/front_end/elements/MetricsSidebarPane.js ('k') | Source/devtools/front_end/elements/PropertiesWidget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698