| 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..46b75bd6866030d1e9edf3b4756be284e10b1adf 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,
|
| + int64 version_id);
|
| +
|
| + 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_
|
|
|