Index: content/public/browser/service_worker_context.h |
diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h |
index 57aa955b33c75967201e005abb0d1c9f9dfc9164..ea10727af2beab24e105f0ca66397c92e9dff65b 100644 |
--- a/content/public/browser/service_worker_context.h |
+++ b/content/public/browser/service_worker_context.h |
@@ -15,12 +15,31 @@ namespace content { |
// the UI thread. |
class ServiceWorkerContext { |
public: |
+ class ServiceWorkerInfo { |
michaeln
2014/05/01 02:52:07
naming nit: RunningServiceWorkerInfo? I can easily
horo
2014/05/01 04:52:32
Done.
|
+ public: |
+ ServiceWorkerInfo(int worker_process_id, |
+ int worker_devtools_agent_route_id, |
+ const GURL& scope, |
+ const GURL& url) |
+ : worker_process_id(worker_process_id), |
+ worker_devtools_agent_route_id(worker_devtools_agent_route_id), |
+ scope(scope), |
+ url(url) {} |
+ int worker_process_id; |
+ int worker_devtools_agent_route_id; |
+ GURL scope; |
+ GURL url; |
+ }; |
+ |
// https://rawgithub.com/slightlyoff/ServiceWorker/master/spec/service_worker/index.html#url-scope: |
// roughly, must be of the form "<origin>/<path>/*". |
typedef GURL Scope; |
typedef base::Callback<void(bool success)> ResultCallback; |
+ typedef base::Callback<void(const std::vector< |
+ ServiceWorkerInfo>& registrations)> GetRunningServiceWorkerInfoCallback; |
+ |
// Equivalent to calling navigator.serviceWorker.register(script_url, {scope: |
// pattern}) from a renderer, except that |pattern| is an absolute URL instead |
// of relative to some current origin. |callback| is passed true when the JS |
@@ -50,6 +69,15 @@ class ServiceWorkerContext { |
// TODO(jyasskin): Provide a way to SendMessage to a Scope. |
+ virtual void AddStatusChangeCallback( |
+ const base::Callback<void(void)>& callback) = 0; |
+ |
+ virtual void RemoveStatusChangeCallback( |
+ const base::Callback<void(void)>& callback) = 0; |
michaeln
2014/05/01 02:52:07
Identifying what to remove by callback ref seems o
horo
2014/05/01 04:52:32
Changed to use StatusChangeObserver.
|
+ |
+ virtual void GetRunningServiceWorkerInfo( |
+ const GetRunningServiceWorkerInfoCallback& callback) = 0; |
+ |
protected: |
ServiceWorkerContext() {} |
virtual ~ServiceWorkerContext() {} |