Bug 1302632: P4. Do not change network state to NETWORK_EMPTY. r=jwwang
☠☠ backed out by 3172114c06cd ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 15 Sep 2016 16:20:43 +1000
changeset 355440 55e7962d4fc010a42610ada8806bc566b7e51c4e
parent 355439 b20f7c887e6c2525e7fabfeb63dd996f0cd7f163
child 355441 f2ced742d6aada6565d91170c32d3bb579b54387
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1302632
milestone51.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 1302632: P4. Do not change network state to NETWORK_EMPTY. r=jwwang There's no such step defined in the spec. Despite, this code can no longer be called when readyState is HAVE_NOTHING MozReview-Commit-ID: 2fDoNHt1COp
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -4464,32 +4464,29 @@ void HTMLMediaElement::LoadAborted()
 
 void HTMLMediaElement::Error(uint16_t aErrorCode,
                              const nsACString& aErrorDetails)
 {
   NS_ASSERTION(aErrorCode == MEDIA_ERR_DECODE ||
                aErrorCode == MEDIA_ERR_NETWORK ||
                aErrorCode == MEDIA_ERR_ABORTED,
                "Only use MediaError codes!");
+  NS_ASSERTION(mReadyState > HAVE_NOTHING,
+               "Shouldn't be called when readyState is HAVE_NOTHING");
 
   // Since we have multiple paths calling into DecodeError, e.g.
   // MediaKeys::Terminated and EMEH264Decoder::Error. We should take the 1st
   // one only in order not to fire multiple 'error' events.
   if (mError) {
     return;
   }
   mError = new MediaError(this, aErrorCode, aErrorDetails);
 
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
-  if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
-    ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY);
-    DispatchAsyncEvent(NS_LITERAL_STRING("emptied"));
-  } else {
-    ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
-  }
+  ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_IDLE);
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
 }
 
 void HTMLMediaElement::PlaybackEnded()
 {
   // We changed state which can affect AddRemoveSelfReference
   AddRemoveSelfReference();