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

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

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
« 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 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_;
};
« 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