diff --git a/dom/media/MediaTaskQueue.cpp b/dom/media/MediaTaskQueue.cpp index c94cc7e9156e..4d31a93adff4 100644 --- a/dom/media/MediaTaskQueue.cpp +++ b/dom/media/MediaTaskQueue.cpp @@ -129,7 +129,7 @@ MediaTaskQueue::AwaitIdle() void MediaTaskQueue::AwaitIdleLocked() { - // Make the there are no tasks for this queue waiting in the caller's tail + // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. MOZ_ASSERT_IF(AbstractThread::GetCurrent(), !AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this)); @@ -144,7 +144,7 @@ MediaTaskQueue::AwaitIdleLocked() void MediaTaskQueue::AwaitShutdownAndIdle() { - // Make the there are no tasks for this queue waiting in the caller's tail + // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. MOZ_ASSERT_IF(AbstractThread::GetCurrent(), !AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this)); @@ -159,6 +159,11 @@ MediaTaskQueue::AwaitShutdownAndIdle() nsRefPtr MediaTaskQueue::BeginShutdown() { + // Make sure there are no tasks for this queue waiting in the caller's tail + // dispatcher. + MOZ_ASSERT_IF(AbstractThread::GetCurrent(), + !AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this)); + MonitorAutoLock mon(mQueueMonitor); mIsShutdown = true; nsRefPtr p = mShutdownPromise.Ensure(__func__); @@ -194,7 +199,7 @@ FlushableMediaTaskQueue::FlushAndDispatch(TemporaryRef aRunnable) void FlushableMediaTaskQueue::FlushLocked() { - // Make the there are no tasks for this queue waiting in the caller's tail + // Make sure there are no tasks for this queue waiting in the caller's tail // dispatcher. MOZ_ASSERT_IF(AbstractThread::GetCurrent(), !AbstractThread::GetCurrent()->TailDispatcher().HasTasksFor(this));