Skip to content

Commit

Permalink
Bug 1816025 - Downgrade diagnostic assertion in BrowsingContextGroup:…
Browse files Browse the repository at this point in the history
…:EnsureHostProcess. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D171457
  • Loading branch information
jensstutte committed Mar 2, 2023
1 parent 98713cb commit d1cce6e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docshell/base/BrowsingContextGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,23 @@ void BrowsingContextGroup::EnsureHostProcess(ContentParent* aProcess) {
MOZ_DIAGNOSTIC_ASSERT(!aProcess->GetRemoteType().IsEmpty(),
"host process must have remote type");

// XXX: The diagnostic crashes in bug 1816025 seemed to come through caller
// ContentParent::GetNewOrUsedLaunchingBrowserProcess where we already
// did AssertAlive, so IsDead should be irrelevant here. Still it reads
// wrong that we ever might do AddBrowsingContextGroup if aProcess->IsDead().
if (aProcess->IsDead() ||
mHosts.WithEntryHandle(aProcess->GetRemoteType(), [&](auto&& entry) {
if (entry) {
MOZ_DIAGNOSTIC_ASSERT(
// We know from bug 1816025 that this happens quite often and we have
// bug 1815480 on file that should harden the entire flow. But in the
// meantime we can just live with NOT replacing the found host
// process with a new one here if it is still alive.
MOZ_ASSERT(
entry.Data() == aProcess,
"There's already another host process for this remote type");
return false;
if (!entry.Data()->IsShuttingDown()) {
return false;
}
}

// This process wasn't already marked as our host, so insert it, and
Expand Down

0 comments on commit d1cce6e

Please sign in to comment.