mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1232444 Only store service worker registrations after install is successful. r=baku
This commit is contained in:
parent
beda3fab62
commit
fcd1d099bd
@ -1182,6 +1182,7 @@ public:
|
||||
mRegistration->mWaitingWorker = mRegistration->mInstallingWorker.forget();
|
||||
mRegistration->mWaitingWorker->UpdateState(ServiceWorkerState::Installed);
|
||||
mRegistration->NotifyListenersOnChange();
|
||||
swm->StoreRegistration(mPrincipal, mRegistration);
|
||||
swm->InvalidateServiceWorkerRegistrationWorker(mRegistration,
|
||||
WhichServiceWorker::INSTALLING_WORKER | WhichServiceWorker::WAITING_WORKER);
|
||||
|
||||
@ -1261,7 +1262,6 @@ public:
|
||||
mRegistration->mPendingUninstall = false;
|
||||
RefPtr<ServiceWorkerInfo> newest = mRegistration->Newest();
|
||||
if (newest && mScriptSpec.Equals(newest->ScriptSpec())) {
|
||||
swm->StoreRegistration(mPrincipal, mRegistration);
|
||||
Succeed();
|
||||
|
||||
// Done() must always be called async from Start()
|
||||
@ -1277,8 +1277,6 @@ public:
|
||||
} else {
|
||||
mRegistration = swm->CreateNewRegistration(mScope, mPrincipal);
|
||||
}
|
||||
|
||||
swm->StoreRegistration(mPrincipal, mRegistration);
|
||||
} else {
|
||||
MOZ_ASSERT(mJobType == UpdateJob);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user