Bug 1289004. Part 3 - Remove MediaDecoder::mShuttingDown. r=cpearce

MozReview-Commit-ID: DoJ4UFuyz2h

--HG--
extra : rebase_source : 531df3335548186338fc2eb5b5b4b0bb4cc6c101
extra : source : d4f4a98303c3ddc14986478aa44f137cce87af30
This commit is contained in:
JW Wang 2016-07-13 16:48:27 +08:00
Родитель 12fd7814cd
Коммит 0b638406f0
2 изменённых файлов: 7 добавлений и 19 удалений

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

@ -325,7 +325,6 @@ MediaDecoder::UpdateDormantState(bool aDormantTimeout, bool aActivity)
if (IsShutdown() ||
!mDecoderStateMachine ||
mPlayState == PLAY_STATE_SHUTDOWN ||
!mOwner->GetVideoFrameContainer() ||
(mOwner->GetMediaElement() && mOwner->GetMediaElement()->IsBeingDestroyed()) ||
!mDormantSupported)
@ -425,12 +424,13 @@ void
MediaDecoder::Pause()
{
MOZ_ASSERT(NS_IsMainThread());
if (mPlayState == PLAY_STATE_LOADING ||
IsEnded()) {
if (IsShutdown()) {
return;
}
if (mPlayState == PLAY_STATE_LOADING || IsEnded()) {
mNextState = PLAY_STATE_PAUSED;
return;
}
ChangeState(PLAY_STATE_PAUSED);
}
@ -504,7 +504,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, mVideoFrameContainer(aOwner->GetVideoFrameContainer())
, mPlaybackStatistics(new MediaChannelStatistics())
, mPinnedForSeek(false)
, mShuttingDown(false)
, mPausedForPlaybackRateNull(false)
, mMinimizePreroll(false)
, mMediaTracksConstructed(false)
@ -611,8 +610,6 @@ MediaDecoder::Shutdown()
return;
}
mShuttingDown = true;
// Unwatch all watch targets to prevent further notifications.
mWatchManager.Shutdown();
@ -1078,7 +1075,7 @@ bool
MediaDecoder::IsEndedOrShutdown() const
{
MOZ_ASSERT(NS_IsMainThread());
return IsEnded() || mPlayState == PLAY_STATE_SHUTDOWN;
return IsEnded() || IsShutdown();
}
bool
@ -1127,7 +1124,7 @@ bool
MediaDecoder::IsShutdown() const
{
MOZ_ASSERT(NS_IsMainThread());
return mShuttingDown;
return mPlayState == PLAY_STATE_SHUTDOWN;
}
void
@ -1341,15 +1338,12 @@ void
MediaDecoder::ChangeState(PlayState aState)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!IsShutdown(), "SHUTDOWN is the final state.");
if (mNextState == aState) {
mNextState = PLAY_STATE_PAUSED;
}
if (mPlayState == PLAY_STATE_SHUTDOWN) {
return;
}
DECODER_LOG("ChangeState %s => %s", PlayStateStr(), ToPlayStateStr(aState));
mPlayState = aState;

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

@ -684,12 +684,6 @@ protected:
// while seeking.
bool mPinnedForSeek;
// True if the decoder is being shutdown. At this point all events that
// are currently queued need to return immediately to prevent javascript
// being run that operates on the element and decoder during shutdown.
// Read/Write from the main thread only.
bool mShuttingDown;
// True if the playback is paused because the playback rate member is 0.0.
bool mPausedForPlaybackRateNull;