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
--- 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,