blob: f5afe83db697af6f6ba74df8d68cb8642056fef9 [file] [log] [blame]
[email protected]b59c6cf02012-03-12 20:51:421// 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]b59c6cf02012-03-12 20:51:427
[email protected]b59c6cf02012-03-12 20:51:428#include "base/memory/singleton.h"
[email protected]8e9d06b2013-11-19 19:05:189#include "content/browser/renderer_data_memoizing_store.h"
[email protected]b59c6cf02012-03-12 20:51:4210#include "content/public/browser/cert_store.h"
[email protected]6e7845ae2013-03-29 21:48:1111#include "net/cert/x509_certificate.h"
[email protected]b59c6cf02012-03-12 20:51:4212
[email protected]46488322012-10-30 03:22:2013namespace content {
14
[email protected]8e9d06b2013-11-19 19:05:1815class CertStoreImpl : public CertStore {
[email protected]b59c6cf02012-03-12 20:51:4216 public:
17 // Returns the singleton instance of the CertStore.
18 static CertStoreImpl* GetInstance();
19
20 // CertStore implementation:
dchengc2282aa2014-10-21 12:07:5821 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]b59c6cf02012-03-12 20:51:4225
[email protected]b59c6cf02012-03-12 20:51:4226 protected:
27 CertStoreImpl();
dchengc2282aa2014-10-21 12:07:5828 ~CertStoreImpl() override;
[email protected]b59c6cf02012-03-12 20:51:4229
30 private:
olli.raula36aa8be2015-09-10 11:14:2231 friend struct base::DefaultSingletonTraits<CertStoreImpl>;
[email protected]b59c6cf02012-03-12 20:51:4232
[email protected]8e9d06b2013-11-19 19:05:1833 RendererDataMemoizingStore<net::X509Certificate> store_;
[email protected]b59c6cf02012-03-12 20:51:4234
35 DISALLOW_COPY_AND_ASSIGN(CertStoreImpl);
36};
37
[email protected]46488322012-10-30 03:22:2038} // namespace content
39
[email protected]b59c6cf02012-03-12 20:51:4240#endif // CONTENT_BROWSER_CERT_STORE_IMPL_H_