mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1720568: Be more explicit about the WorkerPrivate self-reference. r=dom-worker-reviewers,asuth a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D120630
This commit is contained in:
parent
a2ab5f7884
commit
5fec9b6832
@ -2495,6 +2495,11 @@ already_AddRefed<WorkerPrivate> WorkerPrivate::Constructor(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// From this point on (worker thread has been started) we
|
||||
// must keep ourself alive. We can now only be cleared by
|
||||
// ClearSelfAndParentEventTargetRef().
|
||||
worker->mSelfRef = worker;
|
||||
|
||||
worker->EnableDebugger();
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(worker->PrincipalIsValid());
|
||||
@ -2511,8 +2516,6 @@ already_AddRefed<WorkerPrivate> WorkerPrivate::Constructor(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
worker->mSelfRef = worker;
|
||||
|
||||
return worker.forget();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user