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

Unified Diff: chrome/browser/ui/webui/favicon_source.cc

Issue 2535463002: [Favicon] Stop caching the default favicon (Closed)
Patch Set: Remove the unused favicon_index Created 4 years 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/ui/webui/favicon_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/favicon_source.cc
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index 8ecedfbd5dfe03c668431458efc1ae3d7bd20189..fa63fc31f74d0b8f4c90c4bfed11d4d55cb01c4b 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -178,33 +178,23 @@ void FaviconSource::SendDefaultResponse(
}
void FaviconSource::SendDefaultResponse(const IconRequest& icon_request) {
- int favicon_index;
int resource_id;
switch (icon_request.size_in_dip) {
case 64:
- favicon_index = SIZE_64;
resource_id = IDR_DEFAULT_FAVICON_64;
break;
case 32:
- favicon_index = SIZE_32;
resource_id = IDR_DEFAULT_FAVICON_32;
break;
default:
- favicon_index = SIZE_16;
resource_id = IDR_DEFAULT_FAVICON;
break;
}
+
base::RefCountedMemory* default_favicon =
- default_favicons_[favicon_index].get();
-
- if (!default_favicon) {
- ui::ScaleFactor resource_scale_factor =
- ui::GetSupportedScaleFactor(icon_request.device_scale_factor);
- default_favicon =
- ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
- resource_id, resource_scale_factor);
- default_favicons_[favicon_index] = default_favicon;
- }
+ ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
+ resource_id,
+ ui::GetSupportedScaleFactor(icon_request.device_scale_factor));
icon_request.callback.Run(default_favicon);
}
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698