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

Unified Diff: chrome/browser/safe_browsing/ping_manager.cc

Issue 2483993002: Add report_id to ErrorReporter interface. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 | « chrome/browser/safe_browsing/ping_manager.h ('k') | chrome/browser/safe_browsing/ping_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/ping_manager.cc
diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc
index f16f8181f8e66df59adc2073cd9161036a34d455..ee27b67e7800640e71b0e0b02f2f39d6bbcd89ba 100644
--- a/chrome/browser/safe_browsing/ping_manager.cc
+++ b/chrome/browser/safe_browsing/ping_manager.cc
@@ -9,6 +9,8 @@
#include "base/base64.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -67,6 +69,12 @@ std::unique_ptr<base::Value> NetLogPingEndCallback(
return std::move(event_params);
}
+// 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
namespace safe_browsing {
@@ -186,7 +194,8 @@ void SafeBrowsingPingManager::ReportThreatDetails(const std::string& report) {
void SafeBrowsingPingManager::ReportInvalidCertificateChain(
const std::string& serialized_report) {
DCHECK(certificate_error_reporter_);
- certificate_error_reporter_->SendExtendedReportingReport(serialized_report);
+ certificate_error_reporter_->SendExtendedReportingReport(
+ serialized_report, base::Closure(), base::Bind(RecordUMAOnFailure));
}
void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting(
« no previous file with comments | « chrome/browser/safe_browsing/ping_manager.h ('k') | chrome/browser/safe_browsing/ping_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698