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

Unified Diff: content/browser/service_worker/service_worker_context_core.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_context_core.h
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h
index 595fcd94dc7e414e74828ff95a501d89dac16dbe..c06615e7477e8fde2c29bd885dac8a6d9d4d4525 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -37,7 +37,6 @@
class EmbeddedWorkerRegistry;
class ServiceWorkerContextObserver;
-class ServiceWorkerContextWrapper;
class ServiceWorkerHandle;
class ServiceWorkerJobCoordinator;
class ServiceWorkerProviderHost;
@@ -92,7 +91,7 @@
base::MessageLoopProxy* disk_cache_thread,
quota::QuotaManagerProxy* quota_manager_proxy,
ObserverListThreadSafe<ServiceWorkerContextObserver>* observer_list,
- ServiceWorkerContextWrapper* wrapper);
+ scoped_ptr<ServiceWorkerProcessManager> process_manager);
virtual ~ServiceWorkerContextCore();
// ServiceWorkerVersion::Listener overrides.
@@ -112,7 +111,9 @@
const GURL& source_url) OVERRIDE;
ServiceWorkerStorage* storage() { return storage_.get(); }
- ServiceWorkerProcessManager* process_manager();
+ ServiceWorkerProcessManager* process_manager() {
+ return process_manager_.get();
+ }
EmbeddedWorkerRegistry* embedded_worker_registry() {
return embedded_worker_registry_.get();
}
@@ -158,6 +159,12 @@
return weak_factory_.GetWeakPtr();
}
+ // Allows tests to change how processes are created.
+ void SetProcessManagerForTest(
+ scoped_ptr<ServiceWorkerProcessManager> new_process_manager) {
+ process_manager_ = new_process_manager.Pass();
+ }
+
private:
typedef std::map<int64, ServiceWorkerRegistration*> RegistrationsMap;
typedef std::map<int64, ServiceWorkerVersion*> VersionMap;
@@ -177,14 +184,11 @@
ServiceWorkerStatusCode status);
base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_;
- // It's safe to store a raw pointer instead of a scoped_refptr to |wrapper_|
- // because the Wrapper::Shutdown call that hops threads to destroy |this| uses
- // Bind() to hold a reference to |wrapper_| until |this| is fully destroyed.
- ServiceWorkerContextWrapper* wrapper_;
ProcessToProviderMap providers_;
scoped_ptr<ServiceWorkerStorage> storage_;
scoped_refptr<EmbeddedWorkerRegistry> embedded_worker_registry_;
scoped_ptr<ServiceWorkerJobCoordinator> job_coordinator_;
+ scoped_ptr<ServiceWorkerProcessManager> process_manager_;
std::map<int64, ServiceWorkerRegistration*> live_registrations_;
std::map<int64, ServiceWorkerVersion*> live_versions_;
int next_handle_id_;

Powered by Google App Engine
This is Rietveld 408576698