Bug 1227015 P2 Move mScriptSpec from registration job into script job base. r=ehsan
☠☠ backed out by c873567c2898 ☠ ☠
authorBen Kelly <ben@wanderview.com>
Thu, 10 Dec 2015 18:08:13 -0500
changeset 276132 2090c1e309332bcd6db61f3323f2f75915a4dca5
parent 276131 84e011be4e35292d7e378e17a36857395e63594c
child 276133 03abf4d48e38797557e47ead30b9cb84db75e208
push id69058
push userbkelly@mozilla.com
push dateThu, 10 Dec 2015 23:08:27 +0000
treeherdermozilla-inbound@d518261eb3b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1227015
milestone45.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 1227015 P2 Move mScriptSpec from registration job into script job base. r=ehsan
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -963,23 +963,27 @@ protected:
     }
   }
 };
 
 // Base type for jobs that work with a specific service worker script.
 class ServiceWorkerScriptJobBase : public ServiceWorkerJobBase
 {
 protected:
+  const nsCString mScriptSpec;
+
   ServiceWorkerScriptJobBase(ServiceWorkerJobQueue* aQueue,
                              ServiceWorkerJob::Type aJobType,
                              ServiceWorkerUpdateFinishCallback* aCallback,
                              ServiceWorkerRegistrationInfo* aRegistration,
-                             ServiceWorkerInfo* aServiceWorkerInfo)
+                             ServiceWorkerInfo* aServiceWorkerInfo,
+                             const nsACString& aScriptSpec)
     : ServiceWorkerJobBase(aQueue, aJobType, aCallback, aRegistration,
                            aServiceWorkerInfo)
+    , mScriptSpec(aScriptSpec)
   {
   }
 
   // This MUST only be called when the job is still performing actions related
   // to registration or update. After the spec resolves the update promise, use
   // Done() with the failure code instead.
   // Callers MUST hold a strong ref before calling this!
   void
@@ -1046,17 +1050,18 @@ class ServiceWorkerInstallJob final : pu
   friend class ContinueInstallTask;
 
 public:
   ServiceWorkerInstallJob(ServiceWorkerJobQueue* aQueue,
                           ServiceWorkerUpdateFinishCallback* aCallback,
                           ServiceWorkerRegistrationInfo* aRegistration,
                           ServiceWorkerInfo* aServiceWorkerInfo)
     : ServiceWorkerScriptJobBase(aQueue, Type::InstallJob, aCallback,
-                                 aRegistration, aServiceWorkerInfo)
+                                 aRegistration, aServiceWorkerInfo,
+                                 EmptyCString())
   {
     MOZ_ASSERT(aRegistration);
   }
 
   void
   Start()
   {
     AssertIsOnMainThread();
@@ -1177,17 +1182,16 @@ public:
 };
 
 class ServiceWorkerRegisterJob final : public ServiceWorkerScriptJobBase,
                                        public serviceWorkerScriptCache::CompareCallback
 {
   friend class ContinueUpdateRunnable;
 
   nsCString mScope;
-  nsCString mScriptSpec;
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
 
   ~ServiceWorkerRegisterJob()
   { }
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
@@ -1195,33 +1199,32 @@ public:
   // [[Register]]
   ServiceWorkerRegisterJob(ServiceWorkerJobQueue* aQueue,
                            const nsCString& aScope,
                            const nsCString& aScriptSpec,
                            ServiceWorkerUpdateFinishCallback* aCallback,
                            nsIPrincipal* aPrincipal,
                            nsILoadGroup* aLoadGroup)
     : ServiceWorkerScriptJobBase(aQueue, Type::RegisterJob, aCallback, nullptr,
-                                 nullptr)
+                                 nullptr, aScriptSpec)
     , mScope(aScope)
-    , mScriptSpec(aScriptSpec)
     , mPrincipal(aPrincipal)
     , mLoadGroup(aLoadGroup)
   {
     AssertIsOnMainThread();
     MOZ_ASSERT(mLoadGroup);
     MOZ_ASSERT(aCallback);
   }
 
   // [[Update]]
   ServiceWorkerRegisterJob(ServiceWorkerJobQueue* aQueue,
                            ServiceWorkerRegistrationInfo* aRegistration,
                            ServiceWorkerUpdateFinishCallback* aCallback)
     : ServiceWorkerScriptJobBase(aQueue, Type::UpdateJob, aCallback,
-                                 aRegistration, nullptr)
+                                 aRegistration, nullptr, EmptyCString())
   {
     AssertIsOnMainThread();
   }
 
   void
   Start() override
   {
     AssertIsOnMainThread();