Chromium Code Reviews| Index: content/browser/service_worker/service_worker_version.h |
| diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h |
| index 93f4459b38caa174e58612684b9762c5265ce9cd..d8279ecb263ba54b6b5ea16984ec35c15b86a49b 100644 |
| --- a/content/browser/service_worker/service_worker_version.h |
| +++ b/content/browser/service_worker/service_worker_version.h |
| @@ -8,12 +8,16 @@ |
| #include "base/basictypes.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "content/common/content_export.h" |
| class GURL; |
| namespace content { |
| +class EmbeddedWorkerInstance; |
| +class EmbeddedWorkerRegistry; |
| +class ServiceWorkerProviderHost; |
| class ServiceWorkerRegistration; |
| // This class corresponds to a specific version of a ServiceWorker |
| @@ -51,19 +55,40 @@ class ServiceWorkerRegistration; |
| class CONTENT_EXPORT ServiceWorkerVersion |
| : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerVersion>) { |
| public: |
| - explicit ServiceWorkerVersion(ServiceWorkerRegistration* registration); |
| + ServiceWorkerVersion( |
| + ServiceWorkerRegistration* registration, |
| + EmbeddedWorkerRegistry* worker_registry, |
| + int version_id); |
|
alecflett
2013/12/05 05:18:42
int64?
kinuko
2013/12/09 14:07:42
Good catch, done.
|
| + |
| + int64 version_id() const { return version_id_; } |
| void Shutdown(); |
| bool is_shutdown() const { return is_shutdown_; } |
| + // Starts and stops an embedded worker for this version. |
| + void StartWorker(); |
| + void StopWorker(); |
| + |
| + // Called when this version is associated to a provider host. |
| + // Non-null |provider_host| must be given. |
| + void OnAssociateProvider(ServiceWorkerProviderHost* provider_host); |
| + void OnUnassociateProvider(ServiceWorkerProviderHost* provider_host); |
| + |
| private: |
| - ~ServiceWorkerVersion(); |
| friend class base::RefCounted<ServiceWorkerVersion>; |
| + ~ServiceWorkerVersion(); |
| + |
| + const int64 version_id_; |
| + |
| bool is_shutdown_; |
| scoped_refptr<ServiceWorkerRegistration> registration_; |
| + scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
| }; |
| + |
| } // namespace content |
| + |
| #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |