Bug 1395802. P2 - assert ChannelMediaResource::GetDownloadRate() runs on the main thread. r=cpearce
authorJW Wang <jwwang@mozilla.com>
Fri, 01 Sep 2017 14:19:51 +0800
changeset 428769 8bfe3fa7b4f15d8fc4bd4598f51b36bbac6b22e3
parent 428768 23fd25a4f713caf2a962727023e079aaa056074a
child 428770 a70f47912fbe20ae0fdba26c0123c32b0356b439
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1395802
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1395802. P2 - assert ChannelMediaResource::GetDownloadRate() runs on the main thread. r=cpearce The only caller is ChannelMediaDecoder::GetStatistics() which runs on the main thread. MozReview-Commit-ID: CYg3Z3rmlHd
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -1000,16 +1000,17 @@ void
 ChannelMediaResource::Unpin()
 {
   mCacheStream.Unpin();
 }
 
 double
 ChannelMediaResource::GetDownloadRate(bool* aIsReliable)
 {
+  MOZ_ASSERT(NS_IsMainThread());
   MutexAutoLock lock(mLock);
   return mChannelStatistics.GetRate(aIsReliable);
 }
 
 int64_t
 ChannelMediaResource::GetLength()
 {
   return mCacheStream.GetLength();