Index: content/browser/service_worker/service_worker_registration.cc |
diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/service_worker/service_worker_registration.cc |
index ec8b257575552cde2e3d4582ba698fb1316eed3e..ce5686381e8009f90565288ad05e72d0f52d0433 100644 |
--- a/content/browser/service_worker/service_worker_registration.cc |
+++ b/content/browser/service_worker/service_worker_registration.cc |
@@ -157,17 +157,15 @@ |
id(), |
script_url().GetOrigin(), |
base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
+ |
if (!active_version() || !active_version()->HasControllee()) |
Clear(); |
} |
-void ServiceWorkerRegistration::AbortPendingClear( |
- const StatusCallback& callback) { |
+void ServiceWorkerRegistration::AbortPendingClear() { |
DCHECK(context_); |
- if (!is_uninstalling()) { |
- callback.Run(SERVICE_WORKER_OK); |
- return; |
- } |
+ if (!is_uninstalling()) |
+ return; |
is_uninstalling_ = false; |
context_->storage()->NotifyDoneUninstallingRegistration(this); |
@@ -178,9 +176,8 @@ |
context_->storage()->StoreRegistration( |
this, |
most_recent_version, |
- base::Bind(&ServiceWorkerRegistration::OnRestoreFinished, |
+ base::Bind(&ServiceWorkerRegistration::OnStoreFinished, |
this, |
- callback, |
most_recent_version)); |
} |
@@ -276,9 +273,7 @@ |
} |
void ServiceWorkerRegistration::Clear() { |
- is_uninstalling_ = false; |
- if (context_) |
- context_->storage()->NotifyDoneUninstallingRegistration(this); |
+ context_->storage()->NotifyDoneUninstallingRegistration(this); |
ChangedVersionAttributesMask mask; |
if (installing_version_) { |
@@ -302,22 +297,15 @@ |
FOR_EACH_OBSERVER(Listener, listeners_, |
OnVersionAttributesChanged(this, mask, info)); |
} |
- |
- FOR_EACH_OBSERVER( |
- Listener, listeners_, OnRegistrationFinishedUninstalling(this)); |
-} |
- |
-void ServiceWorkerRegistration::OnRestoreFinished( |
- const StatusCallback& callback, |
+} |
+ |
+void ServiceWorkerRegistration::OnStoreFinished( |
scoped_refptr<ServiceWorkerVersion> version, |
ServiceWorkerStatusCode status) { |
- if (!context_) { |
- callback.Run(ServiceWorkerStatusCode::SERVICE_WORKER_ERROR_ABORT); |
- return; |
- } |
+ if (!context_) |
+ return; |
context_->storage()->NotifyDoneInstallingRegistration( |
this, version.get(), status); |
- callback.Run(status); |
} |
} // namespace content |