Bug 1289976. Part 10 - Remove the IsShutdown() check from MediaDecoder::UpdateDormantState(). r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Wed, 27 Jul 2016 10:56:46 +0800
changeset 394666 73dd594455f4d3c7eeaeefe1d1f1cc3cbc8c4fbf
parent 394665 2305d9a1f51ebfd450f744ab41588e9c73644a0a
child 394808 87aa403c106865fb9a5d44aefa03fe13d961c10e
push id24619
push userjwwang@mozilla.com
push dateSat, 30 Jul 2016 10:57:17 +0000
reviewerskaku
bugs1289976
milestone50.0a1
Bug 1289976. Part 10 - Remove the IsShutdown() check from MediaDecoder::UpdateDormantState(). r?kaku 1. It is called from DormantTimerExpired(). The timer is canceled in Shutdown(). 2. It is called from NotifyOwnerActivityChanged() which happens before Shutdown(). 3. It is called from Play() which happens before Shutdown(). 4. It is called from Seek() which happens before Shutdown(). MozReview-Commit-ID: EnKHF61FBXf
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -314,19 +314,19 @@ MediaDecoder::IsHeuristicDormantSupporte
 #endif
     mIsHeuristicDormantSupported;
 }
 
 void
 MediaDecoder::UpdateDormantState(bool aDormantTimeout, bool aActivity)
 {
   MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(!IsShutdown());
 
-  if (IsShutdown() ||
-      !mDecoderStateMachine ||
+  if (!mDecoderStateMachine ||
       !mOwner->GetVideoFrameContainer() ||
       (mOwner->GetMediaElement() && mOwner->GetMediaElement()->IsBeingDestroyed()) ||
       !mDormantSupported)
   {
     return;
   }
 
   DECODER_LOG("UpdateDormantState aTimeout=%d aActivity=%d mIsDormant=%d "