mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 624572 - Abort in content process receiving PAudio:SampleOffsetUpdate r=dougt a=blocking-fennec
--HG-- extra : rebase_source : fcc520e461b285763312fc5e977bb187c8f28b7f
This commit is contained in:
parent
46e829073e
commit
3154fd89cc
@ -287,7 +287,7 @@ class AudioShutdownEvent : public nsRunnable
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
if (mAudioChild->IsIPCOpen())
|
||||
PAudioChild::Send__delete__(mAudioChild);
|
||||
mAudioChild->SendShutdown();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -219,20 +219,10 @@ AudioParent::RecvResume()
|
||||
}
|
||||
|
||||
bool
|
||||
AudioParent::Recv__delete__()
|
||||
AudioParent::RecvShutdown()
|
||||
{
|
||||
if (mTimer) {
|
||||
mTimer->Cancel();
|
||||
mTimer = nsnull;
|
||||
}
|
||||
|
||||
if (mStream) {
|
||||
nsCOMPtr<nsIRunnable> event = new AudioStreamShutdownEvent(mStream);
|
||||
nsCOMPtr<nsIThread> thread = mStream->GetThread();
|
||||
thread->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
|
||||
mStream = nsnull;
|
||||
}
|
||||
|
||||
Shutdown();
|
||||
PAudioParent::Send__delete__(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -261,6 +251,24 @@ void
|
||||
AudioParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
mIPCOpen = PR_FALSE;
|
||||
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
void
|
||||
AudioParent::Shutdown()
|
||||
{
|
||||
if (mTimer) {
|
||||
mTimer->Cancel();
|
||||
mTimer = nsnull;
|
||||
}
|
||||
|
||||
if (mStream) {
|
||||
nsCOMPtr<nsIRunnable> event = new AudioStreamShutdownEvent(mStream);
|
||||
nsCOMPtr<nsIThread> thread = mStream->GetThread();
|
||||
thread->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
|
||||
mStream = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -71,7 +71,7 @@ class AudioParent : public PAudioParent, public nsITimerCallback
|
||||
RecvResume();
|
||||
|
||||
virtual bool
|
||||
Recv__delete__();
|
||||
RecvShutdown();
|
||||
|
||||
AudioParent(PRInt32 aNumChannels, PRInt32 aRate, PRInt32 aFormat);
|
||||
virtual ~AudioParent();
|
||||
@ -81,6 +81,8 @@ class AudioParent : public PAudioParent, public nsITimerCallback
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
|
||||
private:
|
||||
void Shutdown();
|
||||
|
||||
PRPackedBool mIPCOpen;
|
||||
};
|
||||
} // namespace dom
|
||||
|
@ -48,8 +48,6 @@ protocol PAudio
|
||||
|
||||
parent:
|
||||
|
||||
__delete__();
|
||||
|
||||
Write(nsCString data, PRUint32 count);
|
||||
|
||||
SetVolume(float aVolume);
|
||||
@ -58,13 +56,15 @@ parent:
|
||||
|
||||
Pause();
|
||||
Resume();
|
||||
Shutdown();
|
||||
|
||||
child:
|
||||
|
||||
__delete__();
|
||||
|
||||
SampleOffsetUpdate(PRInt64 offset, PRInt64 time);
|
||||
DrainDone();
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
Loading…
Reference in New Issue
Block a user