Bug 1314524. Part 4 - remove DormantState::HandleDormant().
MozReview-Commit-ID: JSkpvglJzpN
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -448,37 +448,29 @@ public:
mPendingSeek.RejectIfExists(__func__);
}
State GetState() const override
{
return DECODER_STATE_DORMANT;
}
- bool HandleDormant(bool aDormant);
-
RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override;
void HandleVideoSuspendTimeout() override
{
// Do nothing since we've released decoders in Enter().
}
void HandleResumeVideoDecoding() override
{
// Do nothing since we won't resume decoding until exiting dormant.
}
- void HandlePlayStateChanged(MediaDecoder::PlayState aPlayState) override
- {
- if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
- // Exit dormant when the user wants to play.
- HandleDormant(false);
- }
- }
+ void HandlePlayStateChanged(MediaDecoder::PlayState aPlayState) override;
private:
SeekJob mPendingSeek;
};
/**
* Purpose: decode the 1st audio and video frames to fire the 'loadeddata' event.
*
@@ -1361,38 +1353,38 @@ DecodeMetadataState::OnMetadataRead(Meta
bool
MediaDecoderStateMachine::
WaitForCDMState::HandleDormant(bool aDormant)
{
mPendingDormant = aDormant;
return true;
}
-bool
-MediaDecoderStateMachine::
-DormantState::HandleDormant(bool aDormant)
-{
- if (!aDormant) {
- MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
- SetState<DecodingFirstFrameState>(Move(mPendingSeek));
- }
- return true;
-}
-
RefPtr<MediaDecoder::SeekPromise>
MediaDecoderStateMachine::
DormantState::HandleSeek(SeekTarget aTarget)
{
// Exit dormant when the user wants to seek.
mPendingSeek.RejectIfExists(__func__);
SeekJob seekJob;
seekJob.mTarget = aTarget;
return SetState<SeekingState>(Move(seekJob));
}
+void
+MediaDecoderStateMachine::
+DormantState::HandlePlayStateChanged(MediaDecoder::PlayState aPlayState)
+{
+ if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
+ // Exit dormant when the user wants to play.
+ MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
+ SetState<DecodingFirstFrameState>(Move(mPendingSeek));
+ }
+}
+
bool
MediaDecoderStateMachine::
WaitForCDMState::HandleCDMProxyReady()
{
if (mPendingDormant) {
SetState<DormantState>(Move(mPendingSeek));
} else {
SetState<DecodingFirstFrameState>(Move(mPendingSeek));