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

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..09f03575d2c9fadc4c4a2537a5fa32030b2dcffb 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -26,12 +26,33 @@ ServiceWorkerContextCore::ServiceWorkerContextCore(
path_ = user_data_directory.Append(kServiceWorkerDirectory);
}
+ServiceWorkerContextCore::~ServiceWorkerContextCore() {
+}
+
+ServiceWorkerProviderHost* ServiceWorkerContextCore::GetProviderHost(
+ int process_id, int provider_id) {
+ ProcessToProvidersMap::const_iterator it1 = providers_map_.find(process_id);
+ if (it1 == providers_map_.end())
+ return NULL;
+ ServiceWorkerProviderHostMap::const_iterator it2 =
+ it1->second->find(provider_id);
+ 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