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

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

Issue 2543523002: Implement main CertificateReportingService code and add unit tests. (Closed)
Patch Set: Created 4 years 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
Index: chrome/browser/ssl/cert_report_helper.cc
diff --git a/chrome/browser/ssl/cert_report_helper.cc b/chrome/browser/ssl/cert_report_helper.cc
index 1c41bb4820754df112a5a5fd3476426bbaae7677..9eb4cfbd692f3545b92e5b4fc54333dbd4d5368a 100644
--- a/chrome/browser/ssl/cert_report_helper.cc
+++ b/chrome/browser/ssl/cert_report_helper.cc
@@ -96,20 +96,26 @@ void CertReportHelper::PopulateExtendedReportingOption(
void CertReportHelper::FinishCertCollection(
certificate_reporting::ErrorReport::ProceedDecision user_proceeded) {
- if (!ShouldShowCertificateReporterCheckbox())
+ if (!ShouldShowCertificateReporterCheckbox()) {
+ ssl_cert_reporter_->OnDidNotSendReport();
return;
+ }
if (!safe_browsing::IsExtendedReportingEnabled(
- *GetProfile(web_contents_)->GetPrefs()))
+ *GetProfile(web_contents_)->GetPrefs())) {
+ ssl_cert_reporter_->OnDidNotSendReport();
return;
+ }
if (metrics_helper_) {
metrics_helper_->RecordUserInteraction(
security_interstitials::MetricsHelper::EXTENDED_REPORTING_IS_ENABLED);
}
- if (!ShouldReportCertificateError())
+ if (!ShouldReportCertificateError()) {
+ ssl_cert_reporter_->OnDidNotSendReport();
return;
+ }
std::string serialized_report;
certificate_reporting::ErrorReport report(request_url_.host(), ssl_info_);
@@ -125,6 +131,7 @@ void CertReportHelper::FinishCertCollection(
if (!report.Serialize(&serialized_report)) {
LOG(ERROR) << "Failed to serialize certificate report.";
Jialiu Lin 2016/11/30 22:18:07 maybe remove this LOG(ERROR)?
meacer 2016/11/30 23:39:40 estark: I think this is your LOG. Is it okay to re
+ ssl_cert_reporter_->OnDidNotSendReport();
return;
}

Powered by Google App Engine
This is Rietveld 408576698