Bug 1547757 - Use a RefPtr to hold owner element ref when moving media resource load to background. r=cpearce
authorBryce Van Dyk <bvandyk@mozilla.com>
Thu, 16 May 2019 07:01:02 +0000
changeset 474648 c4781d18e0f5d7f276c91a809db4cfc831c7a24d
parent 474647 4a3fcb8ad12cd7db72b7c805e4b07534760c95b4
child 474649 3166a00a4f13f0bca069681a382c0e8af814eb3f
push id36042
push userdvarga@mozilla.com
push dateTue, 21 May 2019 04:19:40 +0000
treeherdermozilla-central@ca560ff55451 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1547757
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547757 - Use a RefPtr to hold owner element ref when moving media resource load to background. r=cpearce Differential Revision: https://phabricator.services.mozilla.com/D31019
dom/media/BaseMediaResource.cpp
--- a/dom/media/BaseMediaResource.cpp
+++ b/dom/media/BaseMediaResource.cpp
@@ -109,17 +109,17 @@ void BaseMediaResource::SetLoadInBackgro
     return;
   }
 
   MediaDecoderOwner* owner = mCallback->GetMediaOwner();
   if (!owner) {
     NS_WARNING("Null owner in MediaResource::SetLoadInBackground()");
     return;
   }
-  dom::HTMLMediaElement* element = owner->GetMediaElement();
+  RefPtr<dom::HTMLMediaElement> element = owner->GetMediaElement();
   if (!element) {
     NS_WARNING("Null element in MediaResource::SetLoadInBackground()");
     return;
   }
 
   bool isPending = false;
   if (NS_SUCCEEDED(mChannel->IsPending(&isPending)) && isPending) {
     nsLoadFlags loadFlags;