Bug 1336529 Handle ServiceWorkerInfo destruction while released KeepAliveToken. r=asuth

This commit is contained in:
Ben Kelly 2017-02-03 14:36:27 -05:00
Родитель 47aa24f1f4
Коммит c07494ba04
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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);