Issue #1442 - Part 12b - Allow idle worker shutdown while Cache/CacheStorage DOM objects exist, but block it during Cache operation. https://bugzilla.mozilla.org/show_bug.cgi?id=1362444 Pre-requisite for Part 13.

This commit is contained in:
Brian Smith 2023-09-28 17:35:26 -05:00 • committed by roytam1
commit 0b450a3def
4 changed files with 45 additions and 9 deletions

View file

@ -74,7 +74,11 @@ CacheOpChild::CacheOpChild(CacheWorkerHolder* aWorkerHolder,
MOZ_DIAGNOSTIC_ASSERT(mPromise);
MOZ_ASSERT_IF(!NS_IsMainThread(), aWorkerHolder);
SetWorkerHolder(aWorkerHolder);
RefPtr<CacheWorkerHolder> workerHolder =
CacheWorkerHolder::PreferBehavior(aWorkerHolder,
CacheWorkerHolder::PreventIdleShutdownStart);
SetWorkerHolder(workerHolder);
}
CacheOpChild::~CacheOpChild()
@ -165,7 +169,11 @@ CacheOpChild::Recv__delete__(const ErrorResult& aRv,
break;
}
actor->SetWorkerHolder(GetWorkerHolder());
RefPtr<CacheWorkerHolder> workerHolder =
CacheWorkerHolder::PreferBehavior(GetWorkerHolder(),
CacheWorkerHolder::AllowIdleShutdownStart);
actor->SetWorkerHolder(workerHolder);
RefPtr<Cache> cache = new Cache(mGlobal, actor);
mPromise->MaybeResolve(cache);
break;