mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 1143823 part 1: Make MediaStream::RunAfterPendingUpdates() take already_AddRefed instead of a nsRefPtr. r=karlt
This commit is contained in:
parent
f46b3c2dec
commit
c4a0036a5d
@ -2203,15 +2203,16 @@ MediaStream::RemoveListener(MediaStreamListener* aListener)
|
||||
}
|
||||
|
||||
void
|
||||
MediaStream::RunAfterPendingUpdates(nsRefPtr<nsIRunnable> aRunnable)
|
||||
MediaStream::RunAfterPendingUpdates(already_AddRefed<nsIRunnable> aRunnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MediaStreamGraphImpl* graph = GraphImpl();
|
||||
nsCOMPtr<nsIRunnable> runnable(aRunnable);
|
||||
|
||||
// Special case when a non-realtime graph has not started, to ensure the
|
||||
// runnable will run in finite time.
|
||||
if (!(graph->mRealtime || graph->mNonRealtimeProcessing)) {
|
||||
aRunnable->Run();
|
||||
runnable->Run();
|
||||
}
|
||||
|
||||
class Message : public ControlMessage {
|
||||
@ -2236,7 +2237,7 @@ MediaStream::RunAfterPendingUpdates(nsRefPtr<nsIRunnable> aRunnable)
|
||||
nsRefPtr<nsIRunnable> mRunnable;
|
||||
};
|
||||
|
||||
graph->AppendMessage(new Message(this, aRunnable.forget()));
|
||||
graph->AppendMessage(new Message(this, runnable.forget()));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -397,7 +397,7 @@ public:
|
||||
*
|
||||
* Main thread only.
|
||||
*/
|
||||
void RunAfterPendingUpdates(nsRefPtr<nsIRunnable> aRunnable);
|
||||
void RunAfterPendingUpdates(already_AddRefed<nsIRunnable> aRunnable);
|
||||
|
||||
// Signal that the client is done with this MediaStream. It will be deleted later.
|
||||
virtual void Destroy();
|
||||
|
Loading…
Reference in New Issue
Block a user