Chromium Code Reviews| Index: content/browser/service_worker/service_worker_provider_host.h |
| diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h |
| index 31f4a372b1bd7633651c8f160266267bbb26d3dd..cb5d74a0c8dd179b4dea9384ff78496d74fad038 100644 |
| --- a/content/browser/service_worker/service_worker_provider_host.h |
| +++ b/content/browser/service_worker/service_worker_provider_host.h |
| @@ -53,17 +53,19 @@ class CONTENT_EXPORT ServiceWorkerProviderHost |
| return running_hosted_version_ != NULL; |
| } |
| - // The service worker version that corresponds with |
| - // navigator.serviceWorker.active for our document. |
| + // Getters for the navigator.serviceWorker attribute values. |
|
nhiroki
2014/07/02 07:25:12
nit: there is an extra space just after "//".
michaeln
2014/07/02 23:17:14
Done.
|
| + ServiceWorkerVersion* controlling_version() const { |
| + return controlling_version_.get(); |
| + } |
| ServiceWorkerVersion* active_version() const { |
| return active_version_.get(); |
| } |
| - |
| - // The service worker version that corresponds with |
| - // navigate.serviceWorker.waiting for our document. |
| ServiceWorkerVersion* waiting_version() const { |
| return waiting_version_.get(); |
| } |
| + ServiceWorkerVersion* installing_version() const { |
| + return installing_version_.get(); |
| + } |
| // The running version, if any, that this provider is providing resource |
| // loads for. |
| @@ -74,11 +76,15 @@ class CONTENT_EXPORT ServiceWorkerProviderHost |
| void SetDocumentUrl(const GURL& url); |
| const GURL& document_url() const { return document_url_; } |
| - // Associates |version| to this provider as its '.active' or '.waiting' |
| - // version. |
| - // Giving NULL to this method will unset the corresponding field. |
| + // Associates |version| to the corresponding field or if |version| is NULL |
| + // clears the field. |
| void SetActiveVersion(ServiceWorkerVersion* version); |
| void SetWaitingVersion(ServiceWorkerVersion* version); |
| + void SetInstallingVersion(ServiceWorkerVersion* version); |
| + |
| + // If version is the installing, waiting, active version of this |
| + // provide, the method will reset that field to NULL. |
|
falken
2014/07/02 05:42:11
"|version|"
"waiting, or active"
"provider"
michaeln
2014/07/02 23:17:14
Done.
|
| + void UnsetVersion(ServiceWorkerVersion* version); |
| // Returns false if the version is not in the expected STARTING in our |
| // process state. That would be indicative of a bad IPC message. |
| @@ -90,9 +96,8 @@ class CONTENT_EXPORT ServiceWorkerProviderHost |
| ResourceType::Type resource_type, |
| base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context); |
| - // Returns true if |version| has the same registration as active and waiting |
| - // versions. |
| - bool ValidateVersionForAssociation(ServiceWorkerVersion* version); |
| + // Returns true if |version| can be associated with this provider. |
| + bool CanAssociateVersion(ServiceWorkerVersion* version); |
| // Returns true if the context referred to by this host (i.e. |context_|) is |
| // still alive. |
| @@ -111,8 +116,10 @@ class CONTENT_EXPORT ServiceWorkerProviderHost |
| const int process_id_; |
| const int provider_id_; |
| GURL document_url_; |
| + scoped_refptr<ServiceWorkerVersion> controlling_version_; |
| scoped_refptr<ServiceWorkerVersion> active_version_; |
| scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| + scoped_refptr<ServiceWorkerVersion> installing_version_; |
| scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
| base::WeakPtr<ServiceWorkerContextCore> context_; |
| ServiceWorkerDispatcherHost* dispatcher_host_; |