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..6d7d6997a5f7a79fb49d6c993e389b042b8ec040 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" |
@@ -55,6 +56,13 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper |
const ResultCallback& continuation) |
OVERRIDE; |
+ virtual scoped_ptr<base::CallbackList<void(void)>::Subscription> |
michaeln
2014/04/25 22:09:14
From callback_list.h
// Add a callback to the l
horo
2014/04/26 08:00:45
Done.
Oh, I didn't understand that. Thank you.
|
+ RegisterStatusChangeCallback( |
+ const base::Callback<void(void)>& callback) OVERRIDE; |
+ |
+ virtual void GetRunningServiceWorkerInfo( |
+ const GetRunningServiceWorkerInfoCallback& callback) OVERRIDE; |
+ |
void AddObserver(ServiceWorkerContextObserver* observer); |
void RemoveObserver(ServiceWorkerContextObserver* observer); |
@@ -62,9 +70,32 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper |
friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
virtual ~ServiceWorkerContextWrapper(); |
+ class CallbackProxy : public ServiceWorkerContextObserver, |
michaeln
2014/04/25 22:09:14
Alternatively, it looks like ServiceWorkerContextW
horo
2014/04/26 08:00:45
Done.
|
+ public base::RefCountedThreadSafe<CallbackProxy> { |
+ public: |
+ CallbackProxy() {} |
+ virtual ~CallbackProxy() {} |
+ scoped_ptr<base::CallbackList<void(void)>::Subscription> Add( |
+ const base::Callback<void(void)>& callback); |
+ 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); |
+ |
+ private: |
+ void onStatusChanged(); |
+ base::CallbackList<void(void)> status_change_callback_list_; |
+ }; |
+ |
+ void onStatusChanged(); |
michaeln
2014/04/25 22:09:14
is this used?
|
+ |
scoped_ptr<ServiceWorkerContextCore> context_core_; |
scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > |
observer_list_; |
+ scoped_refptr<CallbackProxy> callback_proxy_; |
}; |
} // namespace content |