Bug 1241531 - Part 2: Move Cancel() to ServiceWorkerJob base class. r=ehsan

This commit is contained in:
Ben Kelly 2016-01-21 08:49:00 -05:00
parent 65b8a0eec8
commit 000a5ee768

View File

@ -168,6 +168,13 @@ public:
virtual void Start() = 0;
void
Cancel()
{
mQueue = nullptr;
mCanceled = true;
}
bool
IsRegisterOrInstallJob() const
{
@ -181,10 +188,12 @@ protected:
ServiceWorkerJobQueue* mQueue;
Type mJobType;
bool mCanceled;
explicit ServiceWorkerJob(ServiceWorkerJobQueue* aQueue, Type aJobType)
: mQueue(aQueue)
, mJobType(aJobType)
, mCanceled(false)
{}
virtual ~ServiceWorkerJob()
@ -952,19 +961,11 @@ public:
, mScriptSpec(aScriptSpec)
, mCallback(aCallback)
, mUpdateAndInstallInfo(aServiceWorkerInfo)
, mCanceled(false)
{
AssertIsOnMainThread();
MOZ_ASSERT(aPrincipal);
}
void
Cancel()
{
mQueue = nullptr;
mCanceled = true;
}
protected:
nsCOMPtr<nsIPrincipal> mPrincipal;
const nsCString mScope;
@ -972,7 +973,6 @@ protected:
RefPtr<ServiceWorkerUpdateFinishCallback> mCallback;
RefPtr<ServiceWorkerRegistrationInfo> mRegistration;
RefPtr<ServiceWorkerInfo> mUpdateAndInstallInfo;
bool mCanceled;
~ServiceWorkerJobBase()
{ }