From e34a7de0c4557de57451b331360c0b22a72c0d18 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Fri, 13 Jan 2017 15:19:13 +0800 Subject: [PATCH] Bug 1330889. Part 5 - remove MDSM::mState. r=kikuo MozReview-Commit-ID: 648LWr4WU0F --HG-- extra : rebase_source : 4135d2d76845cd2b90793b7bd1ba9176c39f80de --- dom/media/MediaDecoderStateMachine.cpp | 10 ++++------ dom/media/MediaDecoderStateMachine.h | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 156a30d106a7..1277fb58dfd4 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -295,14 +295,13 @@ protected: auto s = new S(master); - MOZ_ASSERT(master->mState != s->GetState() || - master->mState == DECODER_STATE_SEEKING); + MOZ_ASSERT(GetState() != s->GetState() || + GetState() == DECODER_STATE_SEEKING); SLOG("change state to: %s", ToStateStr(s->GetState())); Exit(); - master->mState = s->GetState(); master->mStateObj.reset(s); return s->Enter(Move(aArgs)...); } @@ -2739,7 +2738,6 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder) RefPtr self = this; OwnerThread()->Dispatch(NS_NewRunnableFunction([self] () { - MOZ_ASSERT(self->mState == DECODER_STATE_DECODING_METADATA); MOZ_ASSERT(!self->mStateObj); auto s = new DecodeMetadataState(self); self->mStateObj.reset(s); @@ -2835,7 +2833,7 @@ const char* MediaDecoderStateMachine::ToStateStr() { MOZ_ASSERT(OnTaskQueue()); - return ToStateStr(mState); + return ToStateStr(mStateObj->GetState()); } void MediaDecoderStateMachine::VolumeChanged() @@ -3663,7 +3661,7 @@ MediaDecoderStateMachine::DumpDebugInfo() mStateObj->DumpDebugInfo(); DUMP_LOG( "GetMediaTime=%lld GetClock=%lld mMediaSink=%p " - "mState=%s mPlayState=%d mSentFirstFrameLoadedEvent=%d IsPlaying=%d " + "state=%s mPlayState=%d mSentFirstFrameLoadedEvent=%d IsPlaying=%d " "mAudioStatus=%s mVideoStatus=%s mDecodedAudioEndTime=%lld mDecodedVideoEndTime=%lld " "mAudioCompleted=%d mVideoCompleted=%d", GetMediaTime(), mMediaSink->IsStarted() ? GetClock() : -1, mMediaSink.get(), diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 9cc54a260bdf..8c7c7bf2e89f 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -488,8 +488,6 @@ private: // the decoder, state machine, and main threads. MediaQueue mVideoQueue; - State mState = DECODER_STATE_DECODING_METADATA; - UniquePtr mStateObj; media::TimeUnit Duration() const { MOZ_ASSERT(OnTaskQueue()); return mDuration.Ref().ref(); }