Bug 1427931. P2 - assert MediaCacheStream::Pin/Unpin is called off the main thread.
MozReview-Commit-ID: 7tanbwvNfEh
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2400,28 +2400,28 @@ MediaCacheStream::CloseInternal(AutoLock
// Queue an Update since we may have created more free space.
mMediaCache->QueueUpdate(aLock);
}
void
MediaCacheStream::Pin()
{
- // TODO: Assert non-main thread.
+ MOZ_ASSERT(!NS_IsMainThread());
AutoLock lock(mMediaCache->Monitor());
++mPinCount;
// Queue an Update since we may no longer want to read more into the
// cache, if this stream's block have become non-evictable
mMediaCache->QueueUpdate(lock);
}
void
MediaCacheStream::Unpin()
{
- // TODO: Assert non-main thread.
+ MOZ_ASSERT(!NS_IsMainThread());
AutoLock lock(mMediaCache->Monitor());
NS_ASSERTION(mPinCount > 0, "Unbalanced Unpin");
--mPinCount;
// Queue an Update since we may be able to read more into the
// cache, if this stream's block have become evictable
mMediaCache->QueueUpdate(lock);
}