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 91be6eb3972c7edba4ca85751aa0b2a2fd758452..4fa9100912d2a2585febb1edf4e7eb08cc617b09 100644 |
--- a/content/public/browser/service_worker_context.h |
+++ b/content/public/browser/service_worker_context.h |
@@ -15,12 +15,35 @@ namespace content { |
// the UI thread. |
class ServiceWorkerContext { |
public: |
+ class ServiceWorkerInfo { |
+ public: |
+ ServiceWorkerInfo(int worker_process_id, |
+ int embedded_worker_id, |
+ const GURL& scope, |
+ const GURL& url, |
+ int worker_devtools_agent_route_id) |
+ : worker_process_id(worker_process_id), |
+ embedded_worker_id(embedded_worker_id), |
+ scope(scope), |
+ url(url), |
+ worker_devtools_agent_route_id(worker_devtools_agent_route_id) {} |
+ int worker_process_id; |
+ int embedded_worker_id; |
+ GURL scope; |
+ GURL url; |
+ int worker_devtools_agent_route_id; |
+ }; |
+ |
// 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 in |source_process_id|, except that |pattern| is |
// an absolute URL instead of relative to some current origin. |callback| is |
@@ -52,6 +75,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; |
+ |
+ virtual void GetRunningServiceWorkerInfo( |
+ const GetRunningServiceWorkerInfoCallback& callback) = 0; |
+ |
protected: |
ServiceWorkerContext() {} |
virtual ~ServiceWorkerContext() {} |