1// Copyright 2013 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_SIGNED_CERTIFICATE_STORE_IMPL_H_
6#define CONTENT_BROWSER_SIGNED_CERTIFICATE_STORE_IMPL_H_
7
8#include "content/browser/renderer_data_memoizing_store.h"
9#include "content/public/browser/signed_certificate_timestamp_store.h"
10#include "net/cert/signed_certificate_timestamp.h"
11
12template <typename T> struct DefaultSingletonTraits;
13
14namespace content {
15
16class SignedCertificateTimestampStoreImpl
17    : public SignedCertificateTimestampStore {
18 public:
19  // Returns the singleton instance of the SignedCertificateTimestampStore.
20  static SignedCertificateTimestampStoreImpl* GetInstance();
21
22  // SignedCertificateTimestampStore implementation:
23  virtual int Store(
24      net::ct::SignedCertificateTimestamp* sct,
25      int render_process_host_id) OVERRIDE;
26  virtual bool Retrieve(
27      int sct_id,
28      scoped_refptr<net::ct::SignedCertificateTimestamp>* sct) OVERRIDE;
29
30 private:
31  friend struct DefaultSingletonTraits<SignedCertificateTimestampStoreImpl>;
32
33  SignedCertificateTimestampStoreImpl();
34  virtual ~SignedCertificateTimestampStoreImpl();
35
36  RendererDataMemoizingStore<net::ct::SignedCertificateTimestamp> store_;
37
38  DISALLOW_COPY_AND_ASSIGN(SignedCertificateTimestampStoreImpl);
39};
40
41}  // namespace content
42
43#endif  // CONTENT_BROWSER_SIGNED_CERTIFICATE_STORE_IMPL_H_
44