Bug 1431674 - Backed out changeset 3e22200b7e83. r=backout
authorChris Pearce <cpearce@mozilla.com>
Wed, 07 Feb 2018 15:28:07 +1300
changeset 457687 c900339ffe3d6242f7c516d68d12e42634ce4134
parent 457686 d1043ecc316e5cb616e58521e2d36d4729108704
child 457688 aab04cb5b8151abfb04b5c4bba0d05b587c187b5
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1431674, 1324883
milestone60.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 1431674 - Backed out changeset 3e22200b7e83. r=backout The changes in bug 1324883 regressed YouTube, so back them out. The changes in bug 1324883 were trying to cause the media cache to be cleared on tab close and on CTRL+F5 reload (i.e. a bypass cache-reload) but they are causing problems on YouTube, which doesn't use the media cache and instead uses MSE. MozReview-Commit-ID: Hx2cehZ2wm1
dom/html/HTMLMediaElement.cpp
dom/html/HTMLMediaElement.h
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3838,36 +3838,32 @@ HTMLMediaElement::AddMediaElementToURITa
   }
   MediaElementSetForURI* entry = gElementTable->PutEntry(mLoadingSrc);
   entry->mElements.AppendElement(this);
   NS_ASSERTION(MediaElementTableCount(this, mLoadingSrc) == 1,
     "Should have a single entry for element in element table after addition");
 }
 
 void
-HTMLMediaElement::RemoveMediaElementFromURITable(bool aFroceClearEntry)
+HTMLMediaElement::RemoveMediaElementFromURITable()
 {
   if (!mDecoder || !mLoadingSrc || !gElementTable) {
     return;
   }
   MediaElementSetForURI* entry = gElementTable->GetEntry(mLoadingSrc);
   if (!entry) {
     return;
   }
-  if (aFroceClearEntry) {
+  entry->mElements.RemoveElement(this);
+  if (entry->mElements.IsEmpty()) {
     gElementTable->RemoveEntry(entry);
-  } else {
-    entry->mElements.RemoveElement(this);
-    if (entry->mElements.IsEmpty()) {
-      gElementTable->RemoveEntry(entry);
-    }
-  }
-  if (gElementTable->Count() == 0) {
-    delete gElementTable;
-    gElementTable = nullptr;
+    if (gElementTable->Count() == 0) {
+      delete gElementTable;
+      gElementTable = nullptr;
+    }
   }
   NS_ASSERTION(MediaElementTableCount(this, mLoadingSrc) == 0,
     "After remove, should no longer have an entry in element table");
 }
 
 HTMLMediaElement*
 HTMLMediaElement::LookupMediaElementURITable(nsIURI* aURI)
 {
@@ -3986,17 +3982,16 @@ public:
     if ((aProgressStateFlags & STATE_IS_NETWORK) &&
         (aProgressStateFlags & STATE_START)) {
       // Query the LoadType to see if it's a ctrl+F5.
       nsCOMPtr<nsIDocShell> shell(do_QueryInterface(aWebProgress));
       if (shell) {
         uint32_t loadType;
         shell->GetLoadType(&loadType);
         if (LOAD_RELOAD_BYPASS_PROXY_AND_CACHE == loadType && mWeak->mDecoder) {
-          mWeak->RemoveMediaElementFromURITable(true);
           mWeak->ShutdownDecoder();
         }
       }
     }
     return NS_OK;
   }
 
   NS_IMETHODIMP
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -985,17 +985,17 @@ protected:
 
   /**
    * Call this after setting up mLoadingSrc and mDecoder.
    */
   void AddMediaElementToURITable();
   /**
    * Call this before modifying mLoadingSrc.
    */
-  void RemoveMediaElementFromURITable(bool aFroceClearEntry = false);
+  void RemoveMediaElementFromURITable();
   /**
    * Call this to find a media element with the same NodePrincipal and mLoadingSrc
    * set to aURI, and with a decoder on which Load() has been called.
    */
   HTMLMediaElement* LookupMediaElementURITable(nsIURI* aURI);
 
   /**
    * Shutdown and clear mDecoder and maintain associated invariants.