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

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, 9 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 1db27226d5804981656d23369223bcb93d559b00..9f1fe25c12408dcc9185f166dabb3de8c57f1cc8 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -381,8 +381,13 @@ void FaviconHandler::OnDidDownloadFavicon(
return;
}
+ DownloadRequest download_request = i->second;
+ 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;
@@ -412,7 +417,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() &&
@@ -429,10 +435,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