[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef CONTENT_BROWSER_CERT_STORE_IMPL_H_ | ||||
6 | #define CONTENT_BROWSER_CERT_STORE_IMPL_H_ | ||||
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 7 | |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 8 | #include "base/memory/singleton.h" |
[email protected] | 8e9d06b | 2013-11-19 19:05:18 | [diff] [blame] | 9 | #include "content/browser/renderer_data_memoizing_store.h" |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 10 | #include "content/public/browser/cert_store.h" |
[email protected] | 6e7845ae | 2013-03-29 21:48:11 | [diff] [blame] | 11 | #include "net/cert/x509_certificate.h" |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 12 | |
[email protected] | 4648832 | 2012-10-30 03:22:20 | [diff] [blame] | 13 | namespace content { |
14 | |||||
[email protected] | 8e9d06b | 2013-11-19 19:05:18 | [diff] [blame] | 15 | class CertStoreImpl : public CertStore { |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 16 | public: |
17 | // Returns the singleton instance of the CertStore. | ||||
18 | static CertStoreImpl* GetInstance(); | ||||
19 | |||||
20 | // CertStore implementation: | ||||
dcheng | c2282aa | 2014-10-21 12:07:58 | [diff] [blame] | 21 | int StoreCert(net::X509Certificate* cert, |
22 | int render_process_host_id) override; | ||||
23 | bool RetrieveCert(int cert_id, | ||||
24 | scoped_refptr<net::X509Certificate>* cert) override; | ||||
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 25 | |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 26 | protected: |
27 | CertStoreImpl(); | ||||
dcheng | c2282aa | 2014-10-21 12:07:58 | [diff] [blame] | 28 | ~CertStoreImpl() override; |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 29 | |
30 | private: | ||||
olli.raula | 36aa8be | 2015-09-10 11:14:22 | [diff] [blame] | 31 | friend struct base::DefaultSingletonTraits<CertStoreImpl>; |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 32 | |
[email protected] | 8e9d06b | 2013-11-19 19:05:18 | [diff] [blame] | 33 | RendererDataMemoizingStore<net::X509Certificate> store_; |
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 34 | |
35 | DISALLOW_COPY_AND_ASSIGN(CertStoreImpl); | ||||
36 | }; | ||||
37 | |||||
[email protected] | 4648832 | 2012-10-30 03:22:20 | [diff] [blame] | 38 | } // namespace content |
39 | |||||
[email protected] | b59c6cf0 | 2012-03-12 20:51:42 | [diff] [blame] | 40 | #endif // CONTENT_BROWSER_CERT_STORE_IMPL_H_ |