OLD | NEW |
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 #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 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
14 #include "base/time.h" | 13 #include "base/time.h" |
15 #include "net/base/cert_verifier.h" | 14 #include "net/base/cert_verifier.h" |
16 #include "net/base/cert_verify_result.h" | 15 #include "net/base/cert_verify_result.h" |
17 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
18 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
19 #include "net/base/single_request_cert_verifier.h" | 18 #include "net/base/single_request_cert_verifier.h" |
20 #include "net/socket/ssl_client_socket.h" | 19 #include "net/socket/ssl_client_socket.h" |
21 | 20 |
22 namespace net { | 21 namespace net { |
23 | 22 |
24 class X509Certificate; | 23 class X509Certificate; |
25 struct SSLConfig; | 24 struct SSLConfig; |
26 | 25 |
27 // SSLHostInfo is an interface for fetching information about an SSL server. | 26 // SSLHostInfo is an interface for fetching information about an SSL server. |
28 // This information may be stored on disk so does not include keys or session | 27 // This information may be stored on disk so does not include keys or session |
29 // information etc. Primarily it's intended for caching the server's | 28 // information etc. Primarily it's intended for caching the server's |
30 // certificates. | 29 // certificates. |
31 class NET_EXPORT_PRIVATE SSLHostInfo { | 30 class NET_EXPORT_PRIVATE SSLHostInfo { |
32 public: | 31 public: |
33 SSLHostInfo(const std::string& hostname, | 32 SSLHostInfo(const std::string& hostname, |
34 const SSLConfig& ssl_config, | 33 const SSLConfig& ssl_config, |
35 CertVerifier *certVerifier); | 34 CertVerifier* certVerifier); |
36 virtual ~SSLHostInfo(); | 35 virtual ~SSLHostInfo(); |
37 | 36 |
38 // Start will commence the lookup. This must be called before any other | 37 // Start will commence the lookup. This must be called before any other |
39 // methods. By opportunistically calling this early, it may be possible to | 38 // methods. By opportunistically calling this early, it may be possible to |
40 // overlap this object's lookup and reduce latency. | 39 // overlap this object's lookup and reduce latency. |
41 virtual void Start() = 0; | 40 virtual void Start() = 0; |
42 | 41 |
43 // WaitForDataReady returns OK if the fetch of the requested data has | 42 // WaitForDataReady returns OK if the fetch of the requested data has |
44 // completed. Otherwise it returns ERR_IO_PENDING and will call |callback| on | 43 // completed. Otherwise it returns ERR_IO_PENDING and will call |callback| on |
45 // the current thread when ready. | 44 // the current thread when ready. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 135 |
137 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname | 136 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname |
138 // or NULL on failure. | 137 // or NULL on failure. |
139 virtual SSLHostInfo* GetForHost(const std::string& hostname, | 138 virtual SSLHostInfo* GetForHost(const std::string& hostname, |
140 const SSLConfig& ssl_config) = 0; | 139 const SSLConfig& ssl_config) = 0; |
141 }; | 140 }; |
142 | 141 |
143 } // namespace net | 142 } // namespace net |
144 | 143 |
145 #endif // NET_SOCKET_SSL_HOST_INFO_H_ | 144 #endif // NET_SOCKET_SSL_HOST_INFO_H_ |
OLD | NEW |