Bug 1756995 - Optimize docshell load end session store collection. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D146207
This commit is contained in:
@@ -5796,8 +5796,8 @@ nsDocShell::OnStateChange(nsIWebProgress* aProgress, nsIRequest* aRequest,
|
||||
if (WindowContext* windowContext =
|
||||
mBrowsingContext->GetCurrentWindowContext()) {
|
||||
SessionStoreChild::From(windowContext->GetWindowGlobalChild())
|
||||
->SendResetSessionStore(
|
||||
mBrowsingContext, mBrowsingContext->GetSessionStoreEpoch());
|
||||
->ResetSessionStore(mBrowsingContext,
|
||||
mBrowsingContext->GetSessionStoreEpoch());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6538,11 +6538,14 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
|
||||
if constexpr (SessionStoreUtils::NATIVE_LISTENER) {
|
||||
if (WindowContext* windowContext =
|
||||
mBrowsingContext->GetCurrentWindowContext()) {
|
||||
// TODO(farre): File bug: From a user perspective this would probably be
|
||||
// just fine to run off the change listener timer. Turns out that a flush
|
||||
// is needed. Several tests depend on this behaviour. Could potentially be
|
||||
// an optimization for later. See Bug 1756995.
|
||||
SessionStoreChangeListener::FlushAllSessionStoreData(windowContext);
|
||||
using Change = SessionStoreChangeListener::Change;
|
||||
|
||||
// We've finished loading the page and now we want to collect all the
|
||||
// session store state that the page is initialized with.
|
||||
SessionStoreChangeListener::CollectSessionStoreData(
|
||||
windowContext,
|
||||
EnumSet<Change>(Change::Input, Change::Scroll, Change::SessionHistory,
|
||||
Change::WireFrame));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user