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 CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
6 #define CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "net/cert/x509_certificate.h" |
16 #include "net/ssl/ssl_cert_request_info.h" | 17 #include "net/ssl/ssl_cert_request_info.h" |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 class ClientCertStore; | 20 class ClientCertStore; |
20 class URLRequest; | 21 class URLRequest; |
21 class X509Certificate; | 22 class X509Certificate; |
22 } // namespace net | 23 } // namespace net |
23 | 24 |
24 namespace content { | 25 namespace content { |
25 | 26 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 68 |
68 // Called to abort the request associated with |handler|. This is static to | 69 // Called to abort the request associated with |handler|. This is static to |
69 // avoid deleting |handler| while it is on the stack. | 70 // avoid deleting |handler| while it is on the stack. |
70 static void CancelCertificateSelection( | 71 static void CancelCertificateSelection( |
71 const base::WeakPtr<SSLClientAuthHandler>& handler); | 72 const base::WeakPtr<SSLClientAuthHandler>& handler); |
72 | 73 |
73 private: | 74 private: |
74 class Core; | 75 class Core; |
75 | 76 |
76 // Called when |core_| is done retrieving the cert list. | 77 // Called when |core_| is done retrieving the cert list. |
77 void DidGetClientCerts(); | 78 void DidGetClientCerts(net::CertificateList client_certs); |
78 | 79 |
79 // A reference-counted core so the ClientCertStore may outlive | 80 // A reference-counted core so the ClientCertStore may outlive |
80 // SSLClientAuthHandler if the handler is destroyed while an operation on the | 81 // SSLClientAuthHandler if the handler is destroyed while an operation on the |
81 // ClientCertStore is in progress. | 82 // ClientCertStore is in progress. |
82 scoped_refptr<Core> core_; | 83 scoped_refptr<Core> core_; |
83 | 84 |
84 // The net::URLRequest that triggered this client auth. | 85 // The net::URLRequest that triggered this client auth. |
85 net::URLRequest* request_; | 86 net::URLRequest* request_; |
86 | 87 |
87 // The certs to choose from. | 88 // The certs to choose from. |
88 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 89 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
89 | 90 |
90 // The delegate to call back with the result. | 91 // The delegate to call back with the result. |
91 Delegate* delegate_; | 92 Delegate* delegate_; |
92 | 93 |
93 base::WeakPtrFactory<SSLClientAuthHandler> weak_factory_; | 94 base::WeakPtrFactory<SSLClientAuthHandler> weak_factory_; |
94 | 95 |
95 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); | 96 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); |
96 }; | 97 }; |
97 | 98 |
98 } // namespace content | 99 } // namespace content |
99 | 100 |
100 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 101 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
OLD | NEW |