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

Unified Diff: components/certificate_reporting/error_reporter.cc

Issue 2120683002: Fix up certificate error reporting histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused ios certificate_reporting dependency Created 4 years, 5 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/certificate_reporting/DEPS ('k') | components/certificate_reporting/error_reporter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/certificate_reporting/error_reporter.cc
diff --git a/components/certificate_reporting/error_reporter.cc b/components/certificate_reporting/error_reporter.cc
index 2765747b0d45fe1dc52395db6557dd3c5a5f374a..6015dcf0e68458bad0278e4fbf105eecf1762f0a 100644
--- a/components/certificate_reporting/error_reporter.cc
+++ b/components/certificate_reporting/error_reporter.cc
@@ -11,6 +11,8 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/metrics/sparse_histogram.h"
#include "components/certificate_reporting/encrypted_cert_logger.pb.h"
#include "crypto/aead.h"
#include "crypto/curve25519.h"
@@ -98,18 +100,25 @@ bool EncryptSerializedReport(const uint8_t* server_public_key,
return true;
}
+// Records an UMA histogram of the net errors when certificate reports
+// fail to send.
+void RecordUMAOnFailure(const GURL& report_uri, int net_error) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SSL.CertificateErrorReportFailure", -net_error);
+}
+
} // namespace
ErrorReporter::ErrorReporter(
net::URLRequestContext* request_context,
const GURL& upload_url,
net::ReportSender::CookiesPreference cookies_preference)
- : ErrorReporter(
- upload_url,
- kServerPublicKey,
- kServerPublicKeyVersion,
- base::WrapUnique(
- new net::ReportSender(request_context, cookies_preference))) {}
+ : ErrorReporter(upload_url,
+ kServerPublicKey,
+ kServerPublicKeyVersion,
+ base::WrapUnique(new net::ReportSender(
+ request_context,
+ cookies_preference,
+ base::Bind(RecordUMAOnFailure)))) {}
ErrorReporter::ErrorReporter(
const GURL& upload_url,
« no previous file with comments | « components/certificate_reporting/DEPS ('k') | components/certificate_reporting/error_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698