Bug 1928123 - CookieStore must check if the worker is already shutting down, r=asuth

Differential Revision: https://phabricator.services.mozilla.com/D227564
This commit is contained in:
Andrea Marchesini
2024-11-01 10:34:53 +00:00
parent 767fda8356
commit 9c0112fa27

View File

@@ -129,6 +129,11 @@ void CookieStoreNotificationWatcherWrapper::ResolvePromiseWhenNotified(
workerPrivate, "CookieStoreNotificationWatcher::PromiseResolver",
[resolver = RefPtr(resolver)]() { resolver->Run(); });
if (!strongWorkerRef) {
// The worker is already shutting down. Let's ignore this promise.
return;
}
workerRef = new ThreadSafeWorkerRef(strongWorkerRef);
}