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

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: fix lint errors 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..0cfa26d4d99cd9ca9d9d5d0a7c6f58725aed7139 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,13 @@ void FaviconService::RunFaviconRawCallbackWithBitmapResults(
&resized_bitmap_data);
callback.Run(bitmap_result);
}
+
+void FaviconService::AddMissingFavicon(const GURL& icon_url) {
+ missing_favicon_urls_.insert(base::Hash(icon_url.spec()));
mef 2013/04/29 21:55:03 Should I somehow protect this set from multi-threa
pauljensen 2013/04/30 14:38:04 I would always tend to say yes, but I don't see an
mef 2013/04/30 21:57:03 Sounds good, will do. On 2013/04/30 14:38:04, paul
+}
+
+bool FaviconService::IsMissingFavicon(const GURL& icon_url) const {
+ int32 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