mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Bug 1171708 - Add flushWindow method to TabStateFlusher. r=billm
--HG-- extra : commitid : Fki4voYyoRA extra : rebase_source : 9712d7200f9c658a3e0e978e4f0fbbd11413697c
This commit is contained in:
parent
7214e18679
commit
a81ae8de38
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user