| 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;
|
|
|