mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1326294 - this is a debugging patch which checks if mOwner points to a valid media element object. r=gerald
MozReview-Commit-ID: HRUigVOLdx --HG-- extra : rebase_source : d44b4315a34b60c1d1a6ba98730a938ed375a937
This commit is contained in:
parent
a6ebb1c134
commit
8c79a1d34c
@ -416,6 +416,8 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
|
||||
, INIT_CANONICAL(mDecoderPosition, 0)
|
||||
, INIT_CANONICAL(mIsVisible, !aOwner->IsHidden())
|
||||
, mTelemetryReported(false)
|
||||
, mIsMediaElement(!!aOwner->GetMediaElement())
|
||||
, mElement(aOwner->GetMediaElement())
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MediaMemoryTracker::AddMediaDecoder(this);
|
||||
@ -1650,6 +1652,8 @@ MediaDecoderOwner*
|
||||
MediaDecoder::GetOwner() const
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// Check object lifetime when mOwner points to a media element.
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mOwner || !mIsMediaElement || mElement);
|
||||
// mOwner is valid until shutdown.
|
||||
return mOwner;
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ namespace mozilla {
|
||||
|
||||
namespace dom {
|
||||
class Promise;
|
||||
class HTMLMediaElement;
|
||||
}
|
||||
|
||||
class VideoFrameContainer;
|
||||
@ -845,6 +846,10 @@ private:
|
||||
void NotifyDownloadEnded(nsresult aStatus);
|
||||
|
||||
bool mTelemetryReported;
|
||||
|
||||
// Used to debug how mOwner becomes a dangling pointer in bug 1326294.
|
||||
bool mIsMediaElement;
|
||||
WeakPtr<dom::HTMLMediaElement> mElement;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user