Bug 1744025: Restore original naming of local WP variable in AutoSyncLoopHolder::Run r=dom-worker-reviewers,smaug

In an intermediate version of D132710 we wanted to use RefPtr and in AutoSyncLoopHolder::Run the local WP
variable would have kept alive the WorkerPrivate during the sync loop. But downgrading for now to CheckedUnsafePtr
does not give us any lifecycle guarantees here anymore, so the naming was inappropriate.

Differential Revision: https://phabricator.services.mozilla.com/D137104
This commit is contained in:
Jens Stutte 2022-01-27 13:55:11 +00:00
parent 6812f3c9e4
commit 27dca788f6

View File

@ -1469,12 +1469,12 @@ class AutoSyncLoopHolder {
}
bool Run() {
CheckedUnsafePtr<WorkerPrivate> keepAliveWP = mWorkerPrivate;
CheckedUnsafePtr<WorkerPrivate> workerPrivate = mWorkerPrivate;
mWorkerPrivate = nullptr;
keepAliveWP->AssertIsOnWorkerThread();
workerPrivate->AssertIsOnWorkerThread();
return keepAliveWP->RunCurrentSyncLoop();
return workerPrivate->RunCurrentSyncLoop();
}
nsIEventTarget* GetEventTarget() const {