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

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: 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
Index: chrome/browser/favicon/favicon_service.cc
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index b762b19886e76adfb51da6044e1dc1c3cf85b05a..574663b0e1a480f0772cda29f38753742845bf06 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_proxy.h"
#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/history/history_backend.h"
@@ -353,3 +354,14 @@ void FaviconService::RunFaviconRawCallbackWithBitmapResults(
&resized_bitmap_data);
callback.Run(bitmap_result);
}
+
+void FaviconService::AddMissingFavicon(const GURL& icon_url) {
+ MissingFaviconURLHash url_hash = base::Hash(icon_url.spec());
+ missing_favicon_urls_.insert(url_hash);
+}
+
+bool FaviconService::IsMissingFavicon(const GURL& icon_url) const {
+ MissingFaviconURLHash url_hash = base::Hash(icon_url.spec());
+ return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end();
+}
+

Powered by Google App Engine
This is Rietveld 408576698