Bug 1290364 - clear mOwner in Shutdown(). r=cpearce

MozReview-Commit-ID: 2CsYKcSrEOJ

--HG--
extra : rebase_source : 3fd60ea1dbbf57c168fa8cebb9bb5594ee8c19fb
This commit is contained in:
JW Wang 2016-07-29 14:44:22 +08:00
Родитель ae2e808431
Коммит 8ce157e06f
2 изменённых файлов: 7 добавлений и 6 удалений

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

@ -162,7 +162,7 @@ MediaDecoderOwner*
MediaDecoder::ResourceCallback::GetMediaOwner() const
{
MOZ_ASSERT(NS_IsMainThread());
return mDecoder ? mDecoder->GetOwner() : nullptr;
return mDecoder ? mDecoder->mOwner : nullptr;
}
void
@ -571,7 +571,7 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
"MediaDecoder::mMediaSeekable (Canonical)")
, mMediaSeekableOnlyInBufferedRanges(AbstractThread::MainThread(), false,
"MediaDecoder::mMediaSeekableOnlyInBufferedRanges (Canonical)")
, mIsVisible(AbstractThread::MainThread(), !mOwner->IsHidden(),
, mIsVisible(AbstractThread::MainThread(), !aOwner->IsHidden(),
"MediaDecoder::mIsVisible (Canonical)")
, mTelemetryReported(false)
{
@ -667,6 +667,7 @@ MediaDecoder::Shutdown()
CancelDormantTimer();
ChangeState(PLAY_STATE_SHUTDOWN);
mOwner = nullptr;
}
MediaDecoder::~MediaDecoder()
@ -1857,7 +1858,7 @@ MediaDecoder::GetOwner() const
{
MOZ_ASSERT(NS_IsMainThread());
// mOwner is valid until shutdown.
return !IsShutdown() ? mOwner : nullptr;
return mOwner;
}
void

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

@ -673,9 +673,9 @@ protected:
void OnMetadataUpdate(TimedMetadata&& aMetadata);
// This should only ever be accessed from the main thread.
// It is set in Init and cleared in Shutdown when the element goes away.
// The decoder does not add a reference the element.
MediaDecoderOwner* const mOwner;
// It is set in the constructor and cleared in Shutdown when the element goes
// away. The decoder does not add a reference the element.
MediaDecoderOwner* mOwner;
// Counters related to decode and presentation of frames.
const RefPtr<FrameStatistics> mFrameStats;