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

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

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed codereview comments, fixed crash in Incognito mode. Created 7 years, 8 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_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_tab_helper.cc
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index 768e950c9c49e1377436549f26eee8530ec9dd0a..17e4f4a6e2a31fc6990ba25e1e72d1da9baab41d 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -135,6 +135,13 @@ NavigationEntry* FaviconTabHelper::GetActiveEntry() {
}
int FaviconTabHelper::StartDownload(const GURL& url, int image_size) {
+ FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
+ profile_->GetOriginalProfile(), Profile::IMPLICIT_ACCESS);
+ if (favicon_service && favicon_service->IsMissingFavicon(url)) {
+ VLOG(1) << "Skip Missing FavIcon: " << url;
+ return 0;
+ }
+
return web_contents()->DownloadImage(
url,
true,
@@ -182,6 +189,15 @@ void FaviconTabHelper::DidDownloadFavicon(
const GURL& image_url,
int requested_size,
const std::vector<SkBitmap>& bitmaps) {
+
+ if (bitmaps.size() == 0) {
sky 2013/05/01 14:00:07 Under what circumstances should we be doing this?
mef 2013/05/01 15:20:15 My (possibly incorrect) understanding is that bitm
+ VLOG(1) << "Missing Favicon:" << image_url;
+ FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
+ profile_->GetOriginalProfile(), Profile::IMPLICIT_ACCESS);
+ if (favicon_service)
+ favicon_service->AddMissingFavicon(image_url);
+ }
+
favicon_handler_->OnDidDownloadFavicon(
id, image_url, requested_size, bitmaps);
if (touch_icon_handler_.get()) {
« no previous file with comments | « chrome/browser/favicon/favicon_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698