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 4748aa965ad551025e9319ad7dfaf6b9985100d0..d22f53bc879e04c091131ad4bbe5f8846a08d429 100644 |
| --- a/content/browser/service_worker/service_worker_context_core.h |
| +++ b/content/browser/service_worker/service_worker_context_core.h |
| @@ -9,6 +9,7 @@ |
| #include <vector> |
| #include "base/callback.h" |
| +#include "base/containers/scoped_ptr_hash_map.h" |
| #include "base/files/file_path.h" |
| #include "base/id_map.h" |
| #include "base/memory/scoped_ptr.h" |
| @@ -68,6 +69,8 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
| using ProviderByClientUUIDMap = |
| std::map<std::string, ServiceWorkerProviderHost*>; |
| + using BrowserProviderHostMap = |
| + base::ScopedPtrHashMap<int, scoped_ptr<ServiceWorkerProviderHost>>; |
| // Directory for ServiceWorkerStorage and ServiceWorkerCacheManager. |
| static const base::FilePath::CharType kServiceWorkerDirectory[]; |
| @@ -159,6 +162,14 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
| scoped_ptr<ProviderHostIterator> GetClientProviderHostIterator( |
| const GURL& origin); |
| + // PlzNavigate: |
| + // Manage ServiceWorkerProviderHost for browser-initiated navigations. |
| + ServiceWorkerProviderHost* CreateBrowserProviderHost(int provider_id); |
| + void RegisterBrowserProviderHost( |
| + scoped_ptr<ServiceWorkerProviderHost> provider_host); |
| + scoped_ptr<ServiceWorkerProviderHost> TakeBrowserProviderHost( |
|
michaeln
2015/09/16 00:56:42
Since the URLRequest + SWRequestHandler scope the
Fabrice (no longer in Chrome)
2015/09/30 17:32:07
Done.
|
| + 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 |
| @@ -279,6 +290,8 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
| std::map<int64, ServiceWorkerRegistration*> live_registrations_; |
| std::map<int64, ServiceWorkerVersion*> live_versions_; |
| std::map<int64, scoped_refptr<ServiceWorkerVersion>> protected_versions_; |
| + |
| + BrowserProviderHostMap browser_provider_host_map_; |
| int next_handle_id_; |
| int next_registration_handle_id_; |
| scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> |