зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1346498 part 6 - remove mHasSuspendTaint cannonical-mirror pair; r=jwwang
MozReview-Commit-ID: BqAfv9CSsv3 --HG-- extra : rebase_source : 61d8ab0494986b780b79ea9350c9d0b52f70a382 extra : source : 6d92d52bdc7688c76fc5f55853a9fa07b3875b44
This commit is contained in:
Родитель
abe34098cd
Коммит
062129aebf
|
@ -396,6 +396,7 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
|
|||
, mFiredMetadataLoaded(false)
|
||||
, mElementVisible(!aOwner->IsHidden())
|
||||
, mForcedHidden(false)
|
||||
, mHasSuspendTaint(false)
|
||||
, INIT_MIRROR(mStateMachineIsShutdown, true)
|
||||
, INIT_MIRROR(mBuffered, TimeIntervals())
|
||||
, INIT_MIRROR(mNextFrameStatus, MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE)
|
||||
|
@ -415,7 +416,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
|
|||
, INIT_CANONICAL(mPlaybackBytesPerSecond, 0.0)
|
||||
, INIT_CANONICAL(mPlaybackRateReliable, true)
|
||||
, INIT_CANONICAL(mDecoderPosition, 0)
|
||||
, INIT_CANONICAL(mHasSuspendTaint, false)
|
||||
, mTelemetryReported(false)
|
||||
, mIsMediaElement(!!aOwner->GetMediaElement())
|
||||
, mElement(aOwner->GetMediaElement())
|
||||
|
|
|
@ -722,6 +722,10 @@ protected:
|
|||
// If true, forces the decoder to be considered hidden.
|
||||
bool mForcedHidden;
|
||||
|
||||
// True if the decoder has a suspend taint - meaning suspend-video-decoder is
|
||||
// disabled.
|
||||
bool mHasSuspendTaint;
|
||||
|
||||
// A listener to receive metadata updates from MDSM.
|
||||
MediaEventListener mTimedMetadataListener;
|
||||
|
||||
|
@ -811,10 +815,6 @@ protected:
|
|||
// back again.
|
||||
Canonical<int64_t> mDecoderPosition;
|
||||
|
||||
// True if the decoder has a suspend taint - meaning suspend-video-decoder is
|
||||
// disabled.
|
||||
Canonical<bool> mHasSuspendTaint;
|
||||
|
||||
public:
|
||||
AbstractCanonical<media::NullableTimeUnit>* CanonicalDurationOrNull() override;
|
||||
AbstractCanonical<double>* CanonicalVolume() { return &mVolume; }
|
||||
|
@ -856,7 +856,6 @@ public:
|
|||
{
|
||||
return &mDecoderPosition;
|
||||
}
|
||||
AbstractCanonical<bool>* CanonicalHasSuspendTaint() { return &mHasSuspendTaint; }
|
||||
|
||||
private:
|
||||
// Notify owner when the audible state changed
|
||||
|
|
|
@ -2547,7 +2547,6 @@ ShutdownState::Enter()
|
|||
master->mPlaybackBytesPerSecond.DisconnectIfConnected();
|
||||
master->mPlaybackRateReliable.DisconnectIfConnected();
|
||||
master->mDecoderPosition.DisconnectIfConnected();
|
||||
master->mHasSuspendTaint.DisconnectIfConnected();
|
||||
|
||||
master->mDuration.DisconnectAll();
|
||||
master->mIsShutdown.DisconnectAll();
|
||||
|
@ -2615,7 +2614,6 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
|
|||
INIT_MIRROR(mPlaybackBytesPerSecond, 0.0),
|
||||
INIT_MIRROR(mPlaybackRateReliable, true),
|
||||
INIT_MIRROR(mDecoderPosition, 0),
|
||||
INIT_MIRROR(mHasSuspendTaint, false),
|
||||
INIT_CANONICAL(mDuration, NullableTimeUnit()),
|
||||
INIT_CANONICAL(mIsShutdown, false),
|
||||
INIT_CANONICAL(mNextFrameStatus, MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE),
|
||||
|
@ -2685,12 +2683,6 @@ MediaDecoderStateMachine::InitializationTask(MediaDecoder* aDecoder)
|
|||
&MediaDecoderStateMachine::RecomputeDuration);
|
||||
mWatchManager.Watch(mPlayState, &MediaDecoderStateMachine::PlayStateChanged);
|
||||
|
||||
if (MediaPrefs::MDSMSuspendBackgroundVideoEnabled()) {
|
||||
mHasSuspendTaint.Connect(aDecoder->CanonicalHasSuspendTaint());
|
||||
mWatchManager.Watch(mHasSuspendTaint,
|
||||
&MediaDecoderStateMachine::SuspendTaintChanged);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mStateObj);
|
||||
auto* s = new DecodeMetadataState(this);
|
||||
mStateObj.reset(s);
|
||||
|
@ -3014,19 +3006,6 @@ void MediaDecoderStateMachine::PlayStateChanged()
|
|||
mStateObj->HandlePlayStateChanged(mPlayState);
|
||||
}
|
||||
|
||||
void MediaDecoderStateMachine::SuspendTaintChanged()
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
MOZ_ASSERT(mHasSuspendTaint); // Suspend taint is only ever set.
|
||||
|
||||
CancelSuspendTimer();
|
||||
|
||||
// Resume from suspended decoding.
|
||||
if (mVideoDecodeSuspended) {
|
||||
mStateObj->HandleResumeVideoDecoding();
|
||||
}
|
||||
}
|
||||
|
||||
void MediaDecoderStateMachine::SetVideoDecodeMode(VideoDecodeMode aMode)
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> r =
|
||||
|
|
|
@ -407,9 +407,6 @@ protected:
|
|||
// Notification method invoked when mIsVisible changes.
|
||||
void VisibilityChanged();
|
||||
|
||||
// Notification method invoked when mHasSuspendTaint changes.
|
||||
void SuspendTaintChanged();
|
||||
|
||||
// Sets internal state which causes playback of media to pause.
|
||||
// The decoder monitor must be held.
|
||||
void StopPlayback();
|
||||
|
@ -754,8 +751,6 @@ private:
|
|||
// Current decoding position in the stream.
|
||||
Mirror<int64_t> mDecoderPosition;
|
||||
|
||||
// HasSuspendTaint, mirrored from the media decoder.
|
||||
Mirror<bool> mHasSuspendTaint;
|
||||
|
||||
// Duration of the media. This is guaranteed to be non-null after we finish
|
||||
// decoding the first frame.
|
||||
|
|
Загрузка…
Ссылка в новой задаче