Bug 1254858: P2. Properly dispatch task on the right thread. r=kentuckyfriedtakahe a=ritu
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 09 Mar 2016 21:14:01 +1100
changeset 325621 05526258963910db6295abc3a892d20f956f4562
parent 325620 6ceec4d5edb0099a774e2f80f9f15c3407c99cc5
child 325622 f7020c4cc1c469d4ad6099ff5564df3baf973bb6
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskentuckyfriedtakahe, ritu
bugs1254858
milestone47.0a2
Bug 1254858: P2. Properly dispatch task on the right thread. r=kentuckyfriedtakahe a=ritu 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()