зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1458970 Avoid accessing mClientSource when a worker is Terminating in more places. r=baku
This commit is contained in:
Родитель
2e65d96a69
Коммит
c6174cef5a
|
@ -3526,9 +3526,15 @@ WorkerPrivate::GetClientState() const
|
|||
}
|
||||
|
||||
const Maybe<ServiceWorkerDescriptor>
|
||||
WorkerPrivate::GetController() const
|
||||
WorkerPrivate::GetController()
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (mStatus >= Terminating) {
|
||||
return Maybe<ServiceWorkerDescriptor>();
|
||||
}
|
||||
}
|
||||
MOZ_DIAGNOSTIC_ASSERT(mClientSource);
|
||||
return mClientSource->GetController();
|
||||
}
|
||||
|
@ -3537,9 +3543,15 @@ void
|
|||
WorkerPrivate::Control(const ServiceWorkerDescriptor& aServiceWorker)
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
MOZ_DIAGNOSTIC_ASSERT(mClientSource);
|
||||
MOZ_DIAGNOSTIC_ASSERT(!IsChromeWorker());
|
||||
MOZ_DIAGNOSTIC_ASSERT(Type() != WorkerTypeService);
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (mStatus >= Terminating) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
MOZ_DIAGNOSTIC_ASSERT(mClientSource);
|
||||
mClientSource->SetController(aServiceWorker);
|
||||
}
|
||||
|
||||
|
|
|
@ -560,7 +560,7 @@ public:
|
|||
GetClientState() const;
|
||||
|
||||
const Maybe<ServiceWorkerDescriptor>
|
||||
GetController() const;
|
||||
GetController();
|
||||
|
||||
void
|
||||
Control(const ServiceWorkerDescriptor& aServiceWorker);
|
||||
|
|
Загрузка…
Ссылка в новой задаче