| Index: content/browser/service_worker/service_worker_registration.h
|
| diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h
|
| index 654b8016a90e2d2ed8d160b02ed566e559a82b1e..51872d21447396ddf03a71fa57ff9c3882ff4ecc 100644
|
| --- a/content/browser/service_worker/service_worker_registration.h
|
| +++ b/content/browser/service_worker/service_worker_registration.h
|
| @@ -20,9 +20,11 @@
|
| class ServiceWorkerRegistrationInfo;
|
| class ServiceWorkerVersion;
|
|
|
| -// This class represents a Service Worker registration. The scope is constant
|
| -// for the life of the persistent registration. It's refcounted to facilitate
|
| -// multiple controllees being associated with the same registration.
|
| +// This class represents a service worker registration. The
|
| +// scope and script url are constant for the life of the persistent
|
| +// registration. It's refcounted to facillitate multiple controllees
|
| +// being associated with the same registration. The class roughly
|
| +// corresponds to navigator.serviceWorker.registgration.
|
| class CONTENT_EXPORT ServiceWorkerRegistration
|
| : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>),
|
| public ServiceWorkerVersion::Listener {
|
| @@ -34,11 +36,9 @@
|
| virtual void OnVersionAttributesChanged(
|
| ServiceWorkerRegistration* registration,
|
| ChangedVersionAttributesMask changed_mask,
|
| - const ServiceWorkerRegistrationInfo& info) {}
|
| + const ServiceWorkerRegistrationInfo& info) = 0;
|
| virtual void OnRegistrationFailed(
|
| - ServiceWorkerRegistration* registration) {}
|
| - virtual void OnRegistrationFinishedUninstalling(
|
| - ServiceWorkerRegistration* registration) {}
|
| + ServiceWorkerRegistration* registration) = 0;
|
| };
|
|
|
| ServiceWorkerRegistration(const GURL& pattern,
|
| @@ -46,15 +46,9 @@
|
| int64 registration_id,
|
| base::WeakPtr<ServiceWorkerContextCore> context);
|
|
|
| + int64 id() const { return registration_id_; }
|
| + const GURL& script_url() const { return script_url_; }
|
| const GURL& pattern() const { return pattern_; }
|
| -
|
| - // Corresponds to the spec's [[ScriptURL]]: the URL passed to the
|
| - // serviceWorker.navigator.register() call that created or last updated this
|
| - // registration.
|
| - const GURL& script_url() const { return script_url_; }
|
| - void set_script_url(const GURL& url) { script_url_ = url; }
|
| -
|
| - int64 id() const { return registration_id_; }
|
|
|
| bool is_deleted() const { return is_deleted_; }
|
| void set_is_deleted(bool deleted) { is_deleted_ = deleted; }
|
| @@ -102,8 +96,9 @@
|
| void ClearWhenReady();
|
|
|
| // Restores this registration in storage and cancels the pending
|
| - // [[ClearRegistration]] algorithm.
|
| - void AbortPendingClear(const StatusCallback& callback);
|
| + // [[ClearRegistration]] algorithm. If the algorithm was already triggered,
|
| + // does nothing.
|
| + void AbortPendingClear();
|
|
|
| // The time of the most recent update check.
|
| base::Time last_update_check() const { return last_update_check_; }
|
| @@ -134,13 +129,11 @@
|
|
|
| // This method corresponds to the [[ClearRegistration]] algorithm.
|
| void Clear();
|
| -
|
| - void OnRestoreFinished(const StatusCallback& callback,
|
| - scoped_refptr<ServiceWorkerVersion> version,
|
| - ServiceWorkerStatusCode status);
|
| + void OnStoreFinished(scoped_refptr<ServiceWorkerVersion> version,
|
| + ServiceWorkerStatusCode status);
|
|
|
| const GURL pattern_;
|
| - GURL script_url_;
|
| + const GURL script_url_;
|
| const int64 registration_id_;
|
| bool is_deleted_;
|
| bool is_uninstalling_;
|
|
|