Bug 943515 - Part 2: Url -> URL in Favicon method names. r=rnewman

This commit is contained in:
Michael Comella 2014-01-14 10:28:30 -08:00
Родитель b1e00a80a2
Коммит 0ab461f70f
4 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -499,7 +499,7 @@ public abstract class GeckoApp
(new UiAsyncTask<Void, Void, String>(ThreadUtils.getBackgroundHandler()) { (new UiAsyncTask<Void, Void, String>(ThreadUtils.getBackgroundHandler()) {
@Override @Override
public String doInBackground(Void... params) { public String doInBackground(Void... params) {
return Favicons.getFaviconUrlForPageUrl(url); return Favicons.getFaviconURLForPageURL(url);
} }
@Override @Override

Просмотреть файл

@ -2975,7 +2975,7 @@ public class BrowserProvider extends ContentProvider {
// If no URL is provided, insert using the default one. // If no URL is provided, insert using the default one.
if (TextUtils.isEmpty(faviconUrl) && !TextUtils.isEmpty(pageUrl)) { 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(); long now = System.currentTimeMillis();

Просмотреть файл

@ -65,7 +65,7 @@ public class Favicons {
// doing so is not necessary. // doing so is not necessary.
private static final NonEvictingLruCache<String, String> sPageURLMappings = new NonEvictingLruCache<String, String>(NUM_PAGE_URL_MAPPINGS_TO_STORE); 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); return sPageURLMappings.get(pageURL);
} }
@ -73,7 +73,7 @@ public class Favicons {
* Insert the given pageUrl->faviconUrl mapping into the memory cache of such mappings. * Insert the given pageUrl->faviconUrl mapping into the memory cache of such mappings.
* Useful for short-circuiting local database access. * 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); sPageURLMappings.put(pageURL, faviconURL);
} }
@ -143,7 +143,7 @@ public class Favicons {
// If there's no favicon URL given, try and hit the cache with the default one. // If there's no favicon URL given, try and hit the cache with the default one.
if (cacheURL == null) { 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 it's something we can't even figure out a default URL for, just give up.
@ -231,7 +231,7 @@ public class Favicons {
* @return The URL of the Favicon used by that webpage, according to either the History database * @return The URL of the Favicon used by that webpage, according to either the History database
* or a somewhat educated guess. * 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 // Attempt to determine the Favicon URL from the Tabs datastructure. Can dodge having to use
// the database sometimes by doing this. // the database sometimes by doing this.
String targetURL; String targetURL;
@ -246,7 +246,7 @@ public class Favicons {
targetURL = BrowserDB.getFaviconUrlForHistoryUrl(sContext.getContentResolver(), pageURL); targetURL = BrowserDB.getFaviconUrlForHistoryUrl(sContext.getContentResolver(), pageURL);
if (targetURL == null) { if (targetURL == null) {
// Nothing in the history database. Fall back to the default URL and hope for the best. // Nothing in the history database. Fall back to the default URL and hope for the best.
targetURL = guessDefaultFaviconUrl(pageURL); targetURL = guessDefaultFaviconURL(pageURL);
} }
return targetURL; return targetURL;
} }
@ -407,7 +407,7 @@ public class Favicons {
* @param pageURL Page URL for which a default Favicon URL is requested * @param pageURL Page URL for which a default Favicon URL is requested
* @return The default Favicon URL. * @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 // 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 // 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 // here. If the database ever migrates to stop being silly in this way, this can plausibly

Просмотреть файл

@ -88,7 +88,7 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
} }
// Runs in background thread // Runs in background thread
private Bitmap loadFaviconFromDb() { private Bitmap loadFaviconFromDB() {
ContentResolver resolver = sContext.getContentResolver(); ContentResolver resolver = sContext.getContentResolver();
return BrowserDB.getFaviconForFaviconUrl(resolver, mFaviconUrl); return BrowserDB.getFaviconForFaviconUrl(resolver, mFaviconUrl);
} }
@ -240,14 +240,14 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
// If favicon is empty, fall back to the stored one. // If favicon is empty, fall back to the stored one.
if (TextUtils.isEmpty(mFaviconUrl)) { if (TextUtils.isEmpty(mFaviconUrl)) {
// Try to get the favicon URL from the memory cache. // 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 that failed, try to get the URL from the database.
if (storedFaviconUrl == null) { if (storedFaviconUrl == null) {
storedFaviconUrl = Favicons.getFaviconUrlForPageUrl(mPageUrl); storedFaviconUrl = Favicons.getFaviconURLForPageURL(mPageUrl);
if (storedFaviconUrl != null) { if (storedFaviconUrl != null) {
// If that succeeded, cache the URL loaded from the database in memory. // If that succeeded, cache the URL loaded from the database in memory.
Favicons.putFaviconUrlForPageUrlInCache(mPageUrl, storedFaviconUrl); Favicons.putFaviconURLForPageURLInCache(mPageUrl, storedFaviconUrl);
} }
} }
@ -256,7 +256,7 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
mFaviconUrl = storedFaviconUrl; mFaviconUrl = storedFaviconUrl;
} else { } else {
// If we don't have a stored one, fall back to the default. // 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)) { if (TextUtils.isEmpty(mFaviconUrl)) {
return null; return null;
@ -299,7 +299,7 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
return null; return null;
} }
image = loadFaviconFromDb(); image = loadFaviconFromDB();
if (imageIsValid(image)) { if (imageIsValid(image)) {
return image; return image;
} }
@ -335,7 +335,7 @@ public class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
} }
// If we're not already trying the default URL, try it now. // 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) { if (guessed == null) {
Favicons.putFaviconInFailedCache(mFaviconUrl); Favicons.putFaviconInFailedCache(mFaviconUrl);
return null; return null;