Bug 1344357 P3 - dont' pass dom::Promise into MediaDecoder anymore; r=jwwang

MozReview-Commit-ID: 5RUNauRRajP

--HG--
extra : rebase_source : 4c12d5cd730657da37b2c94987e84518c2c67ae5
This commit is contained in:
Kaku Kuo 2017-04-17 18:49:55 +08:00
Родитель 707fc9d61a
Коммит 36ef069505
3 изменённых файлов: 6 добавлений и 10 удалений

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

@ -2724,7 +2724,7 @@ HTMLMediaElement::Seek(double aTime,
// The media backend is responsible for dispatching the timeupdate
// event if it changes the playback position as a result of the seek.
LOG(LogLevel::Debug, ("%p SetCurrentTime(%f) starting seek", this, aTime));
nsresult rv = mDecoder->Seek(aTime, aSeekType, promise);
nsresult rv = mDecoder->Seek(aTime, aSeekType);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return nullptr;

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

@ -27,7 +27,6 @@
#include "mozilla/dom/AudioTrack.h"
#include "mozilla/dom/AudioTrackList.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/VideoTrack.h"
#include "mozilla/dom/VideoTrackList.h"
#include "nsPrintfCString.h"
@ -720,8 +719,7 @@ MediaDecoder::Play()
}
nsresult
MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType,
dom::Promise* aPromise /*=nullptr*/)
MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
@ -734,7 +732,7 @@ MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType,
mLogicallySeeking = true;
SeekTarget target = SeekTarget(timeUsecs, aSeekType);
CallSeek(target, aPromise);
CallSeek(target);
if (mPlayState == PLAY_STATE_ENDED) {
PinForSeek();
@ -752,7 +750,7 @@ MediaDecoder::DiscardOngoingSeekIfExists()
}
void
MediaDecoder::CallSeek(const SeekTarget& aTarget, dom::Promise* aPromise)
MediaDecoder::CallSeek(const SeekTarget& aTarget)
{
MOZ_ASSERT(NS_IsMainThread());
DiscardOngoingSeekIfExists();

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

@ -41,7 +41,6 @@ class nsIPrincipal;
namespace mozilla {
namespace dom {
class Promise;
class HTMLMediaElement;
}
@ -179,8 +178,7 @@ public:
// Seek to the time position in (seconds) from the start of the video.
// If aDoFastSeek is true, we'll seek to the sync point/keyframe preceeding
// the seek target.
virtual nsresult Seek(double aTime, SeekTarget::Type aSeekType,
dom::Promise* aPromise = nullptr);
virtual nsresult Seek(double aTime, SeekTarget::Type aSeekType);
// Initialize state machine and schedule it.
nsresult InitializeStateMachine();
@ -642,7 +640,7 @@ private:
protected:
void DiscardOngoingSeekIfExists();
virtual void CallSeek(const SeekTarget& aTarget, dom::Promise* aPromise);
virtual void CallSeek(const SeekTarget& aTarget);
MozPromiseRequestHolder<SeekPromise> mSeekRequest;