Bug 1277854 - Post: add comment explaining local loading r?sebastian
MozReview-Commit-ID: J8eJrzkExeX
--- a/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java
+++ b/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java
@@ -301,18 +301,20 @@ public class Favicons {
final Bitmap result = getSizedFaviconFromCache(targetURL, targetSize);
if (result != null) {
// Victory - immediate response!
return dispatchResult(pageURL, targetURL, result, callback);
}
}
// No joy using in-memory resources. Go to background thread and ask the database.
+ // Note: this is a near duplicate of loadUncachedFavicon, however loadUncachedFavicon
+ // can download favicons, whereas we want to restrict ourselves to the cache.
final LoadFaviconTask task =
- new LoadFaviconTask(context, pageURL, targetURL, 0, callback, targetSize, true);
+ new LoadFaviconTask(context, pageURL, targetURL, 0, callback, targetSize, /* onlyFromLocal: */ true);
final int taskId = task.getId();
synchronized (loadTasks) {
loadTasks.put(taskId, task);
}
task.execute();
return taskId;
}