OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "chrome/browser/browser_thread.h" | 11 #include "chrome/browser/browser_thread.h" |
12 #include "net/base/ssl_cert_request_info.h" | 12 #include "net/base/ssl_cert_request_info.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class URLRequest; | 15 class URLRequest; |
16 class X509Certificate; | 16 class X509Certificate; |
17 } // namespace net | 17 } // namespace net |
18 | 18 |
19 // This class handles the approval and selection of a certificate for SSL client | 19 // This class handles the approval and selection of a certificate for SSL client |
20 // authentication by the user. | 20 // authentication by the user. |
21 // It is self-owned and deletes itself when the UI reports the user selection or | 21 // It is self-owned and deletes itself when the UI reports the user selection or |
22 // when the URLRequest is cancelled. | 22 // when the net::URLRequest is cancelled. |
23 class SSLClientAuthHandler | 23 class SSLClientAuthHandler |
24 : public base::RefCountedThreadSafe<SSLClientAuthHandler, | 24 : public base::RefCountedThreadSafe<SSLClientAuthHandler, |
25 BrowserThread::DeleteOnIOThread> { | 25 BrowserThread::DeleteOnIOThread> { |
26 public: | 26 public: |
27 SSLClientAuthHandler(net::URLRequest* request, | 27 SSLClientAuthHandler(net::URLRequest* request, |
28 net::SSLCertRequestInfo* cert_request_info); | 28 net::SSLCertRequestInfo* cert_request_info); |
29 | 29 |
30 // Asks the user to select a certificate and resumes the URL request with that | 30 // Asks the user to select a certificate and resumes the URL request with that |
31 // certificate. | 31 // certificate. |
32 // Should only be called on the IO thread. | 32 // Should only be called on the IO thread. |
(...skipping 14 matching lines...) Expand all Loading... |
47 private: | 47 private: |
48 friend class BrowserThread; | 48 friend class BrowserThread; |
49 friend class DeleteTask<SSLClientAuthHandler>; | 49 friend class DeleteTask<SSLClientAuthHandler>; |
50 | 50 |
51 virtual ~SSLClientAuthHandler(); | 51 virtual ~SSLClientAuthHandler(); |
52 | 52 |
53 // Notifies that the user has selected a cert. | 53 // Notifies that the user has selected a cert. |
54 // Called on the IO thread. | 54 // Called on the IO thread. |
55 void DoCertificateSelected(net::X509Certificate* cert); | 55 void DoCertificateSelected(net::X509Certificate* cert); |
56 | 56 |
57 // The URLRequest that triggered this client auth. | 57 // The net::URLRequest that triggered this client auth. |
58 net::URLRequest* request_; | 58 net::URLRequest* request_; |
59 | 59 |
60 // The certs to choose from. | 60 // The certs to choose from. |
61 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 61 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); | 63 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); |
64 }; | 64 }; |
65 | 65 |
66 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 66 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
OLD | NEW |