Index: components/history/core/browser/history_backend.h |
diff --git a/components/history/core/browser/history_backend.h b/components/history/core/browser/history_backend.h |
index cae7870a63f0ed4dc51923139d3f644189b59479..85c5fb83f058117c0ea134ba0deda426f395e4bb 100644 |
--- a/components/history/core/browser/history_backend.h |
+++ b/components/history/core/browser/history_backend.h |
@@ -326,13 +326,15 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, |
const GURL& icon_url, |
const std::vector<SkBitmap>& bitmaps); |
- bool SetLastResortFavicons(const GURL& page_url, |
- favicon_base::IconType icon_type, |
- const GURL& icon_url, |
- const std::vector<SkBitmap>& bitmaps); |
+ bool SetOnDemandFavicons(const GURL& page_url, |
+ favicon_base::IconType icon_type, |
+ const GURL& icon_url, |
+ const std::vector<SkBitmap>& bitmaps); |
void SetFaviconsOutOfDateForPage(const GURL& page_url); |
+ void TouchOnDemandFavicon(const GURL& icon_url); |
+ |
void SetImportedFavicons( |
const favicon_base::FaviconUsageDataList& favicon_usage); |
@@ -528,11 +530,9 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, |
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsReplaceBitmapData); |
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
SetFaviconsSameFaviconURLForTwoPages); |
- FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetLastResortFaviconsForEmptyDB); |
- FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
- SetLastResortFaviconsForPageInDB); |
- FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
- SetLastResortFaviconsForIconInDB); |
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetOnDemandFaviconsForEmptyDB); |
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetOnDemandFaviconsForPageInDB); |
+ FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetOnDemandFaviconsForIconInDB); |
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
UpdateFaviconMappingsAndFetchNoChange); |
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLNotInDB); |
@@ -686,7 +686,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, |
favicon_base::IconType icon_type, |
const GURL& icon_url, |
const std::vector<SkBitmap>& bitmaps, |
- bool bitmaps_are_expired); |
+ FaviconBitmapType type); |
// Used by both UpdateFaviconMappingsAndFetch() and GetFavicon(). |
// If |page_url| is non-null and there is a favicon stored in the database |
@@ -699,16 +699,19 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, |
const std::vector<int>& desired_sizes, |
std::vector<favicon_base::FaviconRawBitmapResult>* results); |
- // Set the favicon bitmaps for |icon_id|. |
+ // Set the favicon bitmaps of |type| for |icon_id|. |
// For each entry in |bitmaps|, if a favicon bitmap already exists at the |
// entry's pixel size, replace the favicon bitmap's data with the entry's |
// bitmap data. Otherwise add a new favicon bitmap. |
// Any favicon bitmaps already mapped to |icon_id| whose pixel size does not |
// match the pixel size of one of |bitmaps| is deleted. |
+ // For bitmap type FaviconBitmapType::ON_DEMAND, this is legal to call only |
+ // for a newly created |icon_id| (that has no bitmaps yet). |
// Returns true if any of the bitmap data at |icon_id| is changed as a result |
// of calling this method. |
bool SetFaviconBitmaps(favicon_base::FaviconID icon_id, |
- const std::vector<SkBitmap>& bitmaps); |
+ const std::vector<SkBitmap>& bitmaps, |
+ FaviconBitmapType type); |
// Returns true if the bitmap data at |bitmap_id| equals |new_bitmap_data|. |
bool IsFaviconBitmapDataEqual( |