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

Unified Diff: content/browser/download/download_request_core.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 | « no previous file | content/browser/download/download_stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_request_core.cc
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc
index 3cb2e649f34a52cace510580394c4d3cdb314b57..b30984bd52ad40c1776451ce961344c903206d33 100644
--- a/content/browser/download/download_request_core.cc
+++ b/content/browser/download/download_request_core.cc
@@ -253,6 +253,11 @@ bool DownloadRequestCore::OnResponseStarted(
save_info_.get())
: DOWNLOAD_INTERRUPT_REASON_NONE;
+ if (request()->response_headers()) {
+ RecordDownloadHttpResponseCode(
+ request()->response_headers()->response_code());
+ }
+
std::unique_ptr<DownloadCreateInfo> create_info =
CreateDownloadCreateInfo(result);
if (result != DOWNLOAD_INTERRUPT_REASON_NONE) {
« no previous file with comments | « no previous file | content/browser/download/download_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698