Bug 1284399. Part 3 - remove SeekTask::Exists(). r=kaku
MozReview-Commit-ID: EECDBv1DR88
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1161,23 +1161,23 @@ MediaDecoderStateMachine::SetDormant(boo
mPendingDormant.reset();
DECODER_LOG("SetDormant=%d", aDormant);
if (aDormant) {
if (mState == DECODER_STATE_SEEKING) {
if (mQueuedSeek.Exists()) {
// Keep latest seek target
- } else if (mSeekTask && mSeekTask->Exists()) {
+ } else if (mCurrentSeek.Exists()) {
// Because both audio and video decoders are going to be reset in this
// method later, we treat a VideoOnly seek task as a normal Accurate
// seek task so that while it is resumed, both audio and video playback
// are handled.
- if (mSeekTask->GetSeekTarget().IsVideoOnly()) {
- mSeekTask->GetSeekTarget().SetType(SeekTarget::Accurate);
+ if (mCurrentSeek.mTarget.IsVideoOnly()) {
+ mCurrentSeek.mTarget.SetType(SeekTarget::Accurate);
}
mQueuedSeek = Move(mCurrentSeek);
mSeekTaskRequest.DisconnectIfExists();
} else {
mQueuedSeek.mTarget = SeekTarget(mCurrentPosition,
SeekTarget::Accurate,
MediaDecoderEventVisibility::Suppressed);
// XXXbholley - Nobody is listening to this promise. Do we need to pass it
--- a/dom/media/SeekTask.cpp
+++ b/dom/media/SeekTask.cpp
@@ -79,20 +79,9 @@ SeekTask::OwnerThread() const
SeekTarget&
SeekTask::GetSeekTarget()
{
AssertOwnerThread();
return mTarget;
}
-bool
-SeekTask::Exists() const
-{
- AssertOwnerThread();
-
- // mSeekTaskPromise communicates SeekTask and MDSM;
- // mSeekJob communicates MDSM and MediaDecoder;
- // Either one exists means the current seek task has yet finished.
- return !mSeekTaskPromise.IsEmpty() || mSeekJob.Exists();
-}
-
} // namespace mozilla
--- a/dom/media/SeekTask.h
+++ b/dom/media/SeekTask.h
@@ -53,18 +53,16 @@ public:
virtual void Discard() = 0;
virtual RefPtr<SeekTaskPromise> Seek(const media::TimeUnit& aDuration) = 0;
virtual bool NeedToResetMDSM() const = 0;
SeekTarget& GetSeekTarget();
- bool Exists() const;
-
protected:
SeekTask(const void* aDecoderID,
AbstractThread* aThread,
MediaDecoderReaderWrapper* aReader,
SeekJob& aSeekJob);
virtual ~SeekTask();