Chromium Code Reviews| 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; |
| } |