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

Side by Side Diff: net/socket/ssl_host_info.cc

Issue 8692012: net: replace DnsRRResoler with TransportSecurityState in plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "net/socket/ssl_host_info.h" 5 #include "net/socket/ssl_host_info.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
11 #include "net/base/dns_util.h"
12 #include "net/base/dnsrr_resolver.h"
13 #include "net/base/ssl_config_service.h" 11 #include "net/base/ssl_config_service.h"
14 #include "net/base/x509_certificate.h" 12 #include "net/base/x509_certificate.h"
15 #include "net/socket/ssl_client_socket.h" 13 #include "net/socket/ssl_client_socket.h"
16 14
17 namespace net { 15 namespace net {
18 16
19 SSLHostInfo::State::State() {} 17 SSLHostInfo::State::State() {}
20 18
21 SSLHostInfo::State::~State() {} 19 SSLHostInfo::State::~State() {}
22 20
23 void SSLHostInfo::State::Clear() { 21 void SSLHostInfo::State::Clear() {
24 certs.clear(); 22 certs.clear();
25 } 23 }
26 24
27 SSLHostInfo::SSLHostInfo( 25 SSLHostInfo::SSLHostInfo(
28 const std::string& hostname, 26 const std::string& hostname,
29 const SSLConfig& ssl_config, 27 const SSLConfig& ssl_config,
30 CertVerifier* cert_verifier) 28 CertVerifier* cert_verifier)
31 : cert_verification_complete_(false), 29 : cert_verification_complete_(false),
32 cert_verification_error_(ERR_CERT_INVALID), 30 cert_verification_error_(ERR_CERT_INVALID),
33 hostname_(hostname), 31 hostname_(hostname),
34 cert_parsing_failed_(false), 32 cert_parsing_failed_(false),
35 cert_verification_callback_(NULL), 33 cert_verification_callback_(NULL),
36 rev_checking_enabled_(ssl_config.rev_checking_enabled), 34 rev_checking_enabled_(ssl_config.rev_checking_enabled),
37 verify_ev_cert_(ssl_config.verify_ev_cert), 35 verify_ev_cert_(ssl_config.verify_ev_cert),
38 verifier_(cert_verifier), 36 verifier_(cert_verifier),
39 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), 37 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
40 dnsrr_resolver_(NULL),
41 dns_callback_(NULL),
42 dns_handle_(DnsRRResolver::kInvalidHandle) {
43 } 38 }
44 39
45 SSLHostInfo::~SSLHostInfo() { 40 SSLHostInfo::~SSLHostInfo() {
46 if (dns_handle_ != DnsRRResolver::kInvalidHandle) {
47 dnsrr_resolver_->CancelResolve(dns_handle_);
48 delete dns_callback_;
49 }
50 }
51
52 void SSLHostInfo::StartDnsLookup(DnsRRResolver* dnsrr_resolver) {
53 dnsrr_resolver_ = dnsrr_resolver;
54 // Note: currently disabled.
55 } 41 }
56 42
57 const SSLHostInfo::State& SSLHostInfo::state() const { 43 const SSLHostInfo::State& SSLHostInfo::state() const {
58 return state_; 44 return state_;
59 } 45 }
60 46
61 SSLHostInfo::State* SSLHostInfo::mutable_state() { 47 SSLHostInfo::State* SSLHostInfo::mutable_state() {
62 return &state_; 48 return &state_;
63 } 49 }
64 50
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (cert_verification_callback_) { 195 if (cert_verification_callback_) {
210 OldCompletionCallback* callback = cert_verification_callback_; 196 OldCompletionCallback* callback = cert_verification_callback_;
211 cert_verification_callback_ = NULL; 197 cert_verification_callback_ = NULL;
212 callback->Run(rv); 198 callback->Run(rv);
213 } 199 }
214 } 200 }
215 201
216 SSLHostInfoFactory::~SSLHostInfoFactory() {} 202 SSLHostInfoFactory::~SSLHostInfoFactory() {}
217 203
218 } // namespace net 204 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698