Bug 1214065 - Remove unused arguments from MediaDecoder::Load() and its friends. r=kinetik.

This commit is contained in:
JW Wang 2015-10-14 11:46:27 +08:00
Родитель b5df6bcbac
Коммит 1cc6677a90
8 изменённых файлов: 18 добавлений и 24 удалений

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

@ -1277,7 +1277,7 @@ nsresult HTMLMediaElement::LoadResource()
if (IsAutoplayEnabled()) {
mJoinLatency.Start();
}
return FinishDecoderSetup(decoder, resource, nullptr, nullptr);
return FinishDecoderSetup(decoder, resource, nullptr);
}
// determine what security checks need to be performed in AsyncOpen2().
@ -2777,7 +2777,7 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
return NS_ERROR_FAILURE;
}
return FinishDecoderSetup(decoder, resource, nullptr, aOriginal);
return FinishDecoderSetup(decoder, resource, nullptr);
}
nsresult HTMLMediaElement::InitializeDecoderForChannel(nsIChannel* aChannel,
@ -2821,14 +2821,13 @@ nsresult HTMLMediaElement::InitializeDecoderForChannel(nsIChannel* aChannel,
}
return NS_OK;
} else {
return FinishDecoderSetup(decoder, resource, aListener, nullptr);
return FinishDecoderSetup(decoder, resource, aListener);
}
}
nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
MediaResource* aStream,
nsIStreamListener** aListener,
MediaDecoder* aCloneDonor)
nsIStreamListener** aListener)
{
ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_LOADING);
@ -2858,7 +2857,7 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
// can affect how we feed data to MediaStreams
NotifyDecoderPrincipalChanged();
nsresult rv = aDecoder->Load(aListener, aCloneDonor);
nsresult rv = aDecoder->Load(aListener);
if (NS_FAILED(rv)) {
ShutdownDecoder();
LOG(LogLevel::Debug, ("%p Failed to load for decoder %p", this, aDecoder));

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

@ -651,7 +651,7 @@ public:
* A public wrapper for FinishDecoderSetup()
*/
nsresult FinishDecoderSetup(MediaDecoder* aDecoder, MediaResource* aStream) {
return FinishDecoderSetup(aDecoder, aStream, nullptr, nullptr);
return FinishDecoderSetup(aDecoder, aStream, nullptr);
}
// Returns true if the media element is being destroyed. Used in
@ -811,8 +811,7 @@ protected:
*/
nsresult FinishDecoderSetup(MediaDecoder* aDecoder,
MediaResource* aStream,
nsIStreamListener **aListener,
MediaDecoder* aCloneDonor);
nsIStreamListener **aListener);
/**
* Call this after setting up mLoadingSrc and mDecoder.

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

@ -509,8 +509,7 @@ MediaDecoder::OpenResource(nsIStreamListener** aStreamListener)
}
nsresult
MediaDecoder::Load(nsIStreamListener** aStreamListener,
MediaDecoder* aCloneDonor)
MediaDecoder::Load(nsIStreamListener** aStreamListener)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mResource, "Can't load without a MediaResource");
@ -521,18 +520,16 @@ MediaDecoder::Load(nsIStreamListener** aStreamListener,
SetStateMachine(CreateStateMachine());
NS_ENSURE_TRUE(GetStateMachine(), NS_ERROR_FAILURE);
return InitializeStateMachine(aCloneDonor);
return InitializeStateMachine();
}
nsresult
MediaDecoder::InitializeStateMachine(MediaDecoder* aCloneDonor)
MediaDecoder::InitializeStateMachine()
{
MOZ_ASSERT(NS_IsMainThread());
NS_ASSERTION(mDecoderStateMachine, "Cannot initialize null state machine!");
MediaDecoder* cloneDonor = static_cast<MediaDecoder*>(aCloneDonor);
nsresult rv = mDecoderStateMachine->Init(
cloneDonor ? cloneDonor->mDecoderStateMachine.get() : nullptr);
nsresult rv = mDecoderStateMachine->Init();
NS_ENSURE_SUCCESS(rv, rv);
// If some parameters got set before the state machine got created,

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

@ -323,8 +323,7 @@ public:
// Start downloading the media. Decode the downloaded data up to the
// point of the first frame of data.
// This is called at most once per decoder, after Init().
virtual nsresult Load(nsIStreamListener** aListener,
MediaDecoder* aCloneDonor);
virtual nsresult Load(nsIStreamListener** aListener);
// Called in |Load| to open mResource.
nsresult OpenResource(nsIStreamListener** aStreamListener);
@ -363,7 +362,7 @@ public:
virtual nsresult Seek(double aTime, SeekTarget::Type aSeekType);
// Initialize state machine and schedule it.
nsresult InitializeStateMachine(MediaDecoder* aCloneDonor);
nsresult InitializeStateMachine();
// Start playback of a video. 'Load' must have previously been
// called.

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

@ -1030,7 +1030,7 @@ bool MediaDecoderStateMachine::IsPlaying() const
return mMediaSink->IsPlaying();
}
nsresult MediaDecoderStateMachine::Init(MediaDecoderStateMachine* aCloneDonor)
nsresult MediaDecoderStateMachine::Init()
{
MOZ_ASSERT(NS_IsMainThread());
nsresult rv = mReader->Init();

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

@ -134,7 +134,7 @@ public:
MediaDecoderReader* aReader,
bool aRealTime = false);
nsresult Init(MediaDecoderStateMachine* aCloneDonor);
nsresult Init();
// Enumeration for the valid decoding states
enum State {

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

@ -51,7 +51,7 @@ MediaSourceDecoder::CreateStateMachine()
}
nsresult
MediaSourceDecoder::Load(nsIStreamListener**, MediaDecoder*)
MediaSourceDecoder::Load(nsIStreamListener**)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!GetStateMachine());
@ -61,7 +61,7 @@ MediaSourceDecoder::Load(nsIStreamListener**, MediaDecoder*)
return NS_ERROR_FAILURE;
}
nsresult rv = GetStateMachine()->Init(nullptr);
nsresult rv = GetStateMachine()->Init();
NS_ENSURE_SUCCESS(rv, rv);
SetStateMachineParameters();

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

@ -38,7 +38,7 @@ public:
virtual MediaDecoder* Clone() override;
virtual MediaDecoderStateMachine* CreateStateMachine() override;
virtual nsresult Load(nsIStreamListener**, MediaDecoder*) override;
virtual nsresult Load(nsIStreamListener**) override;
virtual media::TimeIntervals GetSeekable() override;
media::TimeIntervals GetBuffered() override;