bug 1410043 remove over-zealous graph-thread assert in SetCurrentDriver() r?pehrsons draft
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 20 Oct 2017 17:59:19 +1300
changeset 683735 399c9b74cf9ce4b2c68ad91dd88cc91ab1640ef1
parent 683653 b6ba3e919f561bfabbf4bec7f0f53a23c360adee
child 736715 d35fd01beed890385195b57a85ed28fe3e7f77f5
push id85451
push userktomlinson@mozilla.com
push dateFri, 20 Oct 2017 05:00:24 +0000
reviewerspehrsons
bugs1410043
milestone58.0a1
bug 1410043 remove over-zealous graph-thread assert in SetCurrentDriver() r?pehrsons The reverts to accepting ownership of the monitor regardless of the thread, as accepted prior to https://hg.mozilla.org/mozilla-central/rev/e3f39de40209#l1.25 As indicated in the SetCurrentDriver() documentation, it can be called on the main thread during Revive() before another graph thread is started. At that point mLifecycleState = LIFECYCLE_RUNNING, and so it is not easy to adjust AssertOnGraphThreadOrNotRunning() to accept this situation without making it much more liberal. An alternative would be to change the Revive() methods to set mDriver directly, but that would differ from the usual driver-switching pattern. MozReview-Commit-ID: 9O5qakPVML9
dom/media/MediaStreamGraphImpl.h
--- a/dom/media/MediaStreamGraphImpl.h
+++ b/dom/media/MediaStreamGraphImpl.h
@@ -471,17 +471,16 @@ public:
    * should return and pass the control to the new driver shortly after.
    * We can also switch from Revive() (on MainThread), in which case the
    * monitor is held
    */
   void SetCurrentDriver(GraphDriver* aDriver)
   {
 #ifdef DEBUG
     mMonitor.AssertCurrentThreadOwns();
-    AssertOnGraphThreadOrNotRunning();
 #endif
     mDriver = aDriver;
   }
 
   Monitor& GetMonitor()
   {
     return mMonitor;
   }