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

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

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Add a newline Created 3 years, 11 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..fa0454035b223f8e0d45c041f9ebedbef67dcc9a 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;
@@ -69,6 +70,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore
int64_t registration_id)>;
using UnregistrationCallback =
base::Callback<void(ServiceWorkerStatusCode status)>;
+ using DispatcherHostMap = IDMap<ServiceWorkerDispatcherHost*>;
falken 2017/01/26 05:15:43 It feels misleading that the other *Map types here
shimazu 2017/01/26 09:27:22 Makes sense. Done.
using ProviderMap = IDMap<std::unique_ptr<ServiceWorkerProviderHost>>;
using ProcessToProviderMap = IDMap<std::unique_ptr<ProviderMap>>;
@@ -154,10 +156,18 @@ class CONTENT_EXPORT ServiceWorkerContextCore
return job_coordinator_.get();
}
+ // Maintains DispatcherHosts to exchange service worker related messages
+ // through them.
falken 2017/01/26 05:15:43 It's a bit inconsistent that AddDispatcherHost doe
shimazu 2017/01/26 09:27:22 Done.
+ void AddDispatcherHost(int process_id,
+ ServiceWorkerDispatcherHost* dispatcher_host);
+ 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);
+ void AddProviderHost(int process_id,
+ ServiceWorkerProviderHostInfo provider_host_info);
falken 2017/01/26 05:15:42 nit: Consider removing the function overloading by
shimazu 2017/01/26 09:27:22 Done.
+ 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 +352,7 @@ 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::unique_ptr<DispatcherHostMap> 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