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

Side by Side Diff: chrome/browser/net/chrome_fraudulent_certificate_reporter.cc

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set callback to DoNothing close to where it's used Created 5 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 5 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
6 6
7 #include "base/profiler/scoped_tracker.h" 7 #include "base/profiler/scoped_tracker.h"
8 #include "chrome/browser/net/certificate_error_reporter.h" 8 #include "chrome/browser/net/certificate_error_reporter.h"
9 #include "net/ssl/ssl_info.h" 9 #include "net/ssl/ssl_info.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 11 matching lines...) Expand all
22 namespace chrome_browser_net { 22 namespace chrome_browser_net {
23 23
24 ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter( 24 ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter(
25 net::URLRequestContext* request_context) 25 net::URLRequestContext* request_context)
26 : certificate_reporter_(new CertificateErrorReporter( 26 : certificate_reporter_(new CertificateErrorReporter(
27 request_context, 27 request_context,
28 GURL(kFraudulentCertificateUploadEndpoint))) { 28 GURL(kFraudulentCertificateUploadEndpoint))) {
29 } 29 }
30 30
31 ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter( 31 ChromeFraudulentCertificateReporter::ChromeFraudulentCertificateReporter(
32 scoped_ptr<CertificateErrorReporter> certificate_reporter) 32 scoped_refptr<CertificateErrorReporter> certificate_reporter)
33 : certificate_reporter_(certificate_reporter.Pass()) { 33 : certificate_reporter_(certificate_reporter) {
34 } 34 }
35 35
36 ChromeFraudulentCertificateReporter::~ChromeFraudulentCertificateReporter() { 36 ChromeFraudulentCertificateReporter::~ChromeFraudulentCertificateReporter() {
37 } 37 }
38 38
39 void ChromeFraudulentCertificateReporter::SendReport( 39 void ChromeFraudulentCertificateReporter::SendReport(
40 const std::string& hostname, 40 const std::string& hostname,
41 const net::SSLInfo& ssl_info) { 41 const net::SSLInfo& ssl_info) {
42 // Do silent/automatic reporting ONLY for Google properties. For other 42 // Do silent/automatic reporting ONLY for Google properties. For other
43 // domains (when that is supported), Chrome will ask for user permission. 43 // domains (when that is supported), Chrome will ask for user permission.
44 if (!net::TransportSecurityState::IsGooglePinnedProperty(hostname)) 44 if (!net::TransportSecurityState::IsGooglePinnedProperty(hostname))
45 return; 45 return;
46 46
47 certificate_reporter_->SendReport( 47 certificate_reporter_->SendReport(
48 CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION, hostname, 48 CertificateErrorReporter::REPORT_TYPE_PINNING_VIOLATION, hostname,
49 ssl_info); 49 ssl_info);
50 } 50 }
51 51
52 } // namespace chrome_browser_net 52 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698