Bug 1547757 - Use a RefPtr to hold owner element ref when moving media resource load to background. r=cpearce a=jcristau
authorBryce Van Dyk <bvandyk@mozilla.com>
Thu, 16 May 2019 07:01:02 +0000
changeset 536386 326fdc435656a1f34b13591b038017eed68814fb
parent 536385 678ee917771f5ea2e50aa25b642288e7a9d53922
child 536387 9dde17473fe326ce31bd3113dfe2f53943111f7a
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, jcristau
bugs1547757
milestone68.0
Bug 1547757 - Use a RefPtr to hold owner element ref when moving media resource load to background. r=cpearce a=jcristau 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;