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

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

Issue 2891333002: Introduce dedicated enum value for icons from Web Manifests (Closed)
Patch Set: Put browsertest behind #if. Created 3 years, 7 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 9c24373f52b4a13f1cdf56c6819052d7168809e2..bb21144ebac05b66290d4fb0da88d18b8de1ad8b 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -2117,9 +2117,12 @@ bool HistoryBackend::SetFaviconMappingsForPage(
DCHECK_LE(icon_ids.size(), kMaxFaviconsPerPage);
bool mappings_changed = false;
- // Two icon types are considered 'equivalent' if one of the icon types is
- // TOUCH_ICON and the other is TOUCH_PRECOMPOSED_ICON.
- //
+ // Two icon types are considered 'equivalent' if both types are one of
+ // TOUCH_ICON, TOUCH_PRECOMPOSED_ICON or WEB_MANIFEST_ICON.
+ const int equivalent_types = favicon_base::TOUCH_ICON |
+ favicon_base::TOUCH_PRECOMPOSED_ICON |
+ favicon_base::WEB_MANIFEST_ICON;
+
// Sets the icon mappings from |page_url| for |icon_type| to the favicons
// with |icon_ids|. Mappings for |page_url| to favicons of type |icon_type|
// whose FaviconID is not in |icon_ids| are removed. All icon mappings for
@@ -2143,11 +2146,8 @@ bool HistoryBackend::SetFaviconMappingsForPage(
continue;
}
- if ((icon_type == favicon_base::TOUCH_ICON &&
- m->icon_type == favicon_base::TOUCH_PRECOMPOSED_ICON) ||
- (icon_type == favicon_base::TOUCH_PRECOMPOSED_ICON &&
- m->icon_type == favicon_base::TOUCH_ICON) ||
- (icon_type == m->icon_type)) {
+ if (icon_type == m->icon_type || ((icon_type & equivalent_types) != 0 &&
+ (m->icon_type & equivalent_types) != 0)) {
thumbnail_db_->DeleteIconMapping(m->mapping_id);
// Removing the icon mapping may have orphaned the associated favicon so
« no previous file with comments | « components/favicon_base/favicon_types.h ('k') | components/history/core/browser/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698