From 3e15fcaa7d9111428ef410645de77a829626d66b Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Tue, 8 Dec 2015 11:58:45 -0500 Subject: [PATCH] Bug 1227015 P2 Move mScriptSpec from registration job into script job base. r=ehsan --- dom/workers/ServiceWorkerManager.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index b08523ecc36c..7c4863a1f50c 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -968,13 +968,17 @@ protected: 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) { } @@ -1051,7 +1055,8 @@ public: ServiceWorkerRegistrationInfo* aRegistration, ServiceWorkerInfo* aServiceWorkerInfo) : ServiceWorkerScriptJobBase(aQueue, Type::InstallJob, aCallback, - aRegistration, aServiceWorkerInfo) + aRegistration, aServiceWorkerInfo, + EmptyCString()) { MOZ_ASSERT(aRegistration); } @@ -1182,7 +1187,6 @@ class ServiceWorkerRegisterJob final : public ServiceWorkerScriptJobBase, friend class ContinueUpdateRunnable; nsCString mScope; - nsCString mScriptSpec; nsCOMPtr mPrincipal; nsCOMPtr mLoadGroup; @@ -1200,9 +1204,8 @@ public: nsIPrincipal* aPrincipal, nsILoadGroup* aLoadGroup) : ServiceWorkerScriptJobBase(aQueue, Type::RegisterJob, aCallback, nullptr, - nullptr) + nullptr, aScriptSpec) , mScope(aScope) - , mScriptSpec(aScriptSpec) , mPrincipal(aPrincipal) , mLoadGroup(aLoadGroup) { @@ -1216,7 +1219,7 @@ public: ServiceWorkerRegistrationInfo* aRegistration, ServiceWorkerUpdateFinishCallback* aCallback) : ServiceWorkerScriptJobBase(aQueue, Type::UpdateJob, aCallback, - aRegistration, nullptr) + aRegistration, nullptr, EmptyCString()) { AssertIsOnMainThread(); }