Bug 1317501 - Don't notify dom objects synchronously from MSG runnables in DOMMediaStream. r=padenot, a=gchang
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 29 Dec 2016 21:40:57 -0500
changeset 359208 cb96747de8e2c07860854003d32dac005514f70f
parent 359207 5875f0a845301c0eadf393c2092f32d5b3d3f58b
child 359209 0ef9b3667a0664b6496f565b567f9705e0c6e462
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, gchang
bugs1317501
milestone51.0
Bug 1317501 - Don't notify dom objects synchronously from MSG runnables in DOMMediaStream. r=padenot, a=gchang
dom/media/DOMMediaStream.cpp
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -186,17 +186,18 @@ public:
     }
 
     RefPtr<MediaStreamTrack> track =
       mStream->FindOwnedDOMTrack(aInputStream, aInputTrackID, aTrackID);
     NS_ASSERTION(track, "Owned MediaStreamTracks must be known by the DOMMediaStream");
     if (track) {
       LOG(LogLevel::Debug, ("DOMMediaStream %p MediaStreamTrack %p ended at the source. Marking it ended.",
                             mStream, track.get()));
-      track->NotifyEnded();
+      NS_DispatchToMainThread(NewRunnableMethod(
+        track, &MediaStreamTrack::NotifyEnded));
     }
   }
 
   void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID,
                                 StreamTime aTrackOffset, TrackEventCommand aTrackEvents,
                                 const MediaSegment& aQueuedMedia,
                                 MediaStream* aInputStream,
                                 TrackID aInputTrackID) override