Bug 741010 - Don't save favicon if loaded from DB. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Mon, 02 Apr 2012 17:36:13 -0700
changeset 94194 5f02ed27742455fc7e06c6d63ea3939e6446c718
parent 94193 6642b531a08a0fe1be118b316c22aadf475452ce
child 94195 aca7aac62fa6647916a7c9f2ea55dd2866193c3e
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs741010
milestone14.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 741010 - Don't save favicon if loaded from DB. r=mfinkle
mobile/android/base/Favicons.java
--- a/mobile/android/base/Favicons.java
+++ b/mobile/android/base/Favicons.java
@@ -335,28 +335,24 @@ public class Favicons {
             Log.d(LOGTAG, "Favicon URL is now: " + mFaviconUrl);
 
             if (isCancelled())
                 return null;
 
             String storedFaviconUrl = mDbHelper.getFaviconUrlForPageUrl(mPageUrl);
             if (storedFaviconUrl != null && storedFaviconUrl.equals(mFaviconUrl)) {
                 image = loadFaviconFromDb();
-
-                if (isCancelled())
-                    return null;
+                if (image != null)
+                    return image;
+            }
 
-                // If favicon URL is defined but the favicon image is not
-                // stored in the database for some reason, we force download.
-                if (image == null) {
-                    image = downloadFavicon(faviconUrl);
-                }
-            } else {
-                image = downloadFavicon(faviconUrl);
-            }
+            if (isCancelled())
+                return null;
+
+            image = downloadFavicon(faviconUrl);
 
             if (image != null) {
                 Log.d(LOGTAG, "Downloaded favicon successfully for URL = " + mPageUrl);
                 saveFaviconToDb(image);
             }
 
             return image;
         }