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

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

Issue 70533005: More scaffolding, add class ServiceWorkerProviderHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 9cb2cbecef8b2969c06f0e9e6302e0cd5b85cf09..b13e5e5165624a33cf5dcd6d68f2aa69041a1d16 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -26,12 +26,32 @@ ServiceWorkerContextCore::ServiceWorkerContextCore(
path_ = user_data_directory.Append(kServiceWorkerDirectory);
}
+ServiceWorkerContextCore::~ServiceWorkerContextCore() {
+}
+
+ServiceWorkerProviderHost* ServiceWorkerContextCore::GetProviderHost(
+ int process_id, int provider_id) {
+ ProcessToProvidersMap::iterator it1 = providers_map_.find(process_id);
kinuko 2013/11/18 05:57:24 const_iterator
michaeln 2013/11/18 20:18:17 Done.
+ if (it1 == providers_map_.end())
+ return NULL;
+ ServiceWorkerProviderHostMap::iterator it2 = it1->second->find(provider_id);
kinuko 2013/11/18 05:57:24 ditto
+ if (it2 == it1->second->end())
+ return NULL;
+ return it2->second;
+}
+
+void ServiceWorkerContextCore::AttachProviderHostMap(
+ int process_id, ServiceWorkerProviderHostMap* map) {
+ providers_map_[process_id] = map;
+}
+
+void ServiceWorkerContextCore::DetachProviderHostMap(int process_id) {
+ providers_map_.erase(process_id);
+}
+
bool ServiceWorkerContextCore::IsEnabled() {
return CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableServiceWorker);
}
-ServiceWorkerContextCore::~ServiceWorkerContextCore() {
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698