mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921310 - Don't collect extra data for restoring tabs (r=ttaubert)
This commit is contained in:
parent
52b2bbf886
commit
acded981e0
@ -4336,6 +4336,14 @@ let TabState = {
|
|||||||
return Promise.resolve(TabStateCache.get(tab));
|
return Promise.resolve(TabStateCache.get(tab));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the tab hasn't been restored yet, just return the data we
|
||||||
|
// have saved for it.
|
||||||
|
let browser = tab.linkedBrowser;
|
||||||
|
if (!browser.currentURI || (browser.__SS_data && browser.__SS_tabStillLoading)) {
|
||||||
|
let tabData = new TabData(this._collectBaseTabData(tab));
|
||||||
|
return Promise.resolve(tabData);
|
||||||
|
}
|
||||||
|
|
||||||
let promise = Task.spawn(function task() {
|
let promise = Task.spawn(function task() {
|
||||||
// Collected session history data asynchronously.
|
// Collected session history data asynchronously.
|
||||||
let history = yield Messenger.send(tab, "SessionStore:collectSessionHistory");
|
let history = yield Messenger.send(tab, "SessionStore:collectSessionHistory");
|
||||||
@ -4355,15 +4363,15 @@ let TabState = {
|
|||||||
tabData.storage = storage;
|
tabData.storage = storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put tabData into cache when reading scroll and text data succeeds.
|
// Save text and scroll data.
|
||||||
if (this._updateTextAndScrollDataForTab(tab, tabData)) {
|
this._updateTextAndScrollDataForTab(tab, tabData);
|
||||||
// If we're still the latest async collection for the given tab and
|
|
||||||
// the cache hasn't been filled by collect() in the meantime, let's
|
// If we're still the latest async collection for the given tab and
|
||||||
// fill the cache with the data we received.
|
// the cache hasn't been filled by collect() in the meantime, let's
|
||||||
if (this._pendingCollections.get(tab) == promise) {
|
// fill the cache with the data we received.
|
||||||
TabStateCache.set(tab, tabData);
|
if (this._pendingCollections.get(tab) == promise) {
|
||||||
this._pendingCollections.delete(tab);
|
TabStateCache.set(tab, tabData);
|
||||||
}
|
this._pendingCollections.delete(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Task.Result(tabData);
|
throw new Task.Result(tabData);
|
||||||
|
Loading…
Reference in New Issue
Block a user