зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1402085 P1 Maybe fire ServiceWorkerContainer.ready promise when a registration is resurrected. r=asuth
This commit is contained in:
Родитель
78a3e1848f
Коммит
c5df01040e
|
@ -336,6 +336,9 @@ public:
|
|||
void
|
||||
WorkerIsIdle(ServiceWorkerInfo* aWorker);
|
||||
|
||||
void
|
||||
CheckPendingReadyPromises();
|
||||
|
||||
private:
|
||||
ServiceWorkerManager();
|
||||
~ServiceWorkerManager();
|
||||
|
@ -446,9 +449,6 @@ private:
|
|||
StorePendingReadyPromise(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
|
||||
Promise* aPromise);
|
||||
|
||||
void
|
||||
CheckPendingReadyPromises();
|
||||
|
||||
bool
|
||||
CheckReadyPromise(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
|
||||
Promise* aPromise);
|
||||
|
|
|
@ -46,9 +46,14 @@ ServiceWorkerRegisterJob::AsyncExecute()
|
|||
// unregister so that closing the window by shutting down the browser
|
||||
// results in the registration being gone on restart.
|
||||
if (registration->mPendingUninstall) {
|
||||
registration->mPendingUninstall = false;
|
||||
swm->StoreRegistration(mPrincipal, registration);
|
||||
// Its possible that a ready promise is created between when the
|
||||
// uninstalling flag is set and when we resurrect the registration
|
||||
// here. In that case we might need to fire the ready promise
|
||||
// now.
|
||||
swm->CheckPendingReadyPromises();
|
||||
}
|
||||
registration->mPendingUninstall = false;
|
||||
RefPtr<ServiceWorkerInfo> newest = registration->Newest();
|
||||
if (newest && mScriptSpec.Equals(newest->ScriptSpec()) && sameUVC) {
|
||||
SetRegistration(registration);
|
||||
|
|
Загрузка…
Ссылка в новой задаче