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

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

Issue 1007133002: ServiceWorker: Support includeUncontrolled option in clients.matchAll() (1/2, chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add EXPORT Created 5 years, 9 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c2457a80f4e39d936fcc2096ea406d2f1da4349d 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -75,7 +75,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore
static const base::FilePath::CharType kServiceWorkerDirectory[];
// Iterates over ServiceWorkerProviderHost objects in a ProcessToProviderMap.
- class ProviderHostIterator {
+ class CONTENT_EXPORT ProviderHostIterator {
public:
~ProviderHostIterator();
ServiceWorkerProviderHost* GetProviderHost();
@@ -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_;
@@ -149,14 +154,21 @@ class CONTENT_EXPORT ServiceWorkerContextCore
void RemoveAllProviderHostsForProcess(int process_id);
scoped_ptr<ProviderHostIterator> GetProviderHostIterator();
+ // Returns a ProviderHost iterator for all ServiceWorker clients for
+ // the |origin|. This only returns ProviderHosts that are of CONTROLLEE
+ // and belong to the |origin|.
+ scoped_ptr<ProviderHostIterator> GetClientProviderHostIterator(
+ 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.
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_context_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698