Bug 1263392 - Console should reset the state of ConsoleCallData if the worker runnables are not correctly dispatched, r=smaug

This commit is contained in:
Andrea Marchesini 2016-04-11 15:08:57 -04:00
Родитель 25af6e92e8
Коммит 330d61a4ae
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -407,14 +407,23 @@ private:
MOZ_ASSERT(aRunnable);
}
// If something goes wrong, we still need to release the ConsoleCallData
// object. For this reason we have a custom Cancel method.
NS_IMETHOD
Cancel() override
{
mRunnable->ReleaseData();
mRunnable->mConsole = nullptr;
return NS_OK;
}
virtual bool
WorkerRun(JSContext* aCx, workers::WorkerPrivate* aWorkerPrivate) override
{
MOZ_ASSERT(aWorkerPrivate);
aWorkerPrivate->AssertIsOnWorkerThread();
mRunnable->ReleaseData();
mRunnable->mConsole = nullptr;
Cancel();
aWorkerPrivate->RemoveFeature(mRunnable);
return true;