Bug 965309 - Stop the SyncLoop of a running sync XHR if the proxy was released before the LoadStartDetectionRunnable could run r=khuey

This commit is contained in:
Tim Taubert 2014-05-09 12:53:12 +02:00
Родитель 0c71819122
Коммит 0d63bc2dbc
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -564,6 +564,17 @@ private:
MainThreadRun() MOZ_OVERRIDE
{
mProxy->Teardown();
// Make sure to stop the syncLoop of a sync XHR request whose
// worker was released while the request was still running.
if (mProxy->mSyncLoopTarget) {
nsRefPtr<MainThreadStopSyncLoopRunnable> runnable =
new MainThreadStopSyncLoopRunnable(mWorkerPrivate,
mProxy->mSyncLoopTarget.forget(),
false);
MOZ_ALWAYS_TRUE(runnable->Dispatch(nullptr));
}
return NS_OK;
}
};
@ -1108,6 +1119,9 @@ LoadStartDetectionRunnable::Run()
mProxy->mWorkerPrivate = nullptr;
mProxy->mOutstandingSendCount--;
}
} else {
// The proxy was released and torn down by a SyncTeardownRunnable.
mProxy->mWorkerPrivate = nullptr;
}
}