Bug 1687267 - remove pending history navigations when swithing to another process, r=peterv

The patch is based on code inspection. Crashes seem to happen when mHistory has been cleared,
and yet PendingAsyncHistoryNavigation::Run calls Go().

Differential Revision: https://phabricator.services.mozilla.com/D102874
This commit is contained in:
Olli Pettay 2021-01-25 13:35:23 +00:00
parent 979ff1ff5d
commit 28d6ee58c1

View File

@ -30,7 +30,11 @@ void ChildSHistory::SetBrowsingContext(BrowsingContext* aBrowsingContext) {
void ChildSHistory::SetIsInProcess(bool aIsInProcess) {
if (!aIsInProcess) {
mHistory = nullptr;
MOZ_ASSERT_IF(mozilla::SessionHistoryInParent(), !mHistory);
if (!mozilla::SessionHistoryInParent()) {
RemovePendingHistoryNavigations();
mHistory = nullptr;
}
return;
}