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

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: addressed comments 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3f88e9de53c0d2743e44565aa8b9536c5dd568cd 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 might be able to uniformly use
+ // UUID instead of process_id+provider_id elsewhere. For now I'm leaving
+ // these as provider_id is deeply wired everywhere)
+ void RegisterClientIDForProviderHost(
+ const std::string& client_uuid,
+ ServiceWorkerProviderHost* provider_host);
+ 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_;
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698