Bug 1294629 - Simplify the code of ReaderSuspendedChanged(). r=kaku

SetDormant() checks IsShutdown() and |mState == DECODER_STATE_DORMANT|.
So ReaderSuspendedChanged() can just call SetDormant(mIsReaderSuspended) to do the work.

MozReview-Commit-ID: J7Dzsm8IhIS

--HG--
extra : rebase_source : c8a0bc31071bfbe084c2a5f47821c0dc3cfd0860
This commit is contained in:
JW Wang 2016-08-11 17:35:51 +08:00
Родитель 2a5c775eea
Коммит cef7b4cae0
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -1400,15 +1400,7 @@ void MediaDecoderStateMachine::ReaderSuspendedChanged()
{
MOZ_ASSERT(OnTaskQueue());
DECODER_LOG("ReaderSuspendedChanged: %d", mIsReaderSuspended.Ref());
if (IsShutdown()) {
return;
}
if (mIsReaderSuspended && mState != DECODER_STATE_DORMANT) {
SetDormant(true);
} else if (!mIsReaderSuspended && mState == DECODER_STATE_DORMANT) {
SetDormant(false);
}
SetDormant(mIsReaderSuspended);
}
void