зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1393369. P1 - virtualize MediaDecoder::GetCurrentPrincipal() so the sub-classes know how to calculate the current principal. r=gerald
MozReview-Commit-ID: EOUtPE4hfgO --HG-- extra : rebase_source : d15166e373fdd3a8490e2c794215aeb2551a7397 extra : source : 5f627ea709d24c8b7c5ddd0115524ef734378e66
This commit is contained in:
Родитель
0dc15e318d
Коммит
59d7107e86
|
@ -487,6 +487,13 @@ ChannelMediaDecoder::ShouldThrottleDownload()
|
|||
return stats.mDownloadRate > factor * stats.mPlaybackRate;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal>
|
||||
ChannelMediaDecoder::GetCurrentPrincipal()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mResource ? mResource->GetCurrentPrincipal() : nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
ChannelMediaDecoder::IsTransportSeekable()
|
||||
{
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
bool aIsPrivateBrowsing,
|
||||
nsIStreamListener** aStreamListener);
|
||||
|
||||
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
|
||||
bool IsTransportSeekable() override;
|
||||
void SetLoadInBackground(bool aLoadInBackground) override;
|
||||
void Suspend() override;
|
||||
|
|
|
@ -700,15 +700,6 @@ MediaDecoder::GetCurrentTime()
|
|||
return mLogicalPosition;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal>
|
||||
MediaDecoder::GetCurrentPrincipal()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MediaResource* r = GetResource();
|
||||
AbstractThread::AutoEnter context(AbstractMainThread());
|
||||
return r ? r->GetCurrentPrincipal() : nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
MediaDecoder::OnMetadataUpdate(TimedMetadata&& aMetadata)
|
||||
{
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
void NetworkError();
|
||||
|
||||
// Return the principal of the current URI being played or downloaded.
|
||||
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal();
|
||||
virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() = 0;
|
||||
|
||||
// Return the time position in the video stream being
|
||||
// played measured in seconds.
|
||||
|
|
|
@ -92,6 +92,13 @@ HLSDecoder::Load(nsIChannel* aChannel)
|
|||
return InitializeStateMachine();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal>
|
||||
HLSDecoder::GetCurrentPrincipal()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mResource ? mResource->GetCurrentPrincipal() : nullptr;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HLSDecoder::Play()
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
|
||||
void Pause() override;
|
||||
|
||||
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
|
||||
bool IsTransportSeekable() override { return true; }
|
||||
void Suspend() override;
|
||||
void Resume() override;
|
||||
|
|
|
@ -362,6 +362,13 @@ MediaSourceDecoder::NotifyInitDataArrived()
|
|||
}
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal>
|
||||
MediaSourceDecoder::GetCurrentPrincipal()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mResource ? mResource->GetCurrentPrincipal() : nullptr;
|
||||
}
|
||||
|
||||
#undef MSE_DEBUG
|
||||
#undef MSE_DEBUGV
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ public:
|
|||
return mDemuxer;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override;
|
||||
|
||||
bool IsTransportSeekable() override { return true; }
|
||||
|
||||
// Returns a string describing the state of the MediaSource internal
|
||||
|
|
Загрузка…
Ссылка в новой задаче