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

Unified Diff: content/browser/download/download_stats.cc

Issue 2862743002: Add a metric to record http response code for download requests. (Closed)
Patch Set: Fix an issue for tests, some tests don't have response headers. 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 | « content/browser/download/download_stats.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index d859b2804acc79a223d6036a18adc9997698cd32..80be40f4e3e4849ac5ddbd5696f55f516f334690 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -12,6 +12,7 @@
#include "content/browser/download/download_resource_handler.h"
#include "content/public/browser/download_interrupt_reasons.h"
#include "net/http/http_content_disposition.h"
+#include "net/http/http_util.h"
namespace content {
@@ -932,4 +933,11 @@ void RecordDownloadSourcePageTransitionType(
ui::PAGE_TRANSITION_LAST_CORE + 1);
}
+void RecordDownloadHttpResponseCode(int response_code) {
+ UMA_HISTOGRAM_CUSTOM_ENUMERATION(
+ "Download.HttpResponseCode",
+ net::HttpUtil::MapStatusCodeForHistogram(response_code),
+ net::HttpUtil::GetStatusCodesForHistogram());
+}
+
} // namespace content
« no previous file with comments | « content/browser/download/download_stats.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698