Bug 1555488 - Part 1: Clear WindowProxy cache when flipping processes, r=peterv,mccr8

This is sorta-part of the work for bug 1510760. Currently if you do a process
switch, the window proxy state is completely borked, and a lot of stuff doesn't
work.

This patch aims to make it so that, while not transplanted correctly, methods
generally don't return the wrong WindowProxy object anymore after a process
swap.

Differential Revision: https://phabricator.services.mozilla.com/D33082
This commit is contained in:
Nika Layzell
2019-06-06 14:57:18 +00:00
parent 4f7bc10db5
commit d5729dfedc
3 changed files with 28 additions and 3 deletions

View File

@@ -5072,9 +5072,11 @@ nsDocShell::Destroy() {
mSessionHistory = nullptr;
}
// This will be skipped in cases where we want to preserve the browsing
// context between loads.
if (!mSkipBrowsingContextDetachOnDestroy) {
// Either `Detach` our BrowsingContext if this window is closing, or prepare
// the BrowsingContext for the switch to continue.
if (mSkipBrowsingContextDetachOnDestroy) {
mBrowsingContext->PrepareForProcessChange();
} else {
mBrowsingContext->Detach();
}