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

Unified Diff: components/ntp_tiles/icon_cacher_impl.cc

Issue 2725293002: Handle null callbacks in OnFaviconDownloaded (Closed)
Patch Set: Created 3 years, 10 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: components/ntp_tiles/icon_cacher_impl.cc
diff --git a/components/ntp_tiles/icon_cacher_impl.cc b/components/ntp_tiles/icon_cacher_impl.cc
index aa4e9118e50c5e67c084fa3c4de4f6db50f6784c..cd08a701f097817d0c846f0d67e74107baa3d729 100644
--- a/components/ntp_tiles/icon_cacher_impl.cc
+++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -49,7 +49,6 @@ void IconCacherImpl::StartFetch(
PopularSites::Site site,
const base::Closure& icon_available,
const base::Closure& preliminary_icon_available) {
- DCHECK(!icon_available.is_null());
favicon::GetFaviconImageForPageURL(
favicon_service_, site.url, IconType(site),
base::Bind(&IconCacherImpl::OnGetFaviconImageForPageURLFinished,
@@ -85,7 +84,9 @@ void IconCacherImpl::OnFaviconDownloaded(PopularSites::Site site,
}
SaveIconForSite(site, fetched_image);
- icon_available.Run();
+ if (!icon_available.is_null()) {
Marc Treib 2017/03/03 10:29:42 optional: I think you can just write "if (icon_ava
fhorschig 2017/03/03 10:35:26 Done.
+ icon_available.Run();
+ }
}
void IconCacherImpl::SaveIconForSite(const PopularSites::Site& site,

Powered by Google App Engine
This is Rietveld 408576698