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

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

Issue 325173002: ServiceWorker: Confirm the liveness of the associated context before handling message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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.h
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h
index b3f97ae28f39b843e3568334985563028360ac85..6603242647d0d93f74c6b4d5d9f70234e5d7fe6d 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -41,6 +41,7 @@ class ServiceWorkerContextWrapper;
class ServiceWorkerHandle;
class ServiceWorkerJobCoordinator;
class ServiceWorkerProviderHost;
+class ServiceWorkerProviderHostRegistry;
class ServiceWorkerRegistration;
class ServiceWorkerStorage;
@@ -57,28 +58,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
int64 version_id)> RegistrationCallback;
typedef base::Callback<
void(ServiceWorkerStatusCode status)> UnregistrationCallback;
- typedef IDMap<ServiceWorkerProviderHost, IDMapOwnPointer> ProviderMap;
- typedef IDMap<ProviderMap, IDMapOwnPointer> ProcessToProviderMap;
-
- // Iterates over ServiceWorkerProviderHost objects in a ProcessToProviderMap.
- class ProviderHostIterator {
- public:
- ~ProviderHostIterator();
- ServiceWorkerProviderHost* GetProviderHost();
- void Advance();
- bool IsAtEnd();
-
- private:
- friend class ServiceWorkerContextCore;
- explicit ProviderHostIterator(ProcessToProviderMap* map);
- void Initialize();
-
- ProcessToProviderMap* map_;
- scoped_ptr<ProcessToProviderMap::iterator> provider_iterator_;
- scoped_ptr<ProviderMap::iterator> provider_host_iterator_;
-
- DISALLOW_COPY_AND_ASSIGN(ProviderHostIterator);
- };
// This is owned by the StoragePartition, which will supply it with
// the local path on disk. Given an empty |user_data_directory|,
@@ -113,6 +92,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore
ServiceWorkerStorage* storage() { return storage_.get(); }
ServiceWorkerProcessManager* process_manager();
+ ServiceWorkerProviderHostRegistry* provider_registry();
EmbeddedWorkerRegistry* embedded_worker_registry() {
return embedded_worker_registry_.get();
}
@@ -120,13 +100,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
return job_coordinator_.get();
}
- // 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);
- scoped_ptr<ProviderHostIterator> GetProviderHostIterator();
-
// The callback will be called on the IO thread.
// A child process of |source_process_id| may be used to run the created
// worker for initial installation.
@@ -165,10 +138,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
typedef std::map<int64, ServiceWorkerRegistration*> RegistrationsMap;
typedef std::map<int64, ServiceWorkerVersion*> VersionMap;
- ProviderMap* GetProviderMapForProcess(int process_id) {
- return providers_.Lookup(process_id);
- }
-
void RegistrationComplete(const GURL& pattern,
const RegistrationCallback& callback,
ServiceWorkerStatusCode status,
@@ -184,7 +153,6 @@ class CONTENT_EXPORT ServiceWorkerContextCore
// because the Wrapper::Shutdown call that hops threads to destroy |this| uses
// Bind() to hold a reference to |wrapper_| until |this| is fully destroyed.
ServiceWorkerContextWrapper* wrapper_;
- ProcessToProviderMap providers_;
scoped_ptr<ServiceWorkerStorage> storage_;
scoped_refptr<EmbeddedWorkerRegistry> embedded_worker_registry_;
scoped_ptr<ServiceWorkerJobCoordinator> job_coordinator_;

Powered by Google App Engine
This is Rietveld 408576698