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

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

Issue 685203003: DevTools: Get rid of synchronous XHRs in the frontend code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 1 month 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/sdk/CSSStyleModel.js
diff --git a/Source/devtools/front_end/sdk/CSSStyleModel.js b/Source/devtools/front_end/sdk/CSSStyleModel.js
index 6b78a184fc044590a3d7b9d6697dac31af0b44cb..09e40b6e4fcfb1ed8a5697165fd5135cd3f7b50e 100644
--- a/Source/devtools/front_end/sdk/CSSStyleModel.js
+++ b/Source/devtools/front_end/sdk/CSSStyleModel.js
@@ -1593,6 +1593,33 @@ WebInspector.CSSStyleSheetHeader.prototype = {
},
/**
+ * @return {!Promise.<string>}
+ */
+ requestContentPromise: function()
+ {
+ return new Promise(requestContent.bind(this));
+
+ /**
+ * @param {function(string)} fulfill
+ * @param {function(*)} reject
+ * @this {WebInspector.CSSStyleSheetHeader}
+ */
+ function requestContent(fulfill, reject)
+ {
+ this.requestContent(callback.bind(null, fulfill));
pfeldman 2014/11/10 10:23:25 this.requestContent(fullfill) ?
+ }
+
+ /**
+ * @param {function(string)} fulfill
+ * @param {string} content
+ */
+ function callback(fulfill, content)
+ {
+ fulfill(content);
+ }
+ },
+
+ /**
* @override
*/
searchInContent: function(query, caseSensitive, isRegex, callback)

Powered by Google App Engine
This is Rietveld 408576698