зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1290116 P3 Delay removing registration until active worker is idle. r=asuth
This commit is contained in:
Родитель
1340a14939
Коммит
846726fe4d
|
@ -1304,9 +1304,16 @@ ServiceWorkerManager::WorkerIsIdle(ServiceWorkerInfo* aWorker)
|
|||
return;
|
||||
}
|
||||
|
||||
if (reg->GetActive() == aWorker) {
|
||||
reg->TryToActivateAsync();
|
||||
if (reg->GetActive() != aWorker) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!reg->IsControllingDocuments() && reg->mPendingUninstall) {
|
||||
RemoveRegistration(reg);
|
||||
return;
|
||||
}
|
||||
|
||||
reg->TryToActivateAsync();
|
||||
}
|
||||
|
||||
already_AddRefed<ServiceWorkerJobQueue>
|
||||
|
@ -2001,7 +2008,7 @@ void
|
|||
ServiceWorkerManager::StopControllingADocument(ServiceWorkerRegistrationInfo* aRegistration)
|
||||
{
|
||||
aRegistration->StopControllingADocument();
|
||||
if (aRegistration->IsControllingDocuments()) {
|
||||
if (aRegistration->IsControllingDocuments() || !aRegistration->IsIdle()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ ServiceWorkerUnregisterJob::Unregister()
|
|||
InvokeResultCallbacks(NS_OK);
|
||||
|
||||
// "If no service worker client is using registration..."
|
||||
if (!registration->IsControllingDocuments()) {
|
||||
if (!registration->IsControllingDocuments() && registration->IsIdle()) {
|
||||
// "Invoke [[Clear Registration]]..."
|
||||
swm->RemoveRegistration(registration);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче