зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1336529 Handle ServiceWorkerInfo destruction while released KeepAliveToken. r=asuth
This commit is contained in:
Родитель
47aa24f1f4
Коммит
c07494ba04
|
@ -1374,7 +1374,7 @@ void
|
|||
ServiceWorkerManager::WorkerIsIdle(ServiceWorkerInfo* aWorker)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(aWorker);
|
||||
MOZ_DIAGNOSTIC_ASSERT(aWorker);
|
||||
|
||||
RefPtr<ServiceWorkerRegistrationInfo> reg =
|
||||
GetRegistration(aWorker->GetPrincipal(), aWorker->Scope());
|
||||
|
|
|
@ -2072,7 +2072,11 @@ ServiceWorkerPrivate::ReleaseToken()
|
|||
--mTokenCount;
|
||||
if (!mTokenCount) {
|
||||
TerminateWorker();
|
||||
} else if (IsIdle()) {
|
||||
}
|
||||
|
||||
// mInfo can be nullptr here if NoteDeadServiceWorkerInfo() is called while
|
||||
// the KeepAliveToken is being proxy released as a runnable.
|
||||
else if (mInfo && IsIdle()) {
|
||||
RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
|
||||
if (swm) {
|
||||
swm->WorkerIsIdle(mInfo);
|
||||
|
|
Загрузка…
Ссылка в новой задаче