зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1731298: Explicitly check if the worker is running in Exec. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D140302
This commit is contained in:
Родитель
015a3aeb12
Коммит
db8e331c53
|
@ -936,13 +936,17 @@ class RemoteWorkerChild::SharedWorkerOp : public RemoteWorkerChild::Op {
|
|||
|
||||
auto lock = aOwner->mState.Lock();
|
||||
|
||||
MOZ_ASSERT(lock->is<Running>() || IsTerminationOp());
|
||||
|
||||
if (IsTerminationOp()) {
|
||||
aOwner->CloseWorkerOnMainThread(lock.ref());
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(lock->is<Running>());
|
||||
if (!lock->is<Running>()) {
|
||||
aOwner->ErrorPropagationDispatch(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<WorkerPrivate> workerPrivate = lock->as<Running>().mWorkerPrivate;
|
||||
|
||||
MOZ_ASSERT(workerPrivate);
|
||||
|
|
Загрузка…
Ссылка в новой задаче