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 a38e8141abda3fb8a7482662aafffdcbc7b67e29..b8cc1e54f67062a15663a5f934d71dcc6141e80a 100644 |
--- a/content/browser/service_worker/service_worker_context_core.h |
+++ b/content/browser/service_worker/service_worker_context_core.h |
@@ -84,10 +84,15 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
private: |
friend class ServiceWorkerContextCore; |
- explicit ProviderHostIterator(ProcessToProviderMap* map); |
+ using ProviderHostPredicate = |
+ base::Callback<bool(ServiceWorkerProviderHost*)>; |
+ ProviderHostIterator(ProcessToProviderMap* map, |
+ const ProviderHostPredicate& predicate); |
void Initialize(); |
+ bool ForwardUntilMatchingProviderHost(); |
ProcessToProviderMap* map_; |
+ ProviderHostPredicate predicate_; |
scoped_ptr<ProcessToProviderMap::iterator> process_iterator_; |
scoped_ptr<ProviderMap::iterator> provider_host_iterator_; |
@@ -148,15 +153,18 @@ class CONTENT_EXPORT ServiceWorkerContextCore |
void RemoveProviderHost(int process_id, int provider_id); |
void RemoveAllProviderHostsForProcess(int process_id); |
scoped_ptr<ProviderHostIterator> GetProviderHostIterator(); |
+ scoped_ptr<ProviderHostIterator> GetProviderHostIteratorForOrigin( |
+ const GURL& origin); |
// 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 |
// these as provider_id is deeply wired everywhere) |
- void RegisterClientIDForProviderHost( |
- const std::string& client_uuid, |
- ServiceWorkerProviderHost* provider_host); |
- void UnregisterClientIDForProviderHost(const std::string& client_uuid); |
+ void RegisterProviderHostByClientID(const std::string& client_uuid, |
+ ServiceWorkerProviderHost* provider_host); |
+ void UnregisterProviderHostByClientID(const std::string& client_uuid); |
+ ServiceWorkerProviderHost* GetProviderHostByClientID( |
+ const std::string& client_uuid); |
// A child process of |source_process_id| may be used to run the created |
// worker for initial installation. |