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

Side by Side Diff: components/certificate_reporting/error_report.cc

Issue 2964283002: Add chrome channel to cert logger reports (Closed)
Patch Set: Fix build errors Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/certificate_reporting/cert_logger.pb.h"
13 #include "components/network_time/network_time_tracker.h" 12 #include "components/network_time/network_time_tracker.h"
14 #include "net/cert/cert_status_flags.h" 13 #include "net/cert/cert_status_flags.h"
15 #include "net/cert/x509_certificate.h" 14 #include "net/cert/x509_certificate.h"
16 #include "net/ssl/ssl_info.h" 15 #include "net/ssl/ssl_info.h"
17 16
18 #if defined(OS_ANDROID) 17 #if defined(OS_ANDROID)
19 #include "net/cert/cert_verify_proc_android.h" 18 #include "net/cert/cert_verify_proc_android.h"
20 #endif 19 #endif
21 20
22 using network_time::NetworkTimeTracker; 21 using network_time::NetworkTimeTracker;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 NETWORK_TIME_FETCHES_ON_DEMAND_ONLY; 166 NETWORK_TIME_FETCHES_ON_DEMAND_ONLY;
168 break; 167 break;
169 case NetworkTimeTracker::FETCHES_IN_BACKGROUND_AND_ON_DEMAND: 168 case NetworkTimeTracker::FETCHES_IN_BACKGROUND_AND_ON_DEMAND:
170 report_behavior = CertLoggerFeaturesInfo::NetworkTimeQueryingInfo:: 169 report_behavior = CertLoggerFeaturesInfo::NetworkTimeQueryingInfo::
171 NETWORK_TIME_FETCHES_IN_BACKGROUND_AND_ON_DEMAND; 170 NETWORK_TIME_FETCHES_IN_BACKGROUND_AND_ON_DEMAND;
172 break; 171 break;
173 } 172 }
174 network_time_info->set_network_time_query_behavior(report_behavior); 173 network_time_info->set_network_time_query_behavior(report_behavior);
175 } 174 }
176 175
176 void ErrorReport::AddChromeChannel(version_info::Channel channel) {
177 switch (channel) {
178 case version_info::Channel::STABLE:
179 cert_report_->set_chrome_channel(
180 CertLoggerRequest::CHROME_CHANNEL_STABLE);
181 break;
182
183 case version_info::Channel::BETA:
184 cert_report_->set_chrome_channel(CertLoggerRequest::CHROME_CHANNEL_BETA);
185 break;
186
187 case version_info::Channel::CANARY:
188 cert_report_->set_chrome_channel(
189 CertLoggerRequest::CHROME_CHANNEL_CANARY);
190 break;
191
192 case version_info::Channel::DEV:
193 cert_report_->set_chrome_channel(CertLoggerRequest::CHROME_CHANNEL_DEV);
194 break;
195
196 case version_info::Channel::UNKNOWN:
197 cert_report_->set_chrome_channel(
198 CertLoggerRequest::CHROME_CHANNEL_UNKNOWN);
199 break;
200 }
201 }
202
177 void ErrorReport::SetIsRetryUpload(bool is_retry_upload) { 203 void ErrorReport::SetIsRetryUpload(bool is_retry_upload) {
178 cert_report_->set_is_retry_upload(is_retry_upload); 204 cert_report_->set_is_retry_upload(is_retry_upload);
179 } 205 }
180 206
181 const std::string& ErrorReport::hostname() const { 207 const std::string& ErrorReport::hostname() const {
182 return cert_report_->hostname(); 208 return cert_report_->hostname();
183 } 209 }
184 210
211 CertLoggerRequest::ChromeChannel ErrorReport::chrome_channel() const {
212 return cert_report_->chrome_channel();
213 }
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
OLDNEW
« no previous file with comments | « components/certificate_reporting/error_report.h ('k') | components/certificate_reporting/error_report_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698