Bug 1247189 - part5 : use IsCurrentThreadIn() as a main criteria to determine whether we're on the task queue or not.
The use of the TrackBuffersManager once detached is explictly forbidden, as such
OnTaskQueue() can only be used before the DetachTask ran: we now strongly assert
as such.
MozReview-Commit-ID: ycOI4QRElb
--- a/dom/media/mediasource/TrackBuffersManager.h
+++ b/dom/media/mediasource/TrackBuffersManager.h
@@ -456,17 +456,18 @@ private:
// TaskQueue methods and objects.
AbstractThread* GetTaskQueue() const
{
return mTaskQueue;
}
bool OnTaskQueue() const
{
- return !GetTaskQueue() || GetTaskQueue()->IsCurrentThreadIn();
+ MOZ_RELEASE_ASSERT(GetTaskQueue());
+ return GetTaskQueue()->IsCurrentThreadIn();
}
RefPtr<AutoTaskQueue> mTaskQueue;
// SourceBuffer Queues and running context.
SourceBufferTaskQueue mQueue;
void QueueTask(SourceBufferTask* aTask);
void ProcessTasks();
// Set if the TrackBuffersManager is currently processing a task.