зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1811195 - Bail out on AppShutdownConfirmed in SharedWorkerManager::MaybeCreateRemoteWorker and BackgroundParentImpl::AllocPRemoteWorkerControllerParent r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D167565
This commit is contained in:
Родитель
e68a40e22c
Коммит
c115ea4556
|
@ -45,6 +45,7 @@ already_AddRefed<RemoteWorkerController> RemoteWorkerController::Create(
|
|||
RefPtr<RemoteWorkerManager> manager = RemoteWorkerManager::GetOrCreate();
|
||||
MOZ_ASSERT(manager);
|
||||
|
||||
// XXX: We do not check for failure here, should we?
|
||||
manager->Launch(controller, aData, aProcessId);
|
||||
|
||||
return controller.forget();
|
||||
|
|
|
@ -419,6 +419,7 @@ void RemoteWorkerManager::Launch(RemoteWorkerController* aController,
|
|||
pending->mController = aController;
|
||||
pending->mData = aData;
|
||||
|
||||
// XXX: We do not check for failure here, should we?
|
||||
LaunchNewContentProcess(aData);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,12 @@ bool SharedWorkerManager::MaybeCreateRemoteWorker(
|
|||
UniqueMessagePortId& aPortIdentifier, base::ProcessId aProcessId) {
|
||||
::mozilla::ipc::AssertIsOnBackgroundThread();
|
||||
|
||||
// Creating remote workers may result in creating new processes, but during
|
||||
// parent shutdown that would add just noise, so better bail out.
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mRemoteWorkerController) {
|
||||
mRemoteWorkerController =
|
||||
RemoteWorkerController::Create(aData, this, aProcessId);
|
||||
|
|
|
@ -544,6 +544,12 @@ bool BackgroundParentImpl::DeallocPRemoteWorkerParent(
|
|||
dom::PRemoteWorkerControllerParent*
|
||||
BackgroundParentImpl::AllocPRemoteWorkerControllerParent(
|
||||
const dom::RemoteWorkerData& aRemoteWorkerData) {
|
||||
// Creating RemoteWorkerController may result in creating new processes,
|
||||
// but during parent shutdown that would add just noise, so better bail out.
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<dom::RemoteWorkerControllerParent> actor =
|
||||
new dom::RemoteWorkerControllerParent(aRemoteWorkerData);
|
||||
return actor.forget().take();
|
||||
|
|
Загрузка…
Ссылка в новой задаче