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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 11 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: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
index 50b966ede0fab80d5a1b4ead4496f85d8d29afa1..32df7ceb69d99e4d6e629d224e1dbb120857af68 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleModel.js
@@ -1907,13 +1907,12 @@ WebInspector.CSSStyleSheetHeader.prototype = {
/**
* @override
- * @param {function(string)} userCallback
+ * @return {!Promise<?string>}
*/
- requestContent: function(userCallback)
+ requestContent: function()
{
- this._cssModel._agent.getStyleSheetText(this.id, textCallback.bind(this))
- .catchException("")
- .then(userCallback)
+ return this._cssModel._agent.getStyleSheetText(this.id, textCallback.bind(this))
+ .catchException(/** @type {?string} */(""));
/**
* @param {?Protocol.Error} error
@@ -1943,7 +1942,7 @@ WebInspector.CSSStyleSheetHeader.prototype = {
}
// searchInContent should call back later.
- this.requestContent(performSearch);
+ this.requestContent().then(performSearch);
},
/**

Powered by Google App Engine
This is Rietveld 408576698