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

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

Issue 2828173002: [Refactor] Simplify HistoryBackend::UpdateFaviconMappingsAndFetchImpl() signature (Closed)
Patch Set: Merge branch 'master' into icon_type0 Created 3 years, 8 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/thumbnail_database.cc
diff --git a/components/history/core/browser/thumbnail_database.cc b/components/history/core/browser/thumbnail_database.cc
index d9bc22defb1f9eefac4d2f0c6154dd757ffc920a..b8838abc90cf67059151f618c39facd8402d3d6d 100644
--- a/components/history/core/browser/thumbnail_database.cc
+++ b/components/history/core/browser/thumbnail_database.cc
@@ -584,19 +584,15 @@ bool ThumbnailDatabase::SetFaviconOutOfDate(favicon_base::FaviconID icon_id) {
favicon_base::FaviconID ThumbnailDatabase::GetFaviconIDForFaviconURL(
const GURL& icon_url,
- int required_icon_type,
- favicon_base::IconType* icon_type) {
- sql::Statement statement(db_.GetCachedStatement(SQL_FROM_HERE,
- "SELECT id, icon_type FROM favicons WHERE url=? AND (icon_type & ? > 0) "
- "ORDER BY icon_type DESC"));
+ favicon_base::IconType icon_type) {
+ sql::Statement statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT id FROM favicons WHERE url=? AND icon_type=?"));
statement.BindString(0, URLDatabase::GURLToDatabaseURL(icon_url));
- statement.BindInt(1, required_icon_type);
+ statement.BindInt(1, icon_type);
if (!statement.Step())
return 0; // not cached
- if (icon_type)
- *icon_type = static_cast<favicon_base::IconType>(statement.ColumnInt(1));
return statement.ColumnInt64(0);
}

Powered by Google App Engine
This is Rietveld 408576698