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.
5 #ifndef CHROME_BROWSER_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_
6 #define CHROME_BROWSER_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_
8 #include "base/callback_forward.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "net/ssl/default_server_bound_cert_store.h"
15 class SequencedTaskRunner
;
19 class SpecialStoragePolicy
;
22 // Implements the net::DefaultServerBoundCertStore::PersistentStore interface
23 // in terms of a SQLite database. For documentation about the actual member
24 // functions consult the documentation of the parent class
25 // |net::DefaultServerBoundCertStore::PersistentCertStore|.
26 // If provided, a |SpecialStoragePolicy| is consulted when the SQLite database
27 // is closed to decide which certificates to keep.
28 class SQLiteServerBoundCertStore
29 : public net::DefaultServerBoundCertStore::PersistentStore
{
31 SQLiteServerBoundCertStore(
32 const base::FilePath
& path
,
33 const scoped_refptr
<base::SequencedTaskRunner
>& background_task_runner
,
34 quota::SpecialStoragePolicy
* special_storage_policy
);
36 // net::DefaultServerBoundCertStore::PersistentStore:
37 virtual void Load(const LoadedCallback
& loaded_callback
) OVERRIDE
;
38 virtual void AddServerBoundCert(
39 const net::DefaultServerBoundCertStore::ServerBoundCert
& cert
) OVERRIDE
;
40 virtual void DeleteServerBoundCert(
41 const net::DefaultServerBoundCertStore::ServerBoundCert
& cert
) OVERRIDE
;
42 virtual void SetForceKeepSessionState() OVERRIDE
;
45 virtual ~SQLiteServerBoundCertStore();
50 scoped_refptr
<Backend
> backend_
;
52 DISALLOW_COPY_AND_ASSIGN(SQLiteServerBoundCertStore
);
55 #endif // CHROME_BROWSER_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_