Bug 1427931. P2 - assert MediaCacheStream::Pin/Unpin is called off the main thread. draft
authorJW Wang <jwwang@mozilla.com>
Thu, 04 Jan 2018 10:30:07 +0800
changeset 715545 f1f979cdaa18200b20103b8f7c0643d75d01f006
parent 715544 6e4de6f9731f59fa2727e46dd64394218e776b39
child 715549 ab0dab8a566c0090dd900a9fbcdd97cc7b622cbc
push id94178
push userjwwang@mozilla.com
push dateThu, 04 Jan 2018 02:33:56 +0000
bugs1427931
milestone59.0a1
Bug 1427931. P2 - assert MediaCacheStream::Pin/Unpin is called off the main thread. MozReview-Commit-ID: 7tanbwvNfEh
dom/media/MediaCache.cpp
--- 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);
 }