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

Unified Diff: chrome/browser/ssl/chrome_expect_ct_reporter.cc

Issue 1866203003: Add UMA metric for Expect CT failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DISALLOW_COPY_AND_ASSIGN Created 4 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 | « no previous file | chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/chrome_expect_ct_reporter.cc
diff --git a/chrome/browser/ssl/chrome_expect_ct_reporter.cc b/chrome/browser/ssl/chrome_expect_ct_reporter.cc
index 601800c93ec2edc2a66a1800887a7993f87ea302..983a2cadfd4ac03ba4bc5698cc19a546c31d8171 100644
--- a/chrome/browser/ssl/chrome_expect_ct_reporter.cc
+++ b/chrome/browser/ssl/chrome_expect_ct_reporter.cc
@@ -10,6 +10,8 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/json/json_writer.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -101,13 +103,20 @@ void AddValidSCT(const net::SignedCertificateTimestampAndStatus& sct_and_status,
list->Append(std::move(list_item));
}
+// Records an UMA histogram of the net errors when Expect CT reports
+// fails to send.
+void RecordUMAOnFailure(const GURL& report_uri, int net_error) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SSL.ExpectCTReportFailure", net_error);
+}
+
} // namespace
ChromeExpectCTReporter::ChromeExpectCTReporter(
net::URLRequestContext* request_context)
: report_sender_(new net::CertificateReportSender(
request_context,
- net::CertificateReportSender::DO_NOT_SEND_COOKIES)) {}
+ net::CertificateReportSender::DO_NOT_SEND_COOKIES,
+ base::Bind(RecordUMAOnFailure))) {}
ChromeExpectCTReporter::~ChromeExpectCTReporter() {}
« no previous file with comments | « no previous file | chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698