mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1720568: Be more explicit about the WorkerPrivate self-reference. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D120630
This commit is contained in:
parent
fffc51a40a
commit
6c225e7975
@ -2508,6 +2508,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());
|
||||
@ -2524,8 +2529,6 @@ already_AddRefed<WorkerPrivate> WorkerPrivate::Constructor(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
worker->mSelfRef = worker;
|
||||
|
||||
return worker.forget();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user