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> |
| 9 |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "net/ssl/ssl_cert_request_info.h" | 16 #include "net/ssl/ssl_cert_request_info.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 class ClientCertStore; | 19 class ClientCertStore; |
19 class URLRequest; | 20 class URLRequest; |
20 class X509Certificate; | 21 class X509Certificate; |
21 } // namespace net | 22 } // namespace net |
(...skipping 20 matching lines...) Expand all Loading... |
42 | 43 |
43 protected: | 44 protected: |
44 virtual ~Delegate() {} | 45 virtual ~Delegate() {} |
45 | 46 |
46 private: | 47 private: |
47 DISALLOW_COPY_AND_ASSIGN(Delegate); | 48 DISALLOW_COPY_AND_ASSIGN(Delegate); |
48 }; | 49 }; |
49 | 50 |
50 // Creates a new SSLClientAuthHandler. The caller ensures that the handler | 51 // Creates a new SSLClientAuthHandler. The caller ensures that the handler |
51 // does not outlive |request| or |delegate|. | 52 // does not outlive |request| or |delegate|. |
52 SSLClientAuthHandler(scoped_ptr<net::ClientCertStore> client_cert_store, | 53 SSLClientAuthHandler(std::unique_ptr<net::ClientCertStore> client_cert_store, |
53 net::URLRequest* request, | 54 net::URLRequest* request, |
54 net::SSLCertRequestInfo* cert_request_info, | 55 net::SSLCertRequestInfo* cert_request_info, |
55 Delegate* delegate); | 56 Delegate* delegate); |
56 ~SSLClientAuthHandler(); | 57 ~SSLClientAuthHandler(); |
57 | 58 |
58 // Selects a certificate and resumes the URL request with that certificate. | 59 // Selects a certificate and resumes the URL request with that certificate. |
59 void SelectCertificate(); | 60 void SelectCertificate(); |
60 | 61 |
61 // Called to continue the request associated with |handler| using |cert|. This | 62 // Called to continue the request associated with |handler| using |cert|. This |
62 // is static to avoid deleting |handler| while it is on the stack. | 63 // is static to avoid deleting |handler| while it is on the stack. |
(...skipping 27 matching lines...) Expand all Loading... |
90 Delegate* delegate_; | 91 Delegate* delegate_; |
91 | 92 |
92 base::WeakPtrFactory<SSLClientAuthHandler> weak_factory_; | 93 base::WeakPtrFactory<SSLClientAuthHandler> weak_factory_; |
93 | 94 |
94 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); | 95 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace content | 98 } // namespace content |
98 | 99 |
99 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 100 #endif // CONTENT_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
OLD | NEW |