Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread.
MozReview-Commit-ID: 6fxhzTOFaWx
--- 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
{