Index: content/browser/service_worker/service_worker_process_manager.h |
diff --git a/content/browser/service_worker/service_worker_process_manager.h b/content/browser/service_worker/service_worker_process_manager.h |
index ec6ba977441faa9a52014cb5cf738136e260334e..85fbcc1c050192f60a43f3b6b7c2ce738aef29b1 100644 |
--- a/content/browser/service_worker/service_worker_process_manager.h |
+++ b/content/browser/service_worker/service_worker_process_manager.h |
@@ -18,21 +18,25 @@ class GURL; |
namespace content { |
class BrowserContext; |
-class ServiceWorkerContextWrapper; |
class SiteInstance; |
// Interacts with the UI thread to keep RenderProcessHosts alive while the |
-// ServiceWorker system is using them. Each instance of |
+// ServiceWorker system is using them. Each instance of |
// ServiceWorkerProcessManager is destroyed on the UI thread shortly after its |
-// ServiceWorkerContextCore is destroyed on the IO thread. |
+// ServiceWorkerContextWrapper is destroyed. |
class CONTENT_EXPORT ServiceWorkerProcessManager { |
public: |
- // |*this| must be owned by |context_wrapper|->context(). |
- explicit ServiceWorkerProcessManager( |
- ServiceWorkerContextWrapper* context_wrapper); |
+ // |*this| must be owned by a ServiceWorkerContextWrapper in a |
+ // StoragePartition within |browser_context|. |
+ explicit ServiceWorkerProcessManager(BrowserContext* browser_context); |
+ // Shutdown must be called before the ProcessManager is destroyed. |
~ServiceWorkerProcessManager(); |
+ // Synchronously prevents new processes from being allocated. |
+ // TODO(jyasskin): Drop references to RenderProcessHosts too. |
+ void Shutdown(); |
+ |
// Returns a reference to a running process suitable for starting the Service |
// Worker at |script_url|. Processes in |process_ids| will be checked in order |
// for existence, and if none exist, then a new process will be created. Posts |
@@ -80,10 +84,8 @@ class CONTENT_EXPORT ServiceWorkerProcessManager { |
int process_id; |
}; |
- // These fields are only accessed on the UI thread after construction. |
- // The reference cycle through context_wrapper_ is broken in |
- // ServiceWorkerContextWrapper::Shutdown(). |
- scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; |
+ // These fields are only accessed on the UI thread. |
+ BrowserContext* browser_context_; |
// Maps the ID of a running EmbeddedWorkerInstance to information about the |
// process it's running inside. Since the Instances themselves live on the IO |