Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1413)

Unified Diff: content/browser/service_worker/service_worker_context_wrapper.h

Issue 251653003: Introduces DevToolsManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stop using CallbackList Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698