зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1616079 - Checking if RemoteWorkerChild::mState is Pending before dispatching IninializeWorkerRunnable r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D64049 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3da50ef6ba
Коммит
339fd6a4e3
|
@ -452,7 +452,13 @@ nsresult RemoteWorkerChild::ExecWorkerOnMainThread(RemoteWorkerData&& aData) {
|
|||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
|
||||
__func__, [initializeWorkerRunnable = std::move(runnable),
|
||||
self = std::move(self)] {
|
||||
if (NS_WARN_IF(!initializeWorkerRunnable->Dispatch())) {
|
||||
// Checking RemoteWorkerChild.mState
|
||||
bool isPending;
|
||||
{
|
||||
auto lock = self->mState.Lock();
|
||||
isPending = lock->is<Pending>();
|
||||
}
|
||||
if (NS_WARN_IF(!isPending || !initializeWorkerRunnable->Dispatch())) {
|
||||
self->TransitionStateToTerminated();
|
||||
self->CreationFailedOnAnyThread();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче