Bug 1221418 - A better cleanup method for AsmJSCache::ChildRunnable, r=janv

This commit is contained in:
Andrea Marchesini 2016-01-08 12:55:40 +00:00
parent d0a775fa30
commit b25fa28709

View File

@ -1271,6 +1271,13 @@ public:
return JS::AsmJSCache_Success;
}
void Cleanup()
{
#ifdef DEBUG
NoteActorDestroyed();
#endif
}
private:
~ChildRunnable()
{
@ -1329,7 +1336,7 @@ private:
ActorDestroy(ActorDestroyReason why) override
{
MOZ_ASSERT(NS_IsMainThread());
mActorDestroyed = true;
NoteActorDestroyed();
}
void
@ -1368,6 +1375,11 @@ private:
mCondVar.Notify();
}
void NoteActorDestroyed()
{
mActorDestroyed = true;
}
nsIPrincipal* const mPrincipal;
nsAutoPtr<PrincipalInfo> mPrincipalInfo;
WriteParams mWriteParams;
@ -1553,6 +1565,7 @@ OpenFile(nsIPrincipal* aPrincipal,
JS::AsmJSCacheResult openResult =
childRunnable->BlockUntilOpen(aChildRunnable);
if (openResult != JS::AsmJSCache_Success) {
childRunnable->Cleanup();
return openResult;
}