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

Unified Diff: components/certificate_reporting/error_report.cc

Issue 2448943004: Add experimental feature info to certificate reports (Closed)
Patch Set: undo more unnecessary changes 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
Index: components/certificate_reporting/error_report.cc
diff --git a/components/certificate_reporting/error_report.cc b/components/certificate_reporting/error_report.cc
index 18145e70005e5d6348615360706fc26ad400685e..12663d020df71f9add41d68365080189ffaaba89 100644
--- a/components/certificate_reporting/error_report.cc
+++ b/components/certificate_reporting/error_report.cc
@@ -4,8 +4,11 @@
#include "components/certificate_reporting/error_report.h"
+#include <map>
+#include <string>
#include <vector>
+#include "base/feature_list.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
@@ -124,4 +127,17 @@ const std::string& ErrorReport::hostname() const {
return cert_report_->hostname();
}
+void ErrorReport::AddFeature(const std::string& feature_name,
+ bool enabled,
+ const std::map<std::string, std::string>& params) {
+ CertLoggerFeatureInfo* report_feature = cert_report_->add_features_info();
+ report_feature->set_feature(feature_name);
+ report_feature->set_enabled(enabled);
+ for (const auto& param : params) {
+ CertLoggerFeatureInfo::Parameter* parameter = report_feature->add_params();
+ parameter->set_name(param.first);
+ parameter->set_value(param.second);
+ }
+}
+
} // namespace certificate_reporting

Powered by Google App Engine
This is Rietveld 408576698