Chromium Code Reviews| Index: components/history/core/browser/history_backend.cc |
| diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc |
| index 62187120cff3ae3d97a93a60b1fdcd8759dff2e5..2db1a7696a81eb9e1cb4748047ca290b2188c854 100644 |
| --- a/components/history/core/browser/history_backend.cc |
| +++ b/components/history/core/browser/history_backend.cc |
| @@ -1699,12 +1699,13 @@ void HistoryBackend::MergeFavicon( |
| ScheduleCommit(); |
| } |
| -void HistoryBackend::SetFavicons(const GURL& page_url, |
| - favicon_base::IconType icon_type, |
| - const GURL& icon_url, |
| - const std::vector<SkBitmap>& bitmaps) { |
| +favicon_base::FaviconID HistoryBackend::SetFavicons( |
| + const GURL& page_url, |
| + favicon_base::IconType icon_type, |
| + const GURL& icon_url, |
| + const std::vector<SkBitmap>& bitmaps) { |
| if (!thumbnail_db_ || !db_) |
| - return; |
| + return favicon_base::FaviconID(0); |
| DCHECK_GE(kMaxFaviconBitmapsPerIconURL, bitmaps.size()); |
| @@ -1735,6 +1736,23 @@ void HistoryBackend::SetFavicons(const GURL& page_url, |
| SendFaviconChangedNotificationForIconURL(icon_url); |
| } |
| ScheduleCommit(); |
| + return icon_id; |
| +} |
| + |
| +void HistoryBackend::SetExpiredFaviconsIfNoneKnown( |
|
pkotwicz
2017/03/08 05:38:16
You should add a test testing that this method doe
mastiz
2017/03/08 16:37:33
Will do, I'll add the tests once the rest looks OK
|
| + const GURL& page_url, |
| + favicon_base::IconType icon_type, |
| + const GURL& icon_url, |
| + const std::vector<SkBitmap>& bitmaps) { |
| + if (!thumbnail_db_ || !db_) |
| + return; |
| + |
|
pkotwicz
2017/03/03 22:33:25
Given that |page_url| is currently a substring of
pkotwicz
2017/03/08 05:38:16
Ping on this comment
mastiz
2017/03/08 16:37:33
I think it's rather hacky to make such assumption
pkotwicz
2017/03/09 02:25:57
The sync code uses |page_url| if |icon_url| is mis
mastiz
2017/03/15 16:58:10
The server-side guys have implemented including th
pkotwicz
2017/03/16 00:50:45
In this case, this function should check that ther
mastiz
2017/03/21 12:09:17
This change has landed in the form of a dedicated
|
| + if (!thumbnail_db_->GetIconMappingsForPageURL(page_url, |
| + /*mapping_data*/ nullptr)) { |
| + favicon_base::FaviconID icon_id = |
| + SetFavicons(page_url, icon_type, icon_url, bitmaps); |
| + thumbnail_db_->SetFaviconOutOfDate(icon_id); |
|
pkotwicz
2017/03/03 22:33:25
Don't you need to run ScheduleCommit()?
The Sched
mastiz
2017/03/08 16:37:33
Done, added the redundant ScheduleCommit() for cla
|
| + } |
| } |
| void HistoryBackend::SetFaviconsOutOfDateForPage(const GURL& page_url) { |