Index: chrome/browser/history/history_backend.cc |
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc |
index 015991a29a2f58c8a17eef6ea2af014dbe334113..9c6de10a00e0168bbcfb2a58278350d34b179f4b 100644 |
--- a/chrome/browser/history/history_backend.cc |
+++ b/chrome/browser/history/history_backend.cc |
@@ -1704,34 +1704,32 @@ void HistoryBackend::UpdateFavIconMappingAndFetchImpl( |
if (request->canceled()) |
return; |
- bool know_favicon = false; |
- bool expired = true; |
- scoped_refptr<RefCountedBytes> data; |
+ FaviconData favicon; |
if (thumbnail_db_.get()) { |
- IconType returned_icon_type; |
const FavIconID favicon_id = |
thumbnail_db_->GetFavIconIDForFavIconURL( |
- icon_url, icon_types, &returned_icon_type); |
+ icon_url, icon_types, &favicon.icon_type); |
if (favicon_id) { |
- data = new RefCountedBytes; |
- know_favicon = true; |
+ scoped_refptr<RefCountedBytes> data = new RefCountedBytes(); |
+ favicon.known_icon = true; |
Time last_updated; |
- if (thumbnail_db_->GetFavIcon(favicon_id, &last_updated, &data->data, |
+ if (thumbnail_db_->GetFavIcon(favicon_id, &last_updated, |
+ &data->data, |
NULL)) { |
- expired = (Time::Now() - last_updated) > |
+ favicon.expired = (Time::Now() - last_updated) > |
TimeDelta::FromDays(kFavIconRefetchDays); |
+ favicon.image_data = data; |
} |
if (page_url) |
- SetFavIconMapping(*page_url, favicon_id, returned_icon_type); |
+ SetFavIconMapping(*page_url, favicon_id, favicon.icon_type); |
} |
// else case, haven't cached entry yet. Caller is responsible for |
// downloading the favicon and invoking SetFavIcon. |
} |
request->ForwardResult(GetFavIconRequest::TupleType( |
- request->handle(), know_favicon, data, expired, |
- icon_url)); |
+ request->handle(), favicon)); |
} |
void HistoryBackend::GetFavIconForURL( |
@@ -1741,26 +1739,24 @@ void HistoryBackend::GetFavIconForURL( |
if (request->canceled()) |
return; |
- bool know_favicon = false; |
- bool expired = false; |
- GURL icon_url; |
- |
- scoped_refptr<RefCountedBytes> data; |
+ FaviconData favicon; |
if (db_.get() && thumbnail_db_.get()) { |
// Time the query. |
TimeTicks beginning_time = TimeTicks::Now(); |
std::vector<IconMapping> icon_mappings; |
- data = new RefCountedBytes; |
Time last_updated; |
+ scoped_refptr<RefCountedBytes> data = new RefCountedBytes(); |
if (thumbnail_db_->GetIconMappingsForPageURL(page_url, &icon_mappings) && |
(icon_mappings.front().icon_type & icon_types) && |
thumbnail_db_->GetFavIcon(icon_mappings.front().icon_id, &last_updated, |
- &data->data, &icon_url)) { |
- know_favicon = true; |
- expired = (Time::Now() - last_updated) > |
+ &data->data, &favicon.icon_url)) { |
+ favicon.known_icon = true; |
+ favicon.expired = (Time::Now() - last_updated) > |
TimeDelta::FromDays(kFavIconRefetchDays); |
+ favicon.icon_type = icon_mappings.front().icon_type; |
+ favicon.image_data = data; |
} |
UMA_HISTOGRAM_TIMES("History.GetFavIconForURL", |
@@ -1768,8 +1764,7 @@ void HistoryBackend::GetFavIconForURL( |
} |
request->ForwardResult( |
- GetFavIconRequest::TupleType(request->handle(), know_favicon, data, |
- expired, icon_url)); |
+ GetFavIconRequest::TupleType(request->handle(), favicon)); |
} |
void HistoryBackend::SetFavIcon( |