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

Unified Diff: chrome/browser/favicon/favicon_handler.cc

Issue 934693002: Reload favicon from HTTP cache on Ctrl+Refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_handler.cc
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc
index a1bbe173e233fe2a84ef2239ba01678f1c2f9afc..1eb5889de146a12ca7f095488af64c706d27a6f8 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -384,8 +384,13 @@ void FaviconHandler::OnDidDownloadFavicon(
return;
}
+ DownloadRequest download_request = i->second;
pkotwicz 2015/02/19 21:29:57 I switched to erasing |download_requests_| immedia
+ download_requests_.erase(i);
+
if (current_candidate() &&
- DoUrlAndIconMatch(*current_candidate(), image_url, i->second.icon_type)) {
+ DoUrlAndIconMatch(*current_candidate(),
+ image_url,
+ download_request.icon_type)) {
bool request_next_icon = true;
float score = 0.0f;
gfx::ImageSkia image_skia;
@@ -415,7 +420,8 @@ void FaviconHandler::OnDidDownloadFavicon(
// during the downloading.
if (!bitmaps.empty()) {
request_next_icon = !UpdateFaviconCandidate(
- i->second.url, image_url, image, score, i->second.icon_type);
+ download_request.url, image_url, image, score,
+ download_request.icon_type);
}
}
if (request_next_icon && !PageChangedSinceFaviconWasRequested() &&
@@ -432,10 +438,10 @@ void FaviconHandler::OnDidDownloadFavicon(
best_favicon_candidate_.icon_type);
// Reset candidate.
image_urls_.clear();
+ download_requests_.clear();
best_favicon_candidate_ = FaviconCandidate();
}
}
- download_requests_.erase(i);
}
bool FaviconHandler::PageChangedSinceFaviconWasRequested() {
« no previous file with comments | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698