Bug 1290028 - Remove the check for IsShutdown() from MediaDecoder::OwnerHasError(). r=gerald

MozReview-Commit-ID: Cg5UoFngxFr

--HG--
extra : rebase_source : afece4f66454cf7b2c68ede4b5802fc445be96fa
This commit is contained in:
JW Wang 2016-07-28 17:21:09 +08:00
Родитель 64c1909e96
Коммит 32c54a1d7b
5 изменённых файлов: 8 добавлений и 7 удалений

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

@ -86,7 +86,7 @@ public:
// Returns the owner of this decoder or null when the decoder is shutting
// down. The owner should only be used on the main thread.
virtual MediaDecoderOwner* GetOwner() = 0;
virtual MediaDecoderOwner* GetOwner() const = 0;
// Set by Reader if the current audio track can be offloaded
virtual void SetPlatformCanOffloadAudio(bool aCanOffloadAudio) {}

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

@ -1064,7 +1064,8 @@ bool
MediaDecoder::OwnerHasError() const
{
MOZ_ASSERT(NS_IsMainThread());
return IsShutdown() || mOwner->HasError();
MOZ_ASSERT(!IsShutdown());
return mOwner->HasError();
}
class MediaElementGMPCrashHelper : public GMPCrashHelper
@ -1831,7 +1832,7 @@ MediaMemoryTracker::CollectReports(nsIHandleReportCallback* aHandleReport,
}
MediaDecoderOwner*
MediaDecoder::GetOwner()
MediaDecoder::GetOwner() const
{
MOZ_ASSERT(NS_IsMainThread());
// mOwner is valid until shutdown.

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

@ -239,7 +239,7 @@ public:
bool IsEndedOrShutdown() const;
// Return true if the MediaDecoderOwner's error attribute is not null.
// If the MediaDecoder is shutting down, OwnerHasError will return true.
// Must be called before Shutdown().
bool OwnerHasError() const;
already_AddRefed<GMPCrashHelper> GetCrashHelper() override;
@ -434,7 +434,7 @@ private:
// Indicate whether the media is same-origin with the element.
void UpdateSameOriginStatus(bool aSameOrigin);
MediaDecoderOwner* GetOwner() override;
MediaDecoderOwner* GetOwner() const override;
#ifdef MOZ_EME
typedef MozPromise<RefPtr<CDMProxy>, bool /* aIgnored */, /* IsExclusive = */ true> CDMProxyPromise;

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

@ -62,7 +62,7 @@ BufferDecoder::GetImageContainer()
}
MediaDecoderOwner*
BufferDecoder::GetOwner()
BufferDecoder::GetOwner() const
{
// unknown
return nullptr;

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

@ -38,7 +38,7 @@ public:
VideoFrameContainer* GetVideoFrameContainer() final override;
layers::ImageContainer* GetImageContainer() final override;
MediaDecoderOwner* GetOwner() final override;
MediaDecoderOwner* GetOwner() const final override;
already_AddRefed<GMPCrashHelper> GetCrashHelper() override;