Bug 1426056. P3 - assert MediaCacheStream::GetLength() is called off the main thread. draft
authorJW Wang <jwwang@mozilla.com>
Thu, 07 Dec 2017 15:50:41 +0800
changeset 713282 37ec9c60fe6311b1ed74a0e6f65979548df1d925
parent 713281 24a97ff28e1b244eb37866769eb963b94922d7a7
child 713283 ccf6b9856c6f1f6f3241a65c1c8bdcce925903d8
push id93611
push userjwwang@mozilla.com
push dateWed, 20 Dec 2017 02:48:06 +0000
bugs1426056
milestone59.0a1
Bug 1426056. P3 - assert MediaCacheStream::GetLength() is called off the main thread. MozReview-Commit-ID: 7L8C4f2Lg3C
dom/media/MediaCache.cpp
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2418,17 +2418,17 @@ MediaCacheStream::Unpin()
   // 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);
 }
 
 int64_t
 MediaCacheStream::GetLength()
 {
-  // TODO: Assert non-main thread.
+  MOZ_ASSERT(!NS_IsMainThread());
   AutoLock lock(mMediaCache->Monitor());
   return mStreamLength;
 }
 
 int64_t
 MediaCacheStream::GetNextCachedData(int64_t aOffset)
 {
   MOZ_ASSERT(!NS_IsMainThread());