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

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

Issue 2804283003: [LargeIconService] Report size of the downloaded favicon to UMA (Closed)
Patch Set: 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
Index: components/favicon/core/large_icon_service.cc
diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc
index e44e5c7d8e189a020004a5bed931b19259677702..616cfd056c7368fd6252e750231178c3f30975a3 100644
--- a/components/favicon/core/large_icon_service.cc
+++ b/components/favicon/core/large_icon_service.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "base/task_runner.h"
#include "base/threading/sequenced_worker_pool.h"
@@ -228,9 +229,13 @@ void OnFetchIconFromGoogleServerComplete(
favicon_service->UnableToDownloadFavicon(GURL(icon_url));
base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
base::Bind(callback, false));
+ UMA_HISTOGRAM_COUNTS_1000("Favicons.LargeIconService.DownloadedSize", 0);
return;
}
+ UMA_HISTOGRAM_COUNTS_1000("Favicons.LargeIconService.DownloadedSize",
+ image.Width());
Ilya Sherman 2017/04/07 19:26:47 nit: Histogram macros expand to a fair bit of code
jkrcal 2017/04/11 19:25:37 Done.
+
// TODO(crbug.com/699542): Extract the original icon url from the response
// headers if available and use it instead of |icon_url|. Possibly the type
// too, because using TOUCH_ICON is a hacky way that allows us to not
« no previous file with comments | « no previous file | components/favicon/core/large_icon_service_unittest.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698