nsresult MediaTaskQueue::FlushAndDispatch(TemporaryRef<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); nsresult rv = DispatchLocked(aRunnable, IgnoreFlushing); NS_ENSURE_SUCCESS(rv, rv); AwaitIdleLocked(); return NS_OK; }
nsresult FlushableTaskQueue::FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); FlushLocked(); nsCOMPtr<nsIRunnable> r = dont_AddRef(aRunnable.take()); nsresult rv = DispatchLocked(r.forget(), IgnoreFlushing, AssertDispatchSuccess); NS_ENSURE_SUCCESS(rv, rv); AwaitIdleLocked(); return NS_OK; }
nsresult MediaTaskQueue::ForceDispatch(TemporaryRef<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); return DispatchLocked(aRunnable, Forced); }
nsresult MediaTaskQueue::Dispatch(TemporaryRef<nsIRunnable> aRunnable) { MonitorAutoLock mon(mQueueMonitor); return DispatchLocked(aRunnable, AbortIfFlushing); }