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

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

Issue 1204393002: DevTools: [CSS] promisify CSSStyleModel fetching methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/MediaQueryInspector.js
diff --git a/Source/devtools/front_end/emulation/MediaQueryInspector.js b/Source/devtools/front_end/emulation/MediaQueryInspector.js
index e10e6211ab3e22fb529725ffd675d69ce84f5152..0fa351ff1d8a390d185626f7d4a0ef1869a4015f 100644
--- a/Source/devtools/front_end/emulation/MediaQueryInspector.js
+++ b/Source/devtools/front_end/emulation/MediaQueryInspector.js
@@ -185,16 +185,10 @@ WebInspector.MediaQueryInspector.prototype = {
return;
}
- /**
- * @param {!Array.<!WebInspector.CSSMedia>} cssMedias
- * @this {!WebInspector.MediaQueryInspector}
- */
- function callback(cssMedias)
- {
- this._rebuildMediaQueries(cssMedias);
- finishCallback();
- }
- this._cssModel.getMediaQueries(callback.bind(this));
+ this._cssModel.mediaQueriesPromise()
+ .then(this._rebuildMediaQueries.bind(this))
+ .then(finishCallback)
pfeldman 2015/06/26 09:59:17 then(finishCallback, finishCallback);
lushnikov 2015/06/26 10:16:26 The .catch is way more easy to read and find visua
+ .catch(finishCallback);
},
/**
« no previous file with comments | « Source/devtools/front_end/elements/SharedSidebarModel.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698