Bug 1351084 - Making the TabState.jsm collecting 'iconLoadingPrincipal' from browser.mIconLoadingPrincipal. r?mikedeboer draft
authorTim Huang <tihuang@mozilla.com>
Wed, 29 Mar 2017 10:46:01 +0800
changeset 559617 6fb64b3957087507ce06a41878e9510d57892884
parent 556622 ec8d1d3db50c85037e8077c32c8403570a5df493
child 623429 53db64aa61794d4193b2322cc7f6e097cf9df740
push id53130
push userbmo:tihuang@mozilla.com
push dateMon, 10 Apr 2017 08:47:15 +0000
reviewersmikedeboer
bugs1351084
milestone55.0a1
Bug 1351084 - Making the TabState.jsm collecting 'iconLoadingPrincipal' from browser.mIconLoadingPrincipal. r?mikedeboer 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