Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2834)

Unified Diff: chrome/browser/history/history_backend.cc

Issue 10869047: Fix HistoryBackend::SetFavicons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index b34cb14a5e79b13a333725e68e4e400be6380cc9..60e191a16eed8f4f15f3379aee9f45d316a97567 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -1899,10 +1899,10 @@ void HistoryBackend::UpdateFaviconMappingAndFetchImpl(
icon_url, icon_types, &favicon.icon_type);
if (favicon_id) {
scoped_refptr<base::RefCountedMemory> data;
- favicon.known_icon = true;
Time last_updated;
if (thumbnail_db_->GetFavicon(favicon_id, &last_updated, &data,
NULL, NULL)) {
+ favicon.known_icon = true;
favicon.expired = (Time::Now() - last_updated) >
TimeDelta::FromDays(kFaviconRefetchDays);
favicon.image_data = data;
@@ -1953,15 +1953,17 @@ void HistoryBackend::SetFavicon(
FaviconID id = thumbnail_db_->GetFaviconIDForFaviconURL(
icon_url, icon_type, NULL);
- if (id)
+ if (!id) {
+ id = thumbnail_db_->AddFavicon(icon_url,
+ icon_type,
+ "0 0",
+ data,
+ Time::Now(),
+ gfx::Size());
+ } else {
thumbnail_db_->DeleteFaviconBitmapsForFavicon(id);
-
- id = thumbnail_db_->AddFavicon(icon_url,
- icon_type,
- "0 0",
- data,
- Time::Now(),
- gfx::Size());
+ thumbnail_db_->AddFaviconBitmap(id, data, Time::Now(), gfx::Size());
+ }
SetFaviconMapping(page_url, id, icon_type);
}
« no previous file with comments | « chrome/browser/history/history_backend.h ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698