Bug 1300497. Part 4 - remove the call to ScheduleStateMachine() before |SetState(DECODER_STATE_SHUTDOWN)| and cancel mDelayedScheduler in Shutdown(). draft
authorJW Wang <jwwang@mozilla.com>
Tue, 06 Sep 2016 10:26:45 +0800
changeset 410898 519590a1a8a14e46d5b2060fd208c19fcb90c307
parent 410897 abc53fc703b5c658acd78ee4922ce5921b83f916
child 410899 81779a695c1add37463a1b612c8cdbaad9bed39d
push id28782
push userjwwang@mozilla.com
push dateWed, 07 Sep 2016 03:31:14 +0000
bugs1300497
milestone51.0a1
Bug 1300497. Part 4 - remove the call to ScheduleStateMachine() before |SetState(DECODER_STATE_SHUTDOWN)| and cancel mDelayedScheduler in Shutdown(). We don't want to run MDSM cycles anymore once shutdown begins. MozReview-Commit-ID: 7Py20oqWNBG
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1222,22 +1222,20 @@ MediaDecoderStateMachine::SetDormant(boo
   SetState(DECODER_STATE_DECODING_METADATA);
 }
 
 RefPtr<ShutdownPromise>
 MediaDecoderStateMachine::Shutdown()
 {
   MOZ_ASSERT(OnTaskQueue());
 
-  // Once we've entered the shutdown state here there's no going back.
-  // Change state before issuing shutdown request to threads so those
-  // threads can start exiting cleanly during the Shutdown call.
-  ScheduleStateMachine();
   SetState(DECODER_STATE_SHUTDOWN);
 
+  mDelayedScheduler.Reset();
+
   mBufferedUpdateRequest.DisconnectIfExists();
 
   mQueuedSeek.RejectIfExists(__func__);
 
   DiscardSeekTaskIfExist();
 
   // Shutdown happens will decode timer is active, we need to disconnect and
   // dispose of the timer.