Chromium Code Reviews| 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 42e25b75e7dbedceda51c7bcc5321fe3eb42d55c..acf10f690da7b4f0a19e673a68f895800cd82b33 100644 |
| --- a/content/browser/service_worker/service_worker_context_core.h |
| +++ b/content/browser/service_worker/service_worker_context_core.h |
| @@ -11,6 +11,7 @@ |
| #include "base/callback.h" |
| #include "base/files/file_path.h" |
| #include "base/id_map.h" |
| +#include "base/memory/linked_ptr.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/observer_list_threadsafe.h" |
| @@ -159,6 +160,16 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
| scoped_ptr<ProviderHostIterator> GetClientProviderHostIterator( |
| const GURL& origin); |
| + // PlzNavigate |
| + // Methods to manage the list of ProviderHosts for navigation requests. |
| + void AddNavigationProviderHost( |
|
michaeln
2015/10/07 01:16:44
Calling Add() and then never calling Take() or Rmv
Fabrice (no longer in Chrome)
2015/10/07 12:59:43
I added comments explaining where and why the Take
|
| + scoped_ptr<ServiceWorkerProviderHost> provider_host); |
| + // Returns an empty scoped_ptr if the ProviderHost with id |provider_id| is |
| + // not present. |
| + scoped_ptr<ServiceWorkerProviderHost> TakeNavigationProviderHost( |
| + int provider_id); |
| + void RemoveNavigationProviderHost(int provider_id); |
| + |
| // Maintains a map from Client UUID to ProviderHost. |
| // (Note: instead of maintaining 2 maps we might be able to uniformly use |
| // UUID instead of process_id+provider_id elsewhere. For now I'm leaving |
| @@ -294,6 +305,12 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
| std::map<int64, ServiceWorkerRegistration*> live_registrations_; |
| std::map<int64, ServiceWorkerVersion*> live_versions_; |
| std::map<int64, scoped_refptr<ServiceWorkerVersion>> protected_versions_; |
| + |
| + // PlzNavigate |
| + // Map of ServiceWorkerProviderHost used for navigation requests. |
| + std::map<int, linked_ptr<ServiceWorkerProviderHost>> |
| + navigation_provider_host_map_; |
| + |
| int next_handle_id_; |
| int next_registration_handle_id_; |
| // Set in RegisterServiceWorker(), cleared in ClearAllServiceWorkersForTest(). |