mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 1221418 - A better cleanup method for AsmJSCache::ChildRunnable, r=janv
This commit is contained in:
parent
c4bd398fc2
commit
13070077c7
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user