| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_SOCKET_SSL_HOST_INFO_H_ | 5 #ifndef NET_SOCKET_SSL_HOST_INFO_H_ |
| 6 #define NET_SOCKET_SSL_HOST_INFO_H_ | 6 #define NET_SOCKET_SSL_HOST_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 int WaitForCertVerification(CompletionCallback* callback); | 99 int WaitForCertVerification(CompletionCallback* callback); |
| 100 | 100 |
| 101 base::TimeTicks verification_start_time() const { | 101 base::TimeTicks verification_start_time() const { |
| 102 return verification_start_time_; | 102 return verification_start_time_; |
| 103 } | 103 } |
| 104 | 104 |
| 105 base::TimeTicks verification_end_time() const { | 105 base::TimeTicks verification_end_time() const { |
| 106 return verification_end_time_; | 106 return verification_end_time_; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // set_cert_verification_finished_time allows the SSL socket to tell us when |
| 110 // it finished verifing the certificate. If the DNS request hasn't finished |
| 111 // by this time then we record how long we would have had to have waited for |
| 112 // it. |
| 113 void set_cert_verification_finished_time(); |
| 114 |
| 109 protected: | 115 protected: |
| 110 // Parse parses an opaque blob of data and fills out the public member fields | 116 // Parse parses an opaque blob of data and fills out the public member fields |
| 111 // of this object. It returns true iff the parse was successful. The public | 117 // of this object. It returns true iff the parse was successful. The public |
| 112 // member fields will be set to something sane in any case. | 118 // member fields will be set to something sane in any case. |
| 113 bool Parse(const std::string& data); | 119 bool Parse(const std::string& data); |
| 114 std::string Serialize() const; | 120 std::string Serialize() const; |
| 115 State state_; | 121 State state_; |
| 116 bool cert_verification_complete_; | 122 bool cert_verification_complete_; |
| 117 int cert_verification_error_; | 123 int cert_verification_error_; |
| 118 | 124 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 139 CertVerifyResult cert_verify_result_; | 145 CertVerifyResult cert_verify_result_; |
| 140 SingleRequestCertVerifier verifier_; | 146 SingleRequestCertVerifier verifier_; |
| 141 scoped_refptr<X509Certificate> cert_; | 147 scoped_refptr<X509Certificate> cert_; |
| 142 scoped_refptr<CancelableCompletionCallback<SSLHostInfo> > callback_; | 148 scoped_refptr<CancelableCompletionCallback<SSLHostInfo> > callback_; |
| 143 | 149 |
| 144 DnsRRResolver* dnsrr_resolver_; | 150 DnsRRResolver* dnsrr_resolver_; |
| 145 CompletionCallback* dns_callback_; | 151 CompletionCallback* dns_callback_; |
| 146 DnsRRResolver::Handle dns_handle_; | 152 DnsRRResolver::Handle dns_handle_; |
| 147 RRResponse dns_response_; | 153 RRResponse dns_response_; |
| 148 base::TimeTicks dns_lookup_start_time_; | 154 base::TimeTicks dns_lookup_start_time_; |
| 155 base::TimeTicks cert_verification_finished_time_; |
| 149 }; | 156 }; |
| 150 | 157 |
| 151 class SSLHostInfoFactory { | 158 class SSLHostInfoFactory { |
| 152 public: | 159 public: |
| 153 virtual ~SSLHostInfoFactory(); | 160 virtual ~SSLHostInfoFactory(); |
| 154 | 161 |
| 155 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname | 162 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname |
| 156 // or NULL on failure. | 163 // or NULL on failure. |
| 157 virtual SSLHostInfo* GetForHost(const std::string& hostname, | 164 virtual SSLHostInfo* GetForHost(const std::string& hostname, |
| 158 const SSLConfig& ssl_config) = 0; | 165 const SSLConfig& ssl_config) = 0; |
| 159 }; | 166 }; |
| 160 | 167 |
| 161 } // namespace net | 168 } // namespace net |
| 162 | 169 |
| 163 #endif // NET_SOCKET_SSL_HOST_INFO_H_ | 170 #endif // NET_SOCKET_SSL_HOST_INFO_H_ |
| OLD | NEW |