Backed out changeset ff16d055e178 (bug 1302656) for w1 failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 02 Nov 2016 14:57:50 +0100
changeset 347194 9a01ef30c0dc712636626bd2ac3ee4061feb59b2
parent 347193 d607b2d92597b6c3306c8d7cac83e15c9f6bde77
child 347195 2016d6d9e3533b76cf7848dd13cc962485c363b9
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1302656
milestone52.0a1
backs outff16d055e178ae3c7400481518c515815e66b266
Backed out changeset ff16d055e178 (bug 1302656) for w1 failures
dom/html/HTMLMediaElement.cpp
dom/media/MediaDecoder.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1020,19 +1020,16 @@ void HTMLMediaElement::AbortExistingLoad
   }
 
   mEventDeliveryPaused = false;
   mPendingEvents.Clear();
 }
 
 void HTMLMediaElement::NoSupportedMediaSourceError(const nsACString& aErrorDetails)
 {
-  if (mDecoder) {
-    ShutdownDecoder();
-  }
   mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED, aErrorDetails);
   ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
   OpenUnsupportedMediaWithExtenalAppIfNeeded();
 }
 
@@ -4372,30 +4369,36 @@ void HTMLMediaElement::FirstFrameLoaded(
       mPreloadAction == HTMLMediaElement::PRELOAD_METADATA) {
     mSuspendedAfterFirstFrame = true;
     mDecoder->Suspend();
   }
 }
 
 void HTMLMediaElement::NetworkError()
 {
+  if (mDecoder) {
+    ShutdownDecoder();
+  }
   if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
     NoSupportedMediaSourceError();
   } else {
     Error(MEDIA_ERR_NETWORK);
   }
 }
 
 void HTMLMediaElement::DecodeError(const MediaResult& aError)
 {
   nsAutoString src;
   GetCurrentSrc(src);
   const char16_t* params[] = { src.get() };
   ReportLoadError("MediaLoadDecodeError", params, ArrayLength(params));
 
+  if (mDecoder) {
+    ShutdownDecoder();
+  }
   AudioTracks()->EmptyTracks();
   VideoTracks()->EmptyTracks();
   if (mIsLoadingFromSourceChildren) {
     mError = nullptr;
     if (mSourceLoadCandidate) {
       DispatchAsyncSourceError(mSourceLoadCandidate);
       QueueLoadFromSourceTask();
     } else {
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1021,24 +1021,26 @@ MediaDecoder::FirstFrameLoaded(nsAutoPtr
 }
 
 void
 MediaDecoder::NetworkError()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mOwner->NetworkError();
+  MOZ_ASSERT(IsShutdown());
 }
 
 void
 MediaDecoder::DecodeError(const MediaResult& aError)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mOwner->DecodeError(aError);
+  MOZ_ASSERT(IsShutdown());
 }
 
 void
 MediaDecoder::UpdateSameOriginStatus(bool aSameOrigin)
 {
   MOZ_ASSERT(NS_IsMainThread());
   mSameOriginMedia = aSameOrigin;
 }