Bug 1351084 - Making the TabState.jsm collecting 'iconLoadingPrincipal' from browser.mIconLoadingPrincipal. r=mikedeboer, a=jcristau
authorTim Huang <tihuang@mozilla.com>
Wed, 29 Mar 2017 10:46:01 +0800
changeset 396181 6b6f2961e253b88e4222c3c17d8a92db8e01937f
parent 396180 f37ddc924762327b494af4b15ef62103ce6f0f8b
child 396182 5b3b3ab6875c50797bd8670b7e6db9b446d74629
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, jcristau
bugs1351084
milestone54.0
Bug 1351084 - Making the TabState.jsm collecting 'iconLoadingPrincipal' from browser.mIconLoadingPrincipal. r=mikedeboer, a=jcristau The browser.contentPrincpal will report a null prinicpal instead of the actual content principal if the tab is not loaded. So the SessionStore will collect a wrong principal for the 'iconLoadingPrincipal', and it will use this wrong principal to load favicon when session restoring. To fix this problem, this patch makes the TabState.jsm to collect 'iconLoadingPrincipal' from browser.mIconLoadingPrincipal which will be the correct principal for loading favicon. MozReview-Commit-ID: AYUbHFKaG8v
browser/components/sessionstore/TabState.jsm
--- a/browser/components/sessionstore/TabState.jsm
+++ b/browser/components/sessionstore/TabState.jsm
@@ -121,17 +121,17 @@ var TabStateInternal = {
     // Store the tab icon.
     if (!("image" in tabData)) {
       let tabbrowser = tab.ownerGlobal.gBrowser;
       tabData.image = tabbrowser.getIcon(tab);
     }
 
     // Store the serialized contentPrincipal of this tab to use for the icon.
     if (!("iconLoadingPrincipal" in tabData)) {
-      tabData.iconLoadingPrincipal = Utils.serializePrincipal(browser.contentPrincipal);
+      tabData.iconLoadingPrincipal = Utils.serializePrincipal(browser.mIconLoadingPrincipal);
     }
 
     // If there is a userTypedValue set, then either the user has typed something
     // in the URL bar, or a new tab was opened with a URI to load.
     // If so, we also track whether we were still in the process of loading something.
     if (!("userTypedValue" in tabData) && browser.userTypedValue) {
       tabData.userTypedValue = browser.userTypedValue;
       // We always used to keep track of the loading state as an integer, where