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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 2347173002: Extend FaviconService to support fetching favicons from a Google server (Closed)
Patch Set: Peter's comments #2 Created 3 years, 10 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
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 08cacf54212abaa3b3639e655f75878563e0b986..76af7eee103274ee3ff9fd6cceb667ef5a9ab9e2 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -1532,10 +1532,13 @@ void HistoryBackend::GetLargestFaviconForURL(
if (!thumbnail_db_->GetFaviconBitmap(largest_icon.bitmap_id,
&last_updated, nullptr,
&bitmap_result.bitmap_data,
- &bitmap_result.pixel_size)) {
+ &bitmap_result.pixel_size_in_db)) {
return;
}
+ // Before the bitmap gets resized, the real size is the same as the DB size.
+ bitmap_result.pixel_size = bitmap_result.pixel_size_in_db;
+
bitmap_result.expired =
(Time::Now() - last_updated) > TimeDelta::FromDays(kFaviconRefetchDays);
if (bitmap_result.is_valid())
@@ -2072,10 +2075,13 @@ bool HistoryBackend::GetFaviconBitmapResultsForBestMatch(
bitmap_result.icon_type = icon_type;
if (!thumbnail_db_->GetFaviconBitmap(best_bitmap_ids[i], &last_updated,
nullptr, &bitmap_result.bitmap_data,
- &bitmap_result.pixel_size)) {
+ &bitmap_result.pixel_size_in_db)) {
return false;
}
+ // Before the bitmap gets resized, the real size is the same as the DB size.
+ bitmap_result.pixel_size = bitmap_result.pixel_size_in_db;
+
bitmap_result.expired =
(Time::Now() - last_updated) > TimeDelta::FromDays(kFaviconRefetchDays);
if (bitmap_result.is_valid())

Powered by Google App Engine
This is Rietveld 408576698