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

Unified Diff: components/ntp_tiles/icon_cacher_impl.cc

Issue 2888393002: [Icon cacher] Add metrics for downloading favicons for NTP Tiles (Closed)
Patch Set: Robert's comments Created 3 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 | « components/ntp_tiles/icon_cacher_impl.h ('k') | components/ntp_tiles/icon_cacher_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92a7d236720d009bbd790a526bc725f66df32ef5..4c900c52354af2b7114a8449a935d9ce3a38125b 100644
--- a/components/ntp_tiles/icon_cacher_impl.cc
+++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
#include "components/favicon/core/favicon_service.h"
#include "components/favicon/core/favicon_util.h"
#include "components/favicon/core/large_icon_service.h"
@@ -135,6 +136,7 @@ void IconCacherImpl::OnPopularSitesFaviconDownloaded(
const image_fetcher::RequestMetadata& metadata) {
if (fetched_image.IsEmpty()) {
FinishRequestAndNotifyIconAvailable(site.url, /*newly_available=*/false);
+ UMA_HISTOGRAM_BOOLEAN("NewTabPage.TileFaviconFetchSuccess.Popular", false);
return;
}
@@ -145,6 +147,7 @@ void IconCacherImpl::OnPopularSitesFaviconDownloaded(
}
SaveIconForSite(site, fetched_image);
FinishRequestAndNotifyIconAvailable(site.url, /*newly_available=*/true);
+ UMA_HISTOGRAM_BOOLEAN("NewTabPage.TileFaviconFetchSuccess.Popular", true);
}
void IconCacherImpl::SaveAndNotifyDefaultIconForSite(
@@ -216,10 +219,16 @@ void IconCacherImpl::OnGetLargeIconOrFallbackStyleFinished(
large_icon_service_
->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache(
page_url, kTileIconMinSizePx, kTileIconDesiredSizePx,
- base::Bind(&IconCacherImpl::FinishRequestAndNotifyIconAvailable,
+ base::Bind(&IconCacherImpl::OnMostLikelyFaviconDownloaded,
weak_ptr_factory_.GetWeakPtr(), page_url));
}
+void IconCacherImpl::OnMostLikelyFaviconDownloaded(const GURL& request_url,
+ bool success) {
+ UMA_HISTOGRAM_BOOLEAN("NewTabPage.TileFaviconFetchSuccess.Server", success);
+ FinishRequestAndNotifyIconAvailable(request_url, success);
+}
+
bool IconCacherImpl::StartRequest(const GURL& request_url,
const base::Closure& icon_available) {
bool in_flight = in_flight_requests_.count(request_url) > 0;
« no previous file with comments | « components/ntp_tiles/icon_cacher_impl.h ('k') | components/ntp_tiles/icon_cacher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698