Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 20 Dec 2017 15:28:52 +0800
changeset 716068 cda450621750c15c3d5ca539c7192f1d3b4c0efe
parent 716014 3acb14b949150529ec761f845f9a3d61ee341dac
child 716069 77b9b26ac3cbe388bb8a5d50bdf4a6502bc3c93a
child 716096 c96134f65abeb15a852f5edf1622c6c6077ab9bd
child 716098 e5489e86f5debf8d2ff0b96b81a8d0c20eab7c0e
push id94318
push userjwwang@mozilla.com
push dateFri, 05 Jan 2018 03:25:56 +0000
bugs1428242
milestone59.0a1
Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread. MozReview-Commit-ID: 6fxhzTOFaWx
dom/media/MediaCache.cpp
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -243,17 +243,21 @@ public:
 
 #ifdef DEBUG_VERIFY_CACHE
   // Verify invariants, especially block list invariants
   void Verify(AutoLock&);
 #else
   void Verify(AutoLock&) {}
 #endif
 
-  ReentrantMonitor& Monitor() { return mMonitor; }
+  ReentrantMonitor& Monitor()
+  {
+    MOZ_DIAGNOSTIC_ASSERT(!NS_IsMainThread());
+    return mMonitor;
+  }
 
   /**
    * An iterator that makes it easy to iterate through all streams that
    * have a given resource ID and are not closed.
    * Must be used while holding the media cache lock.
    */
   class ResourceStreamIterator
   {