mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1241531 - Part 2: Move Cancel() to ServiceWorkerJob base class. r=ehsan
This commit is contained in:
parent
65b8a0eec8
commit
000a5ee768
@ -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()
|
||||
{ }
|
||||
|
Loading…
Reference in New Issue
Block a user