Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread. r=bechen,gerald
authorJW Wang <jwwang@mozilla.com>
Wed, 20 Dec 2017 15:28:52 +0800
changeset 449694 a5f886553c4beaea9816d24058a797a033b3e804
parent 449693 08b45ade75ed26f7f1cb0c0205caba2558a88912
child 449695 90ffd059bdfa679780d7d4dd99a259e0f457546b
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbechen, gerald
bugs1428242
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread. r=bechen,gerald 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
   {