зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1813391 - Have ContentParent::IsShuttingDown and check it instead of IsAlive where appropriate. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D168225
This commit is contained in:
Родитель
c3dae80550
Коммит
75a94959cb
|
@ -2046,7 +2046,7 @@ CanonicalBrowsingContext::ChangeRemoteness(
|
|||
// process, and then putting our previous document in the BFCache, try to stay
|
||||
// in the same process to avoid creating new processes unnecessarily.
|
||||
RefPtr<ContentParent> existingProcess = GetContentParent();
|
||||
if (existingProcess && existingProcess->IsAlive() &&
|
||||
if (existingProcess && !existingProcess->IsShuttingDown() &&
|
||||
aOptions.mReplaceBrowsingContext &&
|
||||
aOptions.mRemoteType == existingProcess->GetRemoteType()) {
|
||||
change->mContentParent = existingProcess;
|
||||
|
|
|
@ -1482,7 +1482,7 @@ already_AddRefed<RemoteBrowser> ContentParent::CreateBrowser(
|
|||
RefPtr<ContentParent> constructorSender;
|
||||
MOZ_RELEASE_ASSERT(XRE_IsParentProcess(),
|
||||
"Cannot allocate BrowserParent in content process");
|
||||
if (aOpenerContentParent && aOpenerContentParent->IsAlive()) {
|
||||
if (aOpenerContentParent && !aOpenerContentParent->IsShuttingDown()) {
|
||||
constructorSender = aOpenerContentParent;
|
||||
} else {
|
||||
if (aContext.IsJSPlugin()) {
|
||||
|
|
|
@ -391,6 +391,9 @@ class ContentParent final : public PContentParent,
|
|||
bool IsSignaledImpendingShutdown() const {
|
||||
return mIsSignaledImpendingShutdown;
|
||||
}
|
||||
bool IsShuttingDown() const {
|
||||
return !IsAlive() || IsSignaledImpendingShutdown();
|
||||
}
|
||||
bool IsDead() const { return mLifecycleState == LifecycleState::DEAD; }
|
||||
|
||||
bool IsForBrowser() const { return mIsForBrowser; }
|
||||
|
|
|
@ -779,7 +779,7 @@ TestShellParent* GetOrCreateTestShellParent() {
|
|||
RefPtr<ContentParent> parent =
|
||||
ContentParent::GetNewOrUsedBrowserProcess(DEFAULT_REMOTE_TYPE);
|
||||
parent.forget(&gContentParent);
|
||||
} else if (!gContentParent->IsAlive()) {
|
||||
} else if (gContentParent->IsShuttingDown()) {
|
||||
return nullptr;
|
||||
}
|
||||
TestShellParent* tsp = gContentParent->GetTestShellSingleton();
|
||||
|
|
Загрузка…
Ссылка в новой задаче