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

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

Issue 307443003: Revert of Reparent SWProcessManager onto SWContextWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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_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 85fbcc1c050192f60a43f3b6b7c2ce738aef29b1..ec6ba977441faa9a52014cb5cf738136e260334e 100644
--- a/content/browser/service_worker/service_worker_process_manager.h
+++ b/content/browser/service_worker/service_worker_process_manager.h
@@ -18,24 +18,20 @@
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
-// ServiceWorkerContextWrapper is destroyed.
+// ServiceWorkerContextCore is destroyed on the IO thread.
class CONTENT_EXPORT ServiceWorkerProcessManager {
public:
- // |*this| must be owned by a ServiceWorkerContextWrapper in a
- // StoragePartition within |browser_context|.
- explicit ServiceWorkerProcessManager(BrowserContext* browser_context);
+ // |*this| must be owned by |context_wrapper|->context().
+ explicit ServiceWorkerProcessManager(
+ ServiceWorkerContextWrapper* context_wrapper);
- // 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
@@ -84,8 +80,10 @@
int process_id;
};
- // These fields are only accessed on the UI thread.
- BrowserContext* browser_context_;
+ // 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_;
// Maps the ID of a running EmbeddedWorkerInstance to information about the
// process it's running inside. Since the Instances themselves live on the IO

Powered by Google App Engine
This is Rietveld 408576698