Bug 1859030 - Exit early in WorkerManagerCreatedRunnable::Run if the actor cannot send. r=dom-worker-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D191094
This commit is contained in:
Jens Stutte 2023-10-25 09:27:35 +00:00
parent 72fb7b9829
commit a28468e526

View File

@ -78,8 +78,11 @@ class WorkerManagerCreatedRunnable final : public Runnable {
Run() {
AssertIsOnBackgroundThread();
if (NS_WARN_IF(!mManagerWrapper->Manager()->MaybeCreateRemoteWorker(
mData, mWindowID, mPortIdentifier, mActor->OtherPid()))) {
if (NS_WARN_IF(
!mActor->CanSend() ||
!mManagerWrapper->Manager()->MaybeCreateRemoteWorker(
mData, mWindowID, mPortIdentifier, mActor->OtherPid()))) {
// If we cannot send, the error won't arrive, but we may log something.
mActor->ErrorPropagation(NS_ERROR_FAILURE);
return NS_OK;
}