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

--HG--
extra : commitid : Fki4voYyoRA
extra : rebase_source : 9712d7200f9c658a3e0e978e4f0fbbd11413697c
This commit is contained in:
Mike Conley 2015-11-06 13:09:14 -05:00
Родитель 7214e18679
Коммит a81ae8de38
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.
*/