Index: content/browser/service_worker/service_worker_context_wrapper.h |
diff --git a/content/browser/service_worker/service_worker_context_wrapper.h b/content/browser/service_worker/service_worker_context_wrapper.h |
index cea9c06a4d07cc4ed8e9bdf7a32cf687bf796c17..82ed3d4b57486b821fd57c93e6057aa98c7d8a12 100644 |
--- a/content/browser/service_worker/service_worker_context_wrapper.h |
+++ b/content/browser/service_worker/service_worker_context_wrapper.h |
@@ -9,6 +9,7 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "content/browser/service_worker/service_worker_context_core.h" |
+#include "content/browser/service_worker/service_worker_context_observer.h" |
#include "content/common/content_export.h" |
#include "content/public/browser/service_worker_context.h" |
@@ -30,6 +31,7 @@ class ServiceWorkerContextObserver; |
// is what is used internally in the service worker lib. |
class CONTENT_EXPORT ServiceWorkerContextWrapper |
: NON_EXPORTED_BASE(public ServiceWorkerContext), |
+ public ServiceWorkerContextObserver, |
public base::RefCountedThreadSafe<ServiceWorkerContextWrapper> { |
public: |
ServiceWorkerContextWrapper(); |
@@ -55,6 +57,20 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper |
const ResultCallback& continuation) |
OVERRIDE; |
+ virtual void AddStatusChangeCallback( |
+ const base::Callback<void(void)>& callback) OVERRIDE; |
+ |
+ virtual void RemoveStatusChangeCallback( |
+ const base::Callback<void(void)>& callback) OVERRIDE; |
+ |
+ virtual void GetRunningServiceWorkerInfo( |
+ const GetRunningServiceWorkerInfoCallback& callback) OVERRIDE; |
+ |
+ // ServiceWorkerContextObserver |
+ virtual void OnWorkerStarted(int64 version_id, int process_id, int thread_id); |
+ virtual void OnWorkerStopped(int64 version_id, int process_id, int thread_id); |
+ virtual void OnVersionStateChanged(int64 version_id); |
+ |
void AddObserver(ServiceWorkerContextObserver* observer); |
void RemoveObserver(ServiceWorkerContextObserver* observer); |
@@ -62,9 +78,12 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper |
friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
virtual ~ServiceWorkerContextWrapper(); |
+ void CallStatusChangeCallback(); |
+ |
scoped_ptr<ServiceWorkerContextCore> context_core_; |
scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > |
observer_list_; |
+ std::vector<base::Callback<void(void)> > status_change_callbacks_; |
}; |
} // namespace content |