Bug 1427931. P2 - assert MediaCacheStream::Pin/Unpin is called off the main thread. r=bechen,gerald

MozReview-Commit-ID: 7tanbwvNfEh

--HG--
extra : rebase_source : cac6f3cf525884a280bca20684a8d9ba89716b7d
This commit is contained in:
JW Wang 2018-01-04 10:30:07 +08:00
Родитель d201fcefe3
Коммит 3834402eca
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2405,7 +2405,7 @@ MediaCacheStream::CloseInternal(AutoLock& 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
@ -2416,7 +2416,7 @@ MediaCacheStream::Pin()
void
MediaCacheStream::Unpin()
{
// TODO: Assert non-main thread.
MOZ_ASSERT(!NS_IsMainThread());
AutoLock lock(mMediaCache->Monitor());
NS_ASSERTION(mPinCount > 0, "Unbalanced Unpin");
--mPinCount;