| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // loads for. | 71 // loads for. |
| 72 ServiceWorkerVersion* running_hosted_version() const { | 72 ServiceWorkerVersion* running_hosted_version() const { |
| 73 return running_hosted_version_.get(); | 73 return running_hosted_version_.get(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SetDocumentUrl(const GURL& url); | 76 void SetDocumentUrl(const GURL& url); |
| 77 const GURL& document_url() const { return document_url_; } | 77 const GURL& document_url() const { return document_url_; } |
| 78 | 78 |
| 79 // Associates |version| to the corresponding field or if |version| is NULL | 79 // Associates |version| to the corresponding field or if |version| is NULL |
| 80 // clears the field. | 80 // clears the field. |
| 81 void SetControllerVersion(ServiceWorkerVersion* version); |
| 81 void SetActiveVersion(ServiceWorkerVersion* version); | 82 void SetActiveVersion(ServiceWorkerVersion* version); |
| 82 void SetWaitingVersion(ServiceWorkerVersion* version); | 83 void SetWaitingVersion(ServiceWorkerVersion* version); |
| 83 void SetInstallingVersion(ServiceWorkerVersion* version); | 84 void SetInstallingVersion(ServiceWorkerVersion* version); |
| 84 | 85 |
| 85 // If |version| is the installing, waiting, or active version of this | 86 // If |version| is the installing, waiting, or active version of this |
| 86 // provider, the method will reset that field to NULL. | 87 // provider, the method will reset that field to NULL. |
| 87 void UnsetVersion(ServiceWorkerVersion* version); | 88 void UnsetVersion(ServiceWorkerVersion* version); |
| 88 | 89 |
| 89 // Returns false if the version is not in the expected STARTING in our | 90 // Returns false if the version is not in the expected STARTING in our |
| 90 // process state. That would be indicative of a bad IPC message. | 91 // process state. That would be indicative of a bad IPC message. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 110 private: | 111 private: |
| 111 // Creates a ServiceWorkerHandle to retain |version| and returns a | 112 // Creates a ServiceWorkerHandle to retain |version| and returns a |
| 112 // ServiceWorkerInfo with the handle ID to pass to the provider. The | 113 // ServiceWorkerInfo with the handle ID to pass to the provider. The |
| 113 // provider is responsible for releasing the handle. | 114 // provider is responsible for releasing the handle. |
| 114 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); | 115 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); |
| 115 | 116 |
| 116 const int process_id_; | 117 const int process_id_; |
| 117 const int provider_id_; | 118 const int provider_id_; |
| 118 GURL document_url_; | 119 GURL document_url_; |
| 119 | 120 |
| 120 // TODO(michaeln): controlling_version_ is not used yet. | |
| 121 scoped_refptr<ServiceWorkerVersion> controlling_version_; | 121 scoped_refptr<ServiceWorkerVersion> controlling_version_; |
| 122 scoped_refptr<ServiceWorkerVersion> active_version_; | 122 scoped_refptr<ServiceWorkerVersion> active_version_; |
| 123 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 123 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| 124 scoped_refptr<ServiceWorkerVersion> installing_version_; | 124 scoped_refptr<ServiceWorkerVersion> installing_version_; |
| 125 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 125 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
| 126 base::WeakPtr<ServiceWorkerContextCore> context_; | 126 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 127 ServiceWorkerDispatcherHost* dispatcher_host_; | 127 ServiceWorkerDispatcherHost* dispatcher_host_; |
| 128 | 128 |
| 129 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 129 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| 133 | 133 |
| 134 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 134 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |