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

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

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Rebase Created 3 years, 10 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 4832b8c4eb4c2680d855385a1b8c8bd542f44b71..bb1fc8993cc8fca8c8472648306c06ccd72031bb 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -44,6 +44,7 @@ class EmbeddedWorkerRegistry;
class ServiceWorkerContextObserver;
class ServiceWorkerContextWrapper;
class ServiceWorkerDatabaseTaskManager;
+class ServiceWorkerDispatcherHost;
class ServiceWorkerJobCoordinator;
class ServiceWorkerNavigationHandleCore;
class ServiceWorkerProviderHost;
@@ -154,10 +155,17 @@ class CONTENT_EXPORT ServiceWorkerContextCore
return job_coordinator_.get();
}
+ // Maintains DispatcherHosts to exchange service worker related messages
+ // through them. The DispatcherHosts are not owned by this class.
+ void AddDispatcherHost(int process_id,
+ ServiceWorkerDispatcherHost* dispatcher_host);
+ ServiceWorkerDispatcherHost* GetDispatcherHost(int process_id);
+ void RemoveDispatcherHost(int process_id);
+
// The context class owns the set of ProviderHosts.
- ServiceWorkerProviderHost* GetProviderHost(int process_id, int provider_id);
void AddProviderHost(
std::unique_ptr<ServiceWorkerProviderHost> provider_host);
+ ServiceWorkerProviderHost* GetProviderHost(int process_id, int provider_id);
void RemoveProviderHost(int process_id, int provider_id);
void RemoveAllProviderHostsForProcess(int process_id);
std::unique_ptr<ProviderHostIterator> GetProviderHostIterator();
@@ -342,6 +350,8 @@ class CONTENT_EXPORT ServiceWorkerContextCore
// 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_;
+ std::map<int /* process_id */, ServiceWorkerDispatcherHost*>
+ dispatcher_hosts_;
std::unique_ptr<ProcessToProviderMap> providers_;
std::unique_ptr<ProviderByClientUUIDMap> provider_by_uuid_;
std::unique_ptr<ServiceWorkerStorage> storage_;

Powered by Google App Engine
This is Rietveld 408576698