OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ADD_CERT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
6 #define CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 class URLRequest; | 12 class URLRequest; |
13 class X509Certificate; | 13 class X509Certificate; |
14 } | 14 } |
15 | 15 |
16 // This class handles adding a newly-generated client cert. It ensures there's a | 16 // This class handles adding a newly-generated client cert. It ensures there's a |
17 // private key for the cert, displays the cert to the user, and adds it upon | 17 // private key for the cert, displays the cert to the user, and adds it upon |
18 // user approval. | 18 // user approval. |
19 // It is self-owned and deletes itself when finished. | 19 // It is self-owned and deletes itself when finished. |
20 class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { | 20 class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { |
21 public: | 21 public: |
22 SSLAddCertHandler(net::URLRequest* request, net::X509Certificate* cert, | 22 SSLAddCertHandler(net::URLRequest* request, net::X509Certificate* cert, |
23 int render_process_host_id, int render_view_id); | 23 int render_process_host_id, int render_view_id); |
24 | 24 |
25 net::X509Certificate* cert() { return cert_; } | 25 net::X509Certificate* cert() { return cert_.get(); } |
26 | 26 |
27 int network_request_id() const { return network_request_id_; } | 27 int network_request_id() const { return network_request_id_; } |
28 | 28 |
29 // The platform-specific code calls this when it's done, to clean up. | 29 // The platform-specific code calls this when it's done, to clean up. |
30 // If |addCert| is true, the cert will be added to the CertDatabase. | 30 // If |addCert| is true, the cert will be added to the CertDatabase. |
31 void Finished(bool add_cert); | 31 void Finished(bool add_cert); |
32 | 32 |
33 private: | 33 private: |
34 friend class base::RefCountedThreadSafe<SSLAddCertHandler>; | 34 friend class base::RefCountedThreadSafe<SSLAddCertHandler>; |
35 virtual ~SSLAddCertHandler(); | 35 virtual ~SSLAddCertHandler(); |
(...skipping 16 matching lines...) Expand all Loading... |
52 int network_request_id_; | 52 int network_request_id_; |
53 // The id of the |RenderProcessHost| which started the download. | 53 // The id of the |RenderProcessHost| which started the download. |
54 int render_process_host_id_; | 54 int render_process_host_id_; |
55 // The id of the |RenderView| which started the download. | 55 // The id of the |RenderView| which started the download. |
56 int render_view_id_; | 56 int render_view_id_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(SSLAddCertHandler); | 58 DISALLOW_COPY_AND_ASSIGN(SSLAddCertHandler); |
59 }; | 59 }; |
60 | 60 |
61 #endif // CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ | 61 #endif // CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
OLD | NEW |