Bug 1247189 - part5 : use IsCurrentThreadIn() as a main criteria to determine whether we're on the task queue or not. r=jya
☠☠ backed out by 7e3f88db34fd ☠ ☠
authorAlastor Wu <alwu@mozilla.com>
Wed, 11 Oct 2017 16:12:13 +0800
changeset 428294 9be5bbb35797abfae615b3e3096b5ed0f6575b13
parent 428293 85d236f46b0052cca3766aafbbb5ce323b0848eb
child 428295 bfb0b1e1a689ec6d9c44bdb8cb6fcf750831544d
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersjya
bugs1247189
milestone58.0a1
Bug 1247189 - part5 : use IsCurrentThreadIn() as a main criteria to determine whether we're on the task queue or not. r=jya 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
dom/media/mediasource/TrackBuffersManager.h
--- 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.