diff --git a/dom/workers/ServiceWorkerClients.h b/dom/workers/ServiceWorkerClients.h index 39cf03a6dab6..a1ea870d294b 100644 --- a/dom/workers/ServiceWorkerClients.h +++ b/dom/workers/ServiceWorkerClients.h @@ -9,6 +9,7 @@ #include "nsAutoPtr.h" #include "nsWrapperCache.h" +#include "mozilla/dom/WorkerScope.h" namespace mozilla { @@ -20,8 +21,6 @@ class Promise; namespace workers { -class ServiceWorkerGlobalScope; - class ServiceWorkerClients MOZ_FINAL : public nsISupports, public nsWrapperCache { diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index 015fd2ce3045..9a41031ab119 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -33,6 +33,7 @@ #include "WorkerPrivate.h" #include "WorkerRunnable.h" #include "Performance.h" +#include "ServiceWorkerClients.h" #define UNWRAP_WORKER_OBJECT(Interface, obj, value) \ UnwrapObject mClients; - ~ServiceWorkerGlobalScope() { } + ~ServiceWorkerGlobalScope(); public: NS_DECL_ISUPPORTS_INHERITED @@ -208,13 +207,7 @@ public: Unregister(ErrorResult& aRv); ServiceWorkerClients* - Clients() { - if (!mClients) { - mClients = new ServiceWorkerClients(this); - } - - return mClients; - } + Clients(); IMPL_EVENT_HANDLER(activate) IMPL_EVENT_HANDLER(beforeevicted) @@ -229,4 +222,10 @@ CreateGlobalScope(JSContext* aCx); END_WORKERS_NAMESPACE +inline nsISupports* +ToSupports(mozilla::dom::workers::WorkerGlobalScope* aScope) +{ + return static_cast(aScope); +} + #endif /* mozilla_dom_workerscope_h__ */