Bug 1254858: P2. Properly dispatch task on the right thread. r=kentuckyfriedtakahe draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 09 Mar 2016 21:14:01 +1100
changeset 338531 a89a59ce242a7cd892f0039061340cf42373aa9a
parent 338530 c10dda417a9c2b4a5fe6140b7ec3d13b1ffdec7b
child 338532 d0983ad8a3d1c3b5f30d7531af614e281af97dfd
child 338990 96c95a67e33e9dd784ff059fee678fc815bb61a9
push id12529
push userbmo:jyavenard@mozilla.com
push dateWed, 09 Mar 2016 10:39:46 +0000
reviewerskentuckyfriedtakahe
bugs1254858
milestone48.0a1
Bug 1254858: P2. Properly dispatch task on the right thread. r=kentuckyfriedtakahe We were dispatching a task on the main thread, only to redispatch it immediately. MozReview-Commit-ID: 4Hl6C5UEA82
dom/media/Benchmark.cpp
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -174,19 +174,19 @@ BenchmarkPlayback::InitDecoder(TrackInfo
   RefPtr<PDMFactory> platform = new PDMFactory();
   mDecoder = platform->CreateDecoder(aInfo, mDecoderTaskQueue, this);
   if (!mDecoder) {
     MainThreadShutdown();
     return;
   }
   RefPtr<Benchmark> ref(mMainThreadState);
   mDecoder->Init()->Then(
-    ref->Thread(), __func__,
+    Thread(), __func__,
     [this, ref](TrackInfo::TrackType aTrackType) {
-      Dispatch(NS_NewRunnableFunction([this, ref]() { InputExhausted(); }));
+      InputExhausted();
     },
     [this, ref](MediaDataDecoder::DecoderFailureReason aReason) {
       MainThreadShutdown();
     });
 }
 
 void
 BenchmarkPlayback::MainThreadShutdown()