OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/certificate_reporting/error_report.h" | 5 #include "components/certificate_reporting/error_report.h" |
6 | 6 |
| 7 #include <map> |
| 8 #include <string> |
7 #include <vector> | 9 #include <vector> |
8 | 10 |
| 11 #include "base/feature_list.h" |
9 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
10 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
11 #include "base/time/time.h" | 14 #include "base/time/time.h" |
12 #include "components/certificate_reporting/cert_logger.pb.h" | 15 #include "components/certificate_reporting/cert_logger.pb.h" |
13 #include "net/cert/cert_status_flags.h" | 16 #include "net/cert/cert_status_flags.h" |
14 #include "net/cert/x509_certificate.h" | 17 #include "net/cert/x509_certificate.h" |
15 #include "net/ssl/ssl_info.h" | 18 #include "net/ssl/ssl_info.h" |
16 | 19 |
17 namespace certificate_reporting { | 20 namespace certificate_reporting { |
18 | 21 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 120 } |
118 | 121 |
119 interstitial_info->set_user_proceeded(proceed_decision == USER_PROCEEDED); | 122 interstitial_info->set_user_proceeded(proceed_decision == USER_PROCEEDED); |
120 interstitial_info->set_overridable(overridable == INTERSTITIAL_OVERRIDABLE); | 123 interstitial_info->set_overridable(overridable == INTERSTITIAL_OVERRIDABLE); |
121 } | 124 } |
122 | 125 |
123 const std::string& ErrorReport::hostname() const { | 126 const std::string& ErrorReport::hostname() const { |
124 return cert_report_->hostname(); | 127 return cert_report_->hostname(); |
125 } | 128 } |
126 | 129 |
| 130 void ErrorReport::AddFeature(const std::string& feature_name, |
| 131 bool enabled, |
| 132 const std::map<std::string, std::string>& params) { |
| 133 CertLoggerFeatureInfo* report_feature = cert_report_->add_features_info(); |
| 134 report_feature->set_feature(feature_name); |
| 135 report_feature->set_enabled(enabled); |
| 136 for (const auto& param : params) { |
| 137 CertLoggerFeatureInfo::Parameter* parameter = report_feature->add_params(); |
| 138 parameter->set_name(param.first); |
| 139 parameter->set_value(param.second); |
| 140 } |
| 141 } |
| 142 |
127 } // namespace certificate_reporting | 143 } // namespace certificate_reporting |
OLD | NEW |