Bug 1434701 P4 Move ServiceWorkerRegistrationListener into its own header. r=asuth
authorBen Kelly <ben@wanderview.com>
Wed, 14 Feb 2018 14:23:15 -0500
changeset 403870 d2f19419e6cc0ef97f9afbcd38e60dd47299e85f
parent 403869 14e52519867e49f110376d6b81b37906d4687c9f
child 403871 1538099138c19d8f4581f9f305a1826a057f045a
push id33445
push userapavel@mozilla.com
push dateThu, 15 Feb 2018 10:27:00 +0000
treeherdermozilla-central@9b69cc60e584 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1434701
milestone60.0a1
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
Bug 1434701 P4 Move ServiceWorkerRegistrationListener into its own header. r=asuth
dom/serviceworkers/ServiceWorkerManager.cpp
dom/serviceworkers/ServiceWorkerRegistration.cpp
dom/serviceworkers/ServiceWorkerRegistration.h
dom/serviceworkers/ServiceWorkerRegistrationListener.h
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -75,16 +75,17 @@
 #include "ServiceWorkerContainer.h"
 #include "ServiceWorkerInfo.h"
 #include "ServiceWorkerJobQueue.h"
 #include "ServiceWorkerManagerChild.h"
 #include "ServiceWorkerPrivate.h"
 #include "ServiceWorkerRegisterJob.h"
 #include "ServiceWorkerRegistrar.h"
 #include "ServiceWorkerRegistration.h"
+#include "ServiceWorkerRegistrationListener.h"
 #include "ServiceWorkerScriptCache.h"
 #include "ServiceWorkerEvents.h"
 #include "ServiceWorkerUnregisterJob.h"
 #include "ServiceWorkerUpdateJob.h"
 #include "ServiceWorkerUpdaterChild.h"
 
 #ifdef PostMessage
 #undef PostMessage
--- a/dom/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistration.cpp
@@ -20,16 +20,17 @@
 #include "mozilla/dom/WorkerScope.h"
 #include "mozilla/Services.h"
 #include "mozilla/Unused.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "ServiceWorker.h"
 #include "ServiceWorkerManager.h"
+#include "ServiceWorkerRegistrationListener.h"
 
 #include "nsIDocument.h"
 #include "nsIServiceWorkerManager.h"
 #include "nsISupportsPrimitives.h"
 #include "nsPIDOMWindow.h"
 #include "nsContentUtils.h"
 
 namespace mozilla {
@@ -881,16 +882,18 @@ ServiceWorkerRegistrationMainThread::Get
 
   RefPtr<PushManager> ret = mPushManager;
   return ret.forget();
 }
 
 ////////////////////////////////////////////////////
 // Worker Thread implementation
 
+class WorkerListener;
+
 class ServiceWorkerRegistrationWorkerThread final : public ServiceWorkerRegistration
                                                   , public WorkerHolder
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerRegistrationWorkerThread,
                                            ServiceWorkerRegistration)
 
--- a/dom/serviceworkers/ServiceWorkerRegistration.h
+++ b/dom/serviceworkers/ServiceWorkerRegistration.h
@@ -7,53 +7,29 @@
 #ifndef mozilla_dom_ServiceWorkerRegistration_h
 #define mozilla_dom_ServiceWorkerRegistration_h
 
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/ServiceWorkerBinding.h"
 #include "mozilla/dom/ServiceWorkerCommon.h"
 #include "mozilla/dom/ServiceWorkerRegistrationBinding.h"
-#include "mozilla/dom/WorkerHolder.h"
 
 // Support for Notification API extension.
 #include "mozilla/dom/NotificationBinding.h"
 
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 namespace dom {
 
 class Promise;
 class PushManager;
 class ServiceWorkerRegistrationDescriptor;
-class WorkerListener;
-
-// Used by ServiceWorkerManager to notify ServiceWorkerRegistrations of
-// updatefound event and invalidating ServiceWorker instances.
-class ServiceWorkerRegistrationListener
-{
-public:
-  NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
-
-  virtual void
-  UpdateFound() = 0;
-
-  virtual void
-  InvalidateWorkers(WhichServiceWorker aWhichOnes) = 0;
-
-  virtual void
-  TransitionWorker(WhichServiceWorker aWhichOne) = 0;
-
-  virtual void
-  RegistrationRemoved() = 0;
-
-  virtual void
-  GetScope(nsAString& aScope) const = 0;
-};
+class WorkerPrivate;
 
 class ServiceWorkerRegistration : public DOMEventTargetHelper
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   IMPL_EVENT_HANDLER(updatefound)
 
new file mode 100644
--- /dev/null
+++ b/dom/serviceworkers/ServiceWorkerRegistrationListener.h
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_ServiceWorkerRegistrationListener_h
+#define mozilla_dom_ServiceWorkerRegistrationListener_h
+
+#include "mozilla/dom/ServiceWorkerCommon.h"
+
+namespace mozilla {
+namespace dom {
+
+// Used by ServiceWorkerManager to notify ServiceWorkerRegistrations of
+// updatefound event and invalidating ServiceWorker instances.
+class ServiceWorkerRegistrationListener
+{
+public:
+  NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
+
+  virtual void
+  UpdateFound() = 0;
+
+  virtual void
+  InvalidateWorkers(WhichServiceWorker aWhichOnes) = 0;
+
+  virtual void
+  TransitionWorker(WhichServiceWorker aWhichOne) = 0;
+
+  virtual void
+  RegistrationRemoved() = 0;
+
+  virtual void
+  GetScope(nsAString& aScope) const = 0;
+};
+
+
+} // namespace dom
+} // namespace mozilla
+
+#endif /* mozilla_dom_ServiceWorkerRegistrationListener_h */