Backed out changeset 26cd857611b8 (bug 982726)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 28 Oct 2014 12:30:49 +0100
changeset 212643 2884632670a5bff2ea22a2a29b74f5c5154d54f8
parent 212642 7cdcfb2bc1cecbd64a94702b87a68a5ba10b46af
child 212644 c6e5013e0b7f886be569ed7f17891044722467c9
push id27721
push usercbook@mozilla.com
push dateTue, 28 Oct 2014 14:55:05 +0000
treeherdermozilla-central@c0ddb1b098ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs982726
milestone36.0a1
backs out26cd857611b8a662f005c2b7975955a69ca9549a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 26cd857611b8 (bug 982726)
dom/workers/ServiceWorkerClients.h
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
--- a/dom/workers/ServiceWorkerClients.h
+++ b/dom/workers/ServiceWorkerClients.h
@@ -4,28 +4,29 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 #ifndef mozilla_dom_workers_serviceworkerclients_h
 #define mozilla_dom_workers_serviceworkerclients_h
 
 #include "nsAutoPtr.h"
 #include "nsWrapperCache.h"
-#include "mozilla/dom/WorkerScope.h"
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class Promise;
 
 namespace workers {
 
+class ServiceWorkerGlobalScope;
+
 class ServiceWorkerClients MOZ_FINAL : public nsISupports,
                                        public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ServiceWorkerClients)
 
   ServiceWorkerClients(ServiceWorkerGlobalScope* aWorkerScope);
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -28,17 +28,16 @@
 #include "Location.h"
 #include "Navigator.h"
 #include "Principal.h"
 #include "RuntimeService.h"
 #include "ScriptLoader.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 #include "Performance.h"
-#include "ServiceWorkerClients.h"
 
 #define UNWRAP_WORKER_OBJECT(Interface, obj, value)                           \
   UnwrapObject<prototypes::id::Interface##_workers,                           \
     mozilla::dom::Interface##Binding_workers::NativeType>(obj, value)
 
 using namespace mozilla;
 using namespace mozilla::dom;
 USING_WORKERS_NAMESPACE
@@ -370,44 +369,30 @@ NS_IMPL_RELEASE_INHERITED(ServiceWorkerG
 
 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate,
                                                    const nsACString& aScope)
   : WorkerGlobalScope(aWorkerPrivate),
     mScope(NS_ConvertUTF8toUTF16(aScope))
 {
 }
 
-ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope()
-{
-}
-
 JSObject*
 ServiceWorkerGlobalScope::WrapGlobalObject(JSContext* aCx)
 {
   mWorkerPrivate->AssertIsOnWorkerThread();
   MOZ_ASSERT(mWorkerPrivate->IsServiceWorker());
 
   JS::CompartmentOptions options;
   mWorkerPrivate->CopyJSCompartmentOptions(options);
 
   return ServiceWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this, options,
                                                        GetWorkerPrincipal(),
                                                        true);
 }
 
-ServiceWorkerClients*
-ServiceWorkerGlobalScope::Clients()
-{
-  if (!mClients) {
-    mClients = new ServiceWorkerClients(this);
-  }
-
-  return mClients;
-}
-
 bool
 GetterOnlyJSNative(JSContext* aCx, unsigned aArgc, JS::Value* aVp)
 {
   JS_ReportErrorNumber(aCx, js_GetErrorMessage, nullptr, JSMSG_GETTER_ONLY);
   return false;
 }
 
 namespace {
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -6,30 +6,31 @@
 #ifndef mozilla_dom_workerscope_h__
 #define mozilla_dom_workerscope_h__
 
 #include "Workers.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/dom/Headers.h"
 #include "mozilla/dom/RequestBinding.h"
 
+#include "ServiceWorkerClients.h"
+
 namespace mozilla {
 namespace dom {
 
 class Console;
 class Function;
 class Promise;
 class RequestOrScalarValueString;
 
 } // namespace dom
 } // namespace mozilla
 
 BEGIN_WORKERS_NAMESPACE
 
-class ServiceWorkerClients;
 class WorkerPrivate;
 class WorkerLocation;
 class WorkerNavigator;
 class Performance;
 
 class WorkerGlobalScope : public DOMEventTargetHelper,
                           public nsIGlobalObject
 {
@@ -168,17 +169,17 @@ public:
   IMPL_EVENT_HANDLER(connect)
 };
 
 class ServiceWorkerGlobalScope MOZ_FINAL : public WorkerGlobalScope
 {
   const nsString mScope;
   nsRefPtr<ServiceWorkerClients> mClients;
 
-  ~ServiceWorkerGlobalScope();
+  ~ServiceWorkerGlobalScope() { }
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerGlobalScope,
                                            WorkerGlobalScope)
 
   ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate, const nsACString& aScope);
 
@@ -202,30 +203,30 @@ public:
   {
     // FIXME(nsm): Bug 982728
   }
 
   already_AddRefed<Promise>
   Unregister(ErrorResult& aRv);
 
   ServiceWorkerClients*
-  Clients();
+  Clients() {
+    if (!mClients) {
+      mClients = new ServiceWorkerClients(this);
+    }
+
+    return mClients;
+  }
 
   IMPL_EVENT_HANDLER(activate)
   IMPL_EVENT_HANDLER(beforeevicted)
   IMPL_EVENT_HANDLER(evicted)
   IMPL_EVENT_HANDLER(fetch)
   IMPL_EVENT_HANDLER(install)
   IMPL_EVENT_HANDLER(message)
 };
 
 JSObject*
 CreateGlobalScope(JSContext* aCx);
 
 END_WORKERS_NAMESPACE
 
-inline nsISupports*
-ToSupports(mozilla::dom::workers::WorkerGlobalScope* aScope)
-{
-  return static_cast<nsIDOMEventTarget*>(aScope);
-}
-
 #endif /* mozilla_dom_workerscope_h__ */