Backed out changeset 7eb8b5723256 (bug 943515) for mass Android test bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 14 Jan 2014 15:38:15 -0500
changeset 163312 6e825843f9d9f902196950af1de356314190c7e7
parent 163311 2783ed7e977dd04ca31c767023bd9f3fa47fbb4f
child 163378 4e671e3183c4b691ef39360345fa193c8fa3e361
child 163505 5005c496410e2e58487cd96eb27abc9338862f89
push idunknown
push userunknown
push dateunknown
bugs943515
milestone29.0a1
backs out7eb8b5723256e60c228e16177e8cb253e802f27f
Backed out changeset 7eb8b5723256 (bug 943515) for mass Android test bustage.
mobile/android/base/GeckoApp.java
mobile/android/base/db/BrowserProvider.java
mobile/android/base/favicons/Favicons.java
mobile/android/base/favicons/LoadFaviconTask.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -494,17 +494,17 @@ public abstract class GeckoApp
         outState.putBoolean(SAVED_STATE_IN_BACKGROUND, isApplicationInBackground());
         outState.putString(SAVED_STATE_PRIVATE_SESSION, mPrivateBrowsingSession);
     }
 
     void handleFaviconRequest(final String url) {
         (new UiAsyncTask<Void, Void, String>(ThreadUtils.getBackgroundHandler()) {
             @Override
             public String doInBackground(Void... params) {
-                return Favicons.getFaviconURLForPageURL(url);
+                return Favicons.getFaviconUrlForPageUrl(url);
             }
 
             @Override
             public void onPostExecute(String faviconUrl) {
                 JSONObject args = new JSONObject();
 
                 if (faviconUrl != null) {
                     try {
--- a/mobile/android/base/db/BrowserProvider.java
+++ b/mobile/android/base/db/BrowserProvider.java
@@ -2970,17 +2970,17 @@ public class BrowserProvider extends Con
         // Extract the page URL from the ContentValues
         if (values.containsKey(Favicons.PAGE_URL)) {
             pageUrl = values.getAsString(Favicons.PAGE_URL);
             values.remove(Favicons.PAGE_URL);
         }
 
         // If no URL is provided, insert using the default one.
         if (TextUtils.isEmpty(faviconUrl) && !TextUtils.isEmpty(pageUrl)) {
-            values.put(Favicons.URL, org.mozilla.gecko.favicons.Favicons.guessDefaultFaviconURL(pageUrl));
+            values.put(Favicons.URL, org.mozilla.gecko.favicons.Favicons.guessDefaultFaviconUrl(pageUrl));
         }
 
         long now = System.currentTimeMillis();
         values.put(Favicons.DATE_CREATED, now);
         values.put(Favicons.DATE_MODIFIED, now);
         faviconId = db.insertOrThrow(TABLE_FAVICONS, null, values);
 
         if (pageUrl != null) {
--- a/mobile/android/base/favicons/Favicons.java
+++ b/mobile/android/base/favicons/Favicons.java
@@ -60,25 +60,25 @@ public class Favicons {
     public static int sDefaultFaviconSize;
 
     private static final Map<Integer, LoadFaviconTask> sLoadTasks = Collections.synchronizedMap(new HashMap<Integer, LoadFaviconTask>());
 
     // Cache to hold mappings between page URLs and Favicon URLs. Used to avoid going to the DB when
     // doing so is not necessary.
     private static final NonEvictingLruCache<String, String> sPageURLMappings = new NonEvictingLruCache<String, String>(NUM_PAGE_URL_MAPPINGS_TO_STORE);
 
-    public static String getFaviconURLForPageURLFromCache(String pageURL) {
+    public static String getFaviconUrlForPageUrlFromCache(String pageURL) {
         return sPageURLMappings.get(pageURL);
     }
 
     /**
      * Insert the given pageUrl->faviconUrl mapping into the memory cache of such mappings.
      * Useful for short-circuiting local database access.
      */
-    public static void putFaviconURLForPageURLInCache(String pageURL, String faviconURL) {
+    public static void putFaviconUrlForPageUrlInCache(String pageURL, String faviconURL) {
         sPageURLMappings.put(pageURL, faviconURL);
     }
 
     private static FaviconCache sFaviconsCache;
 
     /**
      * Returns either NOT_LOADING, or LOADED if the onFaviconLoaded call could
      * be made on the main thread.
@@ -138,17 +138,17 @@ public class Favicons {
         // Do we know the favicon URL for this page already?
         String cacheURL = faviconURL;
         if (cacheURL == null) {
             cacheURL = sPageURLMappings.get(pageURL);
         }
 
         // If there's no favicon URL given, try and hit the cache with the default one.
         if (cacheURL == null)  {
-            cacheURL = guessDefaultFaviconURL(pageURL);
+            cacheURL = guessDefaultFaviconUrl(pageURL);
         }
 
         // If it's something we can't even figure out a default URL for, just give up.
         if (cacheURL == null) {
             return dispatchResult(pageURL, null, sDefaultFavicon, listener);
         }
 
         Bitmap cachedIcon = getSizedFaviconFromCache(cacheURL, targetSize);
@@ -226,32 +226,32 @@ public class Favicons {
     /**
      * Helper method to determine the URL of the Favicon image for a given page URL by querying the
      * history database. Should only be called from the background thread - does database access.
      *
      * @param pageURL The URL of a webpage with a Favicon.
      * @return The URL of the Favicon used by that webpage, according to either the History database
      *         or a somewhat educated guess.
      */
-    public static String getFaviconURLForPageURL(String pageURL) {
+    public static String getFaviconUrlForPageUrl(String pageURL) {
         // Attempt to determine the Favicon URL from the Tabs datastructure. Can dodge having to use
         // the database sometimes by doing this.
         String targetURL;
         Tab theTab = Tabs.getInstance().getTabForUrl(pageURL);
         if (theTab != null) {
             targetURL = theTab.getFaviconURL();
             if (targetURL != null) {
                 return targetURL;
             }
         }
 
         targetURL = BrowserDB.getFaviconUrlForHistoryUrl(sContext.getContentResolver(), pageURL);
         if (targetURL == null) {
             // Nothing in the history database. Fall back to the default URL and hope for the best.
-            targetURL = guessDefaultFaviconURL(pageURL);
+            targetURL = guessDefaultFaviconUrl(pageURL);
         }
         return targetURL;
     }
 
     /**
      * Helper function to create an async job to load a Favicon which does not exist in the memcache.
      * Contains logic to prevent the repeated loading of Favicons which have previously failed.
      * There is no support for recovery from transient failures.
@@ -402,17 +402,17 @@ public class Favicons {
     }
 
     /**
      * Helper method to get the default Favicon URL for a given pageURL. Generally: somewhere.com/favicon.ico
      *
      * @param pageURL Page URL for which a default Favicon URL is requested
      * @return The default Favicon URL.
      */
-    public static String guessDefaultFaviconURL(String pageURL) {
+    public static String guessDefaultFaviconUrl(String pageURL) {
         // Special-casing for about: pages. The favicon for about:pages which don't provide a link tag
         // is bundled in the database, keyed only by page URL, hence the need to return the page URL
         // here. If the database ever migrates to stop being silly in this way, this can plausibly
         // be removed.
         if (AboutPages.isAboutPage(pageURL) || pageURL.startsWith("jar:")) {
             return pageURL;
         }
 
--- a/mobile/android/base/favicons/LoadFaviconTask.java
+++ b/mobile/android/base/favicons/LoadFaviconTask.java
@@ -83,17 +83,17 @@ public class LoadFaviconTask extends UiA
         mFaviconUrl = faviconUrl;
         mListener = aListener;
         mFlags = flags;
         mTargetWidth = targetSize;
         mOnlyFromLocal = fromLocal;
     }
 
     // Runs in background thread
-    private Bitmap loadFaviconFromDB() {
+    private Bitmap loadFaviconFromDb() {
         ContentResolver resolver = sContext.getContentResolver();
         return BrowserDB.getFaviconForFaviconUrl(resolver, mFaviconUrl);
     }
 
     // Runs in background thread
     private void saveFaviconToDb(final Bitmap favicon) {
         if ((mFlags & FLAG_PERSIST) == 0) {
             return;
@@ -235,33 +235,33 @@ public class LoadFaviconTask extends UiA
 
         String storedFaviconUrl;
         boolean isUsingDefaultURL = false;
 
         // Handle the case of malformed favicon URL.
         // If favicon is empty, fall back to the stored one.
         if (TextUtils.isEmpty(mFaviconUrl)) {
             // Try to get the favicon URL from the memory cache.
-            storedFaviconUrl = Favicons.getFaviconURLForPageURLFromCache(mPageUrl);
+            storedFaviconUrl = Favicons.getFaviconUrlForPageUrlFromCache(mPageUrl);
 
             // If that failed, try to get the URL from the database.
             if (storedFaviconUrl == null) {
-                storedFaviconUrl = Favicons.getFaviconURLForPageURL(mPageUrl);
+                storedFaviconUrl = Favicons.getFaviconUrlForPageUrl(mPageUrl);
                 if (storedFaviconUrl != null) {
                     // If that succeeded, cache the URL loaded from the database in memory.
-                    Favicons.putFaviconURLForPageURLInCache(mPageUrl, storedFaviconUrl);
+                    Favicons.putFaviconUrlForPageUrlInCache(mPageUrl, storedFaviconUrl);
                 }
             }
 
             // If we found a faviconURL - use it.
             if (storedFaviconUrl != null) {
                 mFaviconUrl = storedFaviconUrl;
             } else {
                 // If we don't have a stored one, fall back to the default.
-                mFaviconUrl = Favicons.guessDefaultFaviconURL(mPageUrl);
+                mFaviconUrl = Favicons.guessDefaultFaviconUrl(mPageUrl);
 
                 if (TextUtils.isEmpty(mFaviconUrl)) {
                     return null;
                 }
                 isUsingDefaultURL = true;
             }
         }
 
@@ -294,17 +294,17 @@ public class LoadFaviconTask extends UiA
             // chain onto the same parent task.
             loadsInFlight.put(mFaviconUrl, this);
         }
 
         if (isCancelled()) {
             return null;
         }
 
-        image = loadFaviconFromDB();
+        image = loadFaviconFromDb();
         if (imageIsValid(image)) {
             return image;
         }
 
         if (mOnlyFromLocal || isCancelled()) {
             return null;
         }
 
@@ -330,17 +330,17 @@ public class LoadFaviconTask extends UiA
         }
 
         if (isUsingDefaultURL) {
             Favicons.putFaviconInFailedCache(mFaviconUrl);
             return null;
         }
 
         // If we're not already trying the default URL, try it now.
-        final String guessed = Favicons.guessDefaultFaviconURL(mPageUrl);
+        final String guessed = Favicons.guessDefaultFaviconUrl(mPageUrl);
         if (guessed == null) {
             Favicons.putFaviconInFailedCache(mFaviconUrl);
             return null;
         }
 
         image = fetchJARFavicon(guessed);
         if (imageIsValid(image)) {
             // We don't want to put this into the DB.