Bug 1387702 - be sure to enter the AbstractThread context for state-mirroring to be usable. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 07 Aug 2017 10:54:17 +0800
changeset 641464 7b8e5bedb22414747d1e331fc62eb21d3a2ee5c1
parent 641444 bb8de16ce00cb57b587a14c210ecc7505f366328
child 642339 b9594c03541876da7069390f69774912aae70c6d
push id72531
push userjwwang@mozilla.com
push dateMon, 07 Aug 2017 02:54:46 +0000
bugs1387702
milestone57.0a1
Bug 1387702 - be sure to enter the AbstractThread context for state-mirroring to be usable. MozReview-Commit-ID: 3kML9KVr01g
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1031,16 +1031,17 @@ MediaDecoder::ShouldThrottleDownload()
   return stats.mDownloadRate > factor * stats.mPlaybackRate;
 }
 
 void
 MediaDecoder::DownloadProgressed()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
+  AbstractThread::AutoEnter context(AbstractMainThread());
   UpdatePlaybackRate();
   GetOwner()->DownloadProgressed();
   GetResource()->ThrottleReadahead(ShouldThrottleDownload());
 }
 
 void
 MediaDecoder::NotifyDownloadEnded(nsresult aStatus)
 {