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 |