Bug 1289976. Part 9 - Remove the IsShutdown() check from MediaDecoder::StartDormantTimer(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Wed, 27 Jul 2016 10:52:01 +0800
changeset 333329 a9f48e09d97911e837fbc5d7d2a620e05d178f6b
parent 333328 54df7081706d823d000b6a67f2ce67bc59a454c7
child 333330 728ec5d19e750556960bc40f1353d7b6a5b02193
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1289976
milestone51.0a1
Bug 1289976. Part 9 - Remove the IsShutdown() check from MediaDecoder::StartDormantTimer(). r=kaku We don't need to check IsShutdown() which is a subset of |mPlayState != PLAY_STATE_PAUSED && !IsEnded()|. MozReview-Commit-ID: BjYoLOLuPfC
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -381,26 +381,21 @@ MediaDecoder::DormantTimerExpired(nsITim
   decoder->UpdateDormantState(true /* aDormantTimeout */,
                               false /* aActivity */);
 }
 
 void
 MediaDecoder::StartDormantTimer()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  if (!IsHeuristicDormantSupported()) {
-    return;
-  }
 
-  if (mIsHeuristicDormant ||
-      IsShutdown() ||
+  if (!IsHeuristicDormantSupported() ||
+      mIsHeuristicDormant ||
       mIsVisible ||
-      (mPlayState != PLAY_STATE_PAUSED &&
-       !IsEnded()))
-  {
+      (mPlayState != PLAY_STATE_PAUSED && !IsEnded())) {
     return;
   }
 
   if (!mDormantTimer) {
     mDormantTimer = do_CreateInstance("@mozilla.org/timer;1");
   }
   mDormantTimer->InitWithFuncCallback(&MediaDecoder::DormantTimerExpired,
                                       this,