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

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

Issue 1180403005: Use URL without fragment when query recent redirect list for favicons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d04c038d5bef7fd7c6d97a6bd878e7288a5b94ef..f18b2bac8a6df3ceebf080404d0dc6b74d928758 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -2083,8 +2083,16 @@ bool HistoryBackend::SetFaviconMappingsForPageAndRedirects(
// Find all the pages whose favicons we should set, we want to set it for
// all the pages in the redirect chain if it redirected.
- RedirectList redirects;
+ RedirectList redirects, extra_redirects;
GetCachedRecentRedirects(page_url, &redirects);
sky 2015/06/16 22:06:23 If the ref isn't useful when querying for redirect
beaudoin 2015/06/17 16:51:27 Acknowledged.
+ if (page_url.has_ref()) {
+ // Refs often gets added by Javascript, but the redirect chain is keyed to
+ // the URL without a ref.
+ GURL::Replacements replacements;
+ replacements.ClearRef();
+ GURL page_url_without_ref = page_url.ReplaceComponents(replacements);
+ GetCachedRecentRedirects(page_url_without_ref, &extra_redirects);
+ }
bool mappings_changed = false;
@@ -2093,6 +2101,10 @@ bool HistoryBackend::SetFaviconMappingsForPageAndRedirects(
++i) {
mappings_changed |= SetFaviconMappingsForPage(*i, icon_type, icon_ids);
}
+ for (RedirectList::const_iterator i(extra_redirects.begin());
sky 2015/06/17 16:07:30 This is the part I dislike about the current patch
beaudoin 2015/06/17 16:51:27 Done.
+ i != extra_redirects.end(); ++i) {
+ mappings_changed |= SetFaviconMappingsForPage(*i, icon_type, icon_ids);
+ }
return mappings_changed;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698