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

Unified Diff: components/certificate_reporting/error_report.cc

Issue 2964283002: Add chrome channel to cert logger reports (Closed)
Patch Set: Clean up test comments Created 3 years, 6 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
Index: components/certificate_reporting/error_report.cc
diff --git a/components/certificate_reporting/error_report.cc b/components/certificate_reporting/error_report.cc
index ebc41f55a7b708a7450cbc920a6cd3701682d299..c9dbe8d66b515fd859b85a47d466a8d0f847d260 100644
--- a/components/certificate_reporting/error_report.cc
+++ b/components/certificate_reporting/error_report.cc
@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "components/certificate_reporting/cert_logger.pb.h"
#include "components/network_time/network_time_tracker.h"
+#include "components/version_info/version_info.h"
#include "net/cert/cert_status_flags.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_info.h"
@@ -174,6 +175,30 @@ void ErrorReport::AddNetworkTimeInfo(
network_time_info->set_network_time_query_behavior(report_behavior);
}
+void ErrorReport::AddChromeChannel(const version_info::Channel channel) {
+ CertLoggerRequest::ChromeChannel code;
+ switch (channel) {
+ case version_info::Channel::STABLE:
+ code = CertLoggerRequest::STABLE;
meacer 2017/06/30 22:24:46 Don't forget "break;"s after each case :)
sperigo 2017/06/30 23:37:27 Done.
sperigo 2017/06/30 23:37:27 Oh no! I'm embarrassed. Good catch.
+
+ case version_info::Channel::BETA:
+ code = CertLoggerRequest::BETA;
+
+ case version_info::Channel::CANARY:
+ code = CertLoggerRequest::CANARY;
+
+ case version_info::Channel::DEV:
+ code = CertLoggerRequest::DEV;
+
+ case version_info::Channel::UNKNOWN:
+ code = CertLoggerRequest::UNKNOWN;
+
+ default:
+ code = CertLoggerRequest::NONE;
+ }
+ cert_report_->set_chrome_channel(code);
+}
+
void ErrorReport::SetIsRetryUpload(bool is_retry_upload) {
cert_report_->set_is_retry_upload(is_retry_upload);
}

Powered by Google App Engine
This is Rietveld 408576698