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

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

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
Index: content/browser/service_worker/service_worker_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 4ae67d4155b62f38144cfd2d4f9c069726f5f58e..a893135cbc89b6c2d7b462ffc83e44f665e6547c 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -116,6 +116,7 @@ ServiceWorkerContextCore::ServiceWorkerContextCore(
ServiceWorkerContextWrapper* wrapper)
: wrapper_(wrapper),
providers_(new ProcessToProviderMap),
+ provider_by_uuid_(new ProviderByClientUUIDMap),
cache_manager_(ServiceWorkerCacheStorageManager::Create(
path,
cache_task_runner.get(),
@@ -141,7 +142,9 @@ ServiceWorkerContextCore::ServiceWorkerContextCore(
ServiceWorkerContextWrapper* wrapper)
: wrapper_(wrapper),
providers_(old_context->providers_.release()),
- cache_manager_(old_context->cache_manager_.release()),
+ provider_by_uuid_(old_context->provider_by_uuid_.release()),
+ cache_manager_(ServiceWorkerCacheStorageManager::Create(
+ old_context->cache_manager())),
next_handle_id_(old_context->next_handle_id_),
next_registration_handle_id_(old_context->next_registration_handle_id_),
observer_list_(old_context->observer_list_),
@@ -201,6 +204,19 @@ ServiceWorkerContextCore::GetProviderHostIterator() {
return make_scoped_ptr(new ProviderHostIterator(providers_.get()));
}
+void ServiceWorkerContextCore::RegisterClientIDForProviderHost(
+ const std::string& client_uuid,
+ ServiceWorkerProviderHost* provider_host) {
+ DCHECK(!ContainsKey(*provider_by_uuid_, client_uuid));
+ (*provider_by_uuid_)[client_uuid] = provider_host;
+}
+
+void ServiceWorkerContextCore::UnregisterClientIDForProviderHost(
+ const std::string& client_uuid) {
+ DCHECK(ContainsKey(*provider_by_uuid_, client_uuid));
+ provider_by_uuid_->erase(client_uuid);
+}
+
void ServiceWorkerContextCore::RegisterServiceWorker(
const GURL& pattern,
const GURL& script_url,

Powered by Google App Engine
This is Rietveld 408576698