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

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

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 4 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 4748aa965ad551025e9319ad7dfaf6b9985100d0..87f47bcf3a5f96d29b8d1efa7d200473da0d862b 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,15 @@ class CONTENT_EXPORT ServiceWorkerContextCore
scoped_ptr<ProviderHostIterator> GetClientProviderHostIterator(
const GURL& origin);
+ // PlzNavigate:
+ // Manage ServiceWorkerProviderHost for browser-initiated navigations.
+ scoped_ptr<ServiceWorkerProviderHost> CreateBrowserProviderHost(
+ int provider_id);
+ void RegisterBrowserProviderHost(
michaeln 2015/09/16 00:56:41 As mentioned in other comments, having this class
+ scoped_ptr<ServiceWorkerProviderHost> provider_host);
+ scoped_ptr<ServiceWorkerProviderHost> TakeBrowserProviderHost(
+ 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 +291,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_;
michaeln 2015/09/16 00:56:41 i'd vote to use a std::map<int, T*> for consistenc
int next_handle_id_;
int next_registration_handle_id_;
scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>>

Powered by Google App Engine
This is Rietveld 408576698