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

Unified Diff: components/favicon/core/favicon_handler.cc

Issue 2808063002: Add DownloadStatus metric to FaviconHandler (Closed)
Patch Set: Rebase Created 3 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
« no previous file with comments | « components/favicon/core/favicon_handler.h ('k') | components/favicon/core/favicon_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/core/favicon_handler.cc
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc
index 99c97ab750164b5b3c381aa27be8f59b847e2b14..738fa28cd48797d373e57c5d96ccd3101ceec7b4 100644
--- a/components/favicon/core/favicon_handler.cc
+++ b/components/favicon/core/favicon_handler.cc
@@ -84,6 +84,12 @@ void RecordDownloadAttemptsForHandlerType(
NOTREACHED();
}
+void RecordDownloadOutcome(FaviconHandler::DownloadOutcome outcome) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Favicons.DownloadOutcome", outcome,
+ FaviconHandler::DownloadOutcome::DOWNLOAD_OUTCOME_COUNT);
+}
+
// Returns true if |bitmap_results| is non-empty and:
// - At least one of the bitmaps in |bitmap_results| is expired
// OR
@@ -384,11 +390,13 @@ void FaviconHandler::OnDidDownloadFavicon(
if (bitmaps.empty() && http_status_code == 404) {
DVLOG(1) << "Failed to Download Favicon:" << image_url;
+ RecordDownloadOutcome(DownloadOutcome::FAILED);
service_->UnableToDownloadFavicon(image_url);
}
bool request_next_icon = true;
if (!bitmaps.empty()) {
+ RecordDownloadOutcome(DownloadOutcome::SUCCEEDED);
float score = 0.0f;
gfx::ImageSkia image_skia;
if (download_largest_icon_) {
@@ -557,6 +565,7 @@ void FaviconHandler::ScheduleDownload(const GURL& image_url,
DCHECK(download_request_.IsCancelled()) << "More than one ongoing download";
if (service_->WasUnableToDownloadFavicon(image_url)) {
DVLOG(1) << "Skip Failed FavIcon: " << image_url;
+ RecordDownloadOutcome(DownloadOutcome::SKIPPED);
OnDidDownloadFavicon(icon_type, 0, 0, image_url, std::vector<SkBitmap>(),
std::vector<gfx::Size>());
return;
« no previous file with comments | « components/favicon/core/favicon_handler.h ('k') | components/favicon/core/favicon_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698