Chromium Code Reviews| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 NETWORK_TIME_FETCHES_ON_DEMAND_ONLY; | 167 NETWORK_TIME_FETCHES_ON_DEMAND_ONLY; |
| 168 break; | 168 break; |
| 169 case NetworkTimeTracker::FETCHES_IN_BACKGROUND_AND_ON_DEMAND: | 169 case NetworkTimeTracker::FETCHES_IN_BACKGROUND_AND_ON_DEMAND: |
| 170 report_behavior = CertLoggerFeaturesInfo::NetworkTimeQueryingInfo:: | 170 report_behavior = CertLoggerFeaturesInfo::NetworkTimeQueryingInfo:: |
| 171 NETWORK_TIME_FETCHES_IN_BACKGROUND_AND_ON_DEMAND; | 171 NETWORK_TIME_FETCHES_IN_BACKGROUND_AND_ON_DEMAND; |
| 172 break; | 172 break; |
| 173 } | 173 } |
| 174 network_time_info->set_network_time_query_behavior(report_behavior); | 174 network_time_info->set_network_time_query_behavior(report_behavior); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ErrorReport::AddChromeChannel(version_info::Channel channel) { | |
| 178 CertLoggerRequest::ChromeChannel code; | |
| 179 switch (channel) { | |
| 180 case version_info::Channel::STABLE: | |
| 181 code = CertLoggerRequest::STABLE; | |
| 182 break; | |
| 183 | |
| 184 case version_info::Channel::BETA: | |
| 185 code = CertLoggerRequest::BETA; | |
| 186 break; | |
| 187 | |
| 188 case version_info::Channel::CANARY: | |
| 189 code = CertLoggerRequest::CANARY; | |
| 190 break; | |
| 191 | |
| 192 case version_info::Channel::DEV: | |
| 193 code = CertLoggerRequest::DEV; | |
| 194 break; | |
| 195 | |
| 196 case version_info::Channel::UNKNOWN: | |
| 197 code = CertLoggerRequest::UNKNOWN; | |
| 198 break; | |
| 199 | |
| 200 default: | |
|
estark
2017/07/01 17:19:01
I think you can delete this case. (Better to leave
sperigo
2017/07/05 23:02:48
This is really smart. Thanks!
sperigo
2017/07/05 23:02:48
Done.
| |
| 201 code = CertLoggerRequest::NONE; | |
| 202 break; | |
| 203 } | |
| 204 cert_report_->set_chrome_channel(code); | |
| 205 } | |
| 206 | |
| 177 void ErrorReport::SetIsRetryUpload(bool is_retry_upload) { | 207 void ErrorReport::SetIsRetryUpload(bool is_retry_upload) { |
| 178 cert_report_->set_is_retry_upload(is_retry_upload); | 208 cert_report_->set_is_retry_upload(is_retry_upload); |
| 179 } | 209 } |
| 180 | 210 |
| 181 const std::string& ErrorReport::hostname() const { | 211 const std::string& ErrorReport::hostname() const { |
| 182 return cert_report_->hostname(); | 212 return cert_report_->hostname(); |
| 183 } | 213 } |
| 184 | 214 |
| 185 bool ErrorReport::is_retry_upload() const { | 215 bool ErrorReport::is_retry_upload() const { |
| 186 return cert_report_->is_retry_upload(); | 216 return cert_report_->is_retry_upload(); |
| 187 } | 217 } |
| 188 | 218 |
| 189 } // namespace certificate_reporting | 219 } // namespace certificate_reporting |
| OLD | NEW |