| 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 6d53549071d19da8e5d140403d9348923a1bb166..85ae69b7f508bcc5d34ae473bdaa62268f884cf4 100644
|
| --- a/content/browser/service_worker/service_worker_context_wrapper.h
|
| +++ b/content/browser/service_worker/service_worker_context_wrapper.h
|
| @@ -11,6 +11,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"
|
|
|
| @@ -34,6 +35,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(BrowserContext* browser_context);
|
| @@ -52,9 +54,15 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
|
| const GURL& pattern,
|
| const GURL& script_url,
|
| const ResultCallback& continuation) OVERRIDE;
|
| - virtual void UnregisterServiceWorker(const GURL& pattern,
|
| - const ResultCallback& continuation)
|
| - OVERRIDE;
|
| + virtual void UnregisterServiceWorker(
|
| + const GURL& pattern,
|
| + const ResultCallback& continuation) OVERRIDE;
|
| + virtual void AddStatusChangeObserver(
|
| + StatusChangeObserver* observer) OVERRIDE;
|
| + virtual void RemoveStatusChangeObserver(
|
| + StatusChangeObserver* observer) OVERRIDE;
|
| + virtual void GetRunningServiceWorkerInfo(
|
| + const GetRunningServiceWorkerInfoCallback& callback) OVERRIDE;
|
|
|
| void AddObserver(ServiceWorkerContextObserver* observer);
|
| void RemoveObserver(ServiceWorkerContextObserver* observer);
|
| @@ -64,8 +72,20 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
|
| friend class ServiceWorkerProcessManager;
|
| virtual ~ServiceWorkerContextWrapper();
|
|
|
| + // ServiceWorkerContextObserver
|
| + virtual void OnWorkerStarted(int64 version_id,
|
| + int process_id,
|
| + int thread_id) OVERRIDE;
|
| + virtual void OnWorkerStopped(int64 version_id,
|
| + int process_id,
|
| + int thread_id) OVERRIDE;
|
| + virtual void OnVersionStateChanged(int64 version_id) OVERRIDE;
|
| +
|
| + void NotifyStatusChangeObservers();
|
| +
|
| const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> >
|
| observer_list_;
|
| + ObserverList<StatusChangeObserver> status_change_observers_;
|
| // Cleared in Shutdown():
|
| BrowserContext* browser_context_;
|
| scoped_ptr<ServiceWorkerContextCore> context_core_;
|
|
|