Bug 1171708 - Add flushWindow method to TabStateFlusher. r=billm

--HG--
extra : commitid : H3Y1P9Mj63v
extra : rebase_source : 96c93f0b6fc6a9befe4dad4a0f47902279156474
extra : source : 82c9750d88e204516d04eaa91209e7bec691b57c
This commit is contained in:
Mike Conley 2015-11-06 13:09:14 -05:00
Родитель bb6e0bc780
Коммит 377e02d7ba
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -27,6 +27,14 @@ this.TabStateFlusher = Object.freeze({
return TabStateFlusherInternal.flush(browser);
},
/**
* Requests an async flush for all browsers of a given window. Returns a Promise
* that will resolve when we've heard back from all browsers.
*/
flushWindow(window) {
return TabStateFlusherInternal.flushWindow(window);
},
/**
* Resolves the flush request with the given flush ID.
*/
@ -75,6 +83,16 @@ var TabStateFlusherInternal = {
});
},
/**
* Requests an async flush for all browsers of a given window. Returns a Promise
* that will resolve when we've heard back from all browsers.
*/
flushWindow(window) {
let browsers = window.gBrowser.browsers;
let promises = browsers.map((browser) => this.flush(browser));
return Promise.all(promises);
},
/**
* Resolves the flush request with the given flush ID.
*/