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

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
« no previous file with comments | « net/socket/ssl_host_info.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 rev_checking_enabled_(ssl_config.rev_checking_enabled), 33 rev_checking_enabled_(ssl_config.rev_checking_enabled),
36 verify_ev_cert_(ssl_config.verify_ev_cert), 34 verify_ev_cert_(ssl_config.verify_ev_cert),
37 verifier_(cert_verifier), 35 verifier_(cert_verifier),
38 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), 36 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
39 dnsrr_resolver_(NULL),
40 dns_callback_(NULL),
41 dns_handle_(DnsRRResolver::kInvalidHandle) {
42 } 37 }
43 38
44 SSLHostInfo::~SSLHostInfo() { 39 SSLHostInfo::~SSLHostInfo() {
45 if (dns_handle_ != DnsRRResolver::kInvalidHandle) {
46 dnsrr_resolver_->CancelResolve(dns_handle_);
47 delete dns_callback_;
48 }
49 }
50
51 void SSLHostInfo::StartDnsLookup(DnsRRResolver* dnsrr_resolver) {
52 dnsrr_resolver_ = dnsrr_resolver;
53 // Note: currently disabled.
54 } 40 }
55 41
56 const SSLHostInfo::State& SSLHostInfo::state() const { 42 const SSLHostInfo::State& SSLHostInfo::state() const {
57 return state_; 43 return state_;
58 } 44 }
59 45
60 SSLHostInfo::State* SSLHostInfo::mutable_state() { 46 SSLHostInfo::State* SSLHostInfo::mutable_state() {
61 return &state_; 47 return &state_;
62 } 48 }
63 49
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (!cert_verification_callback_.is_null()) { 195 if (!cert_verification_callback_.is_null()) {
210 CompletionCallback callback = cert_verification_callback_; 196 CompletionCallback callback = cert_verification_callback_;
211 cert_verification_callback_.Reset(); 197 cert_verification_callback_.Reset();
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
« no previous file with comments | « net/socket/ssl_host_info.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698