Bug 1378316. P2 - dispatch MediaDecoderReader::NotifyDataArrived explicitly instead of using MediaEventSource. draft
authorJW Wang <jwwang@mozilla.com>
Wed, 05 Jul 2017 17:29:05 +0800
changeset 605130 e842df9853462a6251d20c67b308a7fd74bc0781
parent 605129 42ffea9a55e6ec99da0121823b4c03c8f39632d7
child 605131 90ec6fa871f4d7a3a671290279c1b29305c8a8bc
push id67310
push userjwwang@mozilla.com
push dateFri, 07 Jul 2017 04:02:48 +0000
bugs1378316
milestone56.0a1
Bug 1378316. P2 - dispatch MediaDecoderReader::NotifyDataArrived explicitly instead of using MediaEventSource. MozReview-Commit-ID: AM3CjQ8LoTv
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1378,17 +1378,20 @@ void MediaDecoder::AddSizeOfResources(Re
   }
 }
 
 void
 MediaDecoder::NotifyDataArrivedInternal()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
-  mDataArrivedEvent.Notify();
+  mReader->OwnerThread()->Dispatch(
+    NewRunnableMethod("MediaDecoderReader::NotifyDataArrived",
+                      mReader.get(),
+                      &MediaDecoderReader::NotifyDataArrived));
 }
 
 void
 MediaDecoder::NotifyDataArrived()
 {
   NotifyDataArrivedInternal();
   DownloadProgressed();
 }