Bug 1289976. Part 6 - Remove the IsShutdown() check from MediaDecoder::RemoveMediaTracks(). r=kaku
authorJW Wang <jwwang@mozilla.com>
Wed, 27 Jul 2016 10:44:43 +0800
changeset 333326 88bb8e3f4749692ddf751752d64896062f4e18d7
parent 333325 912087c585eec035de36d7e4a2184f06d1091cfd
child 333327 7ec72a79735d1632da9e6ff0f11566652e0d4ef2
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1289976
milestone51.0a1
Bug 1289976. Part 6 - Remove the IsShutdown() check from MediaDecoder::RemoveMediaTracks(). r=kaku 1. It is called from ChangeState() when IsEnded() is true. 2. It is called from OnMetadataUpdate(). The callback is disconnected in Shutdown(). MozReview-Commit-ID: 8m4jtcl91hT
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1889,20 +1889,17 @@ MediaDecoder::ConstructMediaTracks()
     track->SetEnabledInternal(info.mEnabled, MediaTrack::FIRE_NO_EVENTS);
   }
 }
 
 void
 MediaDecoder::RemoveMediaTracks()
 {
   MOZ_ASSERT(NS_IsMainThread());
-
-  if (IsShutdown()) {
-    return;
-  }
+  MOZ_ASSERT(!IsShutdown());
 
   HTMLMediaElement* element = mOwner->GetMediaElement();
   if (!element) {
     return;
   }
 
   AudioTrackList* audioList = element->AudioTracks();
   if (audioList) {