Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1751)

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 85023003: EmbeddedWorker, browser side code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698