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

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

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync up to r199996 Created 7 years, 7 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.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_service.cc
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index f32b61e3bdb5b80471a9f6c26f9f61019cdbcff0..7707f5aa5ff70c8bb98eaf14a34a1cfc9ce97fea 100644
--- a/chrome/browser/favicon/favicon_service.cc
+++ b/chrome/browser/favicon/favicon_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/favicon/favicon_service.h"
+#include "base/hash.h"
#include "base/message_loop/message_loop_proxy.h"
#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/history/history_backend.h"
@@ -259,6 +260,20 @@ void FaviconService::SetFavicons(
history_service_->SetFavicons(page_url, icon_type, favicon_bitmap_data);
}
+void FaviconService::UnableToDownloadFavicon(const GURL& icon_url) {
+ MissingFaviconURLHash url_hash = base::Hash(icon_url.spec());
+ missing_favicon_urls_.insert(url_hash);
+}
+
+bool FaviconService::WasUnableToDownloadFavicon(const GURL& icon_url) const {
+ MissingFaviconURLHash url_hash = base::Hash(icon_url.spec());
+ return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end();
+}
+
+void FaviconService::ClearUnableToDownloadFavicons() {
+ missing_favicon_urls_.clear();
+}
+
FaviconService::~FaviconService() {}
CancelableTaskTracker::TaskId FaviconService::GetFaviconForURLImpl(
@@ -353,3 +368,4 @@ void FaviconService::RunFaviconRawCallbackWithBitmapResults(
&resized_bitmap_data);
callback.Run(bitmap_result);
}
+
« no previous file with comments | « chrome/browser/favicon/favicon_service.h ('k') | chrome/browser/favicon/favicon_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698