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

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

Issue 988063004: Use UUID for ServiceWorker Client identifier (2/3, chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 615954a807ea06b3a1c671c4995b59b83e33f7c6..7f2932811fd45db620e084810198ccbf0567847d 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -68,6 +68,9 @@ class CONTENT_EXPORT ServiceWorkerContextCore
typedef IDMap<ServiceWorkerProviderHost, IDMapOwnPointer> ProviderMap;
typedef IDMap<ProviderMap, IDMapOwnPointer> ProcessToProviderMap;
+ using ProviderByClientUUIDMap =
+ std::map<std::string, ServiceWorkerProviderHost*>;
+
// Directory for ServiceWorkerStorage and ServiceWorkerCacheManager.
static const base::FilePath::CharType kServiceWorkerDirectory[];
@@ -147,6 +150,15 @@ class CONTENT_EXPORT ServiceWorkerContextCore
void RemoveAllProviderHostsForProcess(int process_id);
scoped_ptr<ProviderHostIterator> GetProviderHostIterator();
+ // Maintains a map from Client UUID to ProviderHost.
+ // (Note: instead of maintaining 2 maps we could uniformly use UUID
+ // instead of process_id+provider_id elsewhere. Not a to-do, but might
+ // be nice to do.)
+ void RegisterClientIDForProviderHost(
+ const std::string& client_uuid,
+ ServiceWorkerProviderHost* provider_host);
nhiroki 2015/03/12 00:29:24 nit: indent
kinuko 2015/03/12 01:06:59 Done.
+ void UnregisterClientIDForProviderHost(const std::string& client_uuid);
+
// A child process of |source_process_id| may be used to run the created
// worker for initial installation.
// Non-null |provider_host| must be given if this is called from a document.
@@ -232,6 +244,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore
// Bind() to hold a reference to |wrapper_| until |this| is fully destroyed.
ServiceWorkerContextWrapper* wrapper_;
scoped_ptr<ProcessToProviderMap> providers_;
+ scoped_ptr<ProviderByClientUUIDMap> provider_by_uuid_;
scoped_ptr<ServiceWorkerStorage> storage_;
scoped_ptr<ServiceWorkerCacheStorageManager> cache_manager_;
scoped_refptr<EmbeddedWorkerRegistry> embedded_worker_registry_;

Powered by Google App Engine
This is Rietveld 408576698