Bug 840989 - Don't store favicons for error pages. r=bnicholson
authorWes Johnston <wjohnston@mozilla.com>
Mon, 19 Aug 2013 16:57:21 -0700
changeset 143198 fbe6ff42af1ae1da369dd3d6a54c3c05a0b13036
parent 143197 1a9597b9fd1986941cb1223e4cf49deb2b445130
child 143199 00d59f610bc4ca1eed0978f513704bdedbe47d32
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbnicholson
bugs840989
milestone26.0a1
Bug 840989 - Don't store favicons for error pages. r=bnicholson
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1286,17 +1286,17 @@ abstract public class BrowserApp extends
         outState.putBoolean(STATE_DYNAMIC_TOOLBAR_ENABLED, mDynamicToolbarEnabled);
         outState.putInt(STATE_ABOUT_HOME_TOP_PADDING, mAboutHome.getTopPadding());
     }
 
     /* Favicon methods */
     private void loadFavicon(final Tab tab) {
         maybeCancelFaviconLoad(tab);
 
-        int flags = Favicons.FLAG_SCALE | (tab.isPrivate() ? 0 : Favicons.FLAG_PERSIST);
+        int flags = Favicons.FLAG_SCALE | ( (tab.isPrivate() || tab.getErrorType() != Tab.ErrorType.NONE) ? 0 : Favicons.FLAG_PERSIST);
         long id = Favicons.getInstance().loadFavicon(tab.getURL(), tab.getFaviconURL(), flags,
                         new Favicons.OnFaviconLoadedListener() {
 
             @Override
             public void onFaviconLoaded(String pageUrl, Bitmap favicon) {
                 // Leave favicon UI untouched if we failed to load the image
                 // for some reason.
                 if (favicon == null)