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
parent 7214e18679
commit a81ae8de38

View File

@ -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.
*/