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 3a629770dc95fedb1770929363b825237a5cb571..8d6f44250d5da1540880d293bfd9162b0fc16c15 100644 |
--- a/content/browser/service_worker/service_worker_context_core.h |
+++ b/content/browser/service_worker/service_worker_context_core.h |
@@ -6,7 +6,10 @@ |
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
#include "base/files/file_path.h" |
+#include "base/id_map.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
+#include "content/browser/service_worker/service_worker_provider_host.h" |
#include "content/common/content_export.h" |
namespace base { |
@@ -19,6 +22,8 @@ class QuotaManagerProxy; |
namespace content { |
+class ServiceWorkerProviderHost; |
+ |
// This class manages data associated with service workers. |
// The class is single threaded and should only be used on the IO thread. |
// In chromium, there is one instance per storagepartition. This class |
@@ -33,9 +38,24 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
quota::QuotaManagerProxy* quota_manager_proxy); |
~ServiceWorkerContextCore(); |
+ // The context class owns the set of ProviderHosts. |
+ ServiceWorkerProviderHost* GetProviderHost(int process_id, int provider_id); |
+ void AddProviderHost(scoped_ptr<ServiceWorkerProviderHost> provider_host); |
+ void RemoveProviderHost(int process_id, int provider_id); |
+ void RemoveAllProviderHostsForProcess(int process_id); |
+ |
+ // Checks the cmdline flag. |
bool IsEnabled(); |
private: |
+ typedef IDMap<ServiceWorkerProviderHost, IDMapOwnPointer> ProviderMap; |
+ typedef IDMap<ProviderMap, IDMapOwnPointer> ProcessToProviderMap; |
+ |
+ ProviderMap* GetProviderMapForProcess(int process_id) { |
+ return providers_.Lookup(process_id); |
+ } |
+ |
+ ProcessToProviderMap providers_; |
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
base::FilePath path_; |
}; |