Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_ | 5 #ifndef NET_SQLITE_SQLITE_SERVER_BOUND_CERT_STORE_H_ |
| 6 #define CHROME_BROWSER_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_ | 6 #define NET_SQLITE_SQLITE_SERVER_BOUND_CERT_STORE_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "net/ssl/default_server_bound_cert_store.h" | 11 #include "net/ssl/default_server_bound_cert_store.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 class SequencedTaskRunner; | 15 class SequencedTaskRunner; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace quota { | 18 namespace net { |
| 19 class SpecialStoragePolicy; | 19 |
| 20 } | 20 class SpecialStoragePolicyDelegate; |
| 21 | 21 |
| 22 // Implements the net::DefaultServerBoundCertStore::PersistentStore interface | 22 // Implements the net::DefaultServerBoundCertStore::PersistentStore interface |
| 23 // in terms of a SQLite database. For documentation about the actual member | 23 // in terms of a SQLite database. For documentation about the actual member |
| 24 // functions consult the documentation of the parent class | 24 // functions consult the documentation of the parent class |
| 25 // |net::DefaultServerBoundCertStore::PersistentCertStore|. | 25 // |net::DefaultServerBoundCertStore::PersistentCertStore|. |
| 26 // If provided, a |SpecialStoragePolicy| is consulted when the SQLite database | 26 // If provided, a |SpecialStoragePolicy| is consulted when the SQLite database |
| 27 // is closed to decide which certificates to keep. | 27 // is closed to decide which certificates to keep. |
| 28 class SQLiteServerBoundCertStore | 28 class SQLiteServerBoundCertStore |
| 29 : public net::DefaultServerBoundCertStore::PersistentStore { | 29 : public net::DefaultServerBoundCertStore::PersistentStore { |
|
Ryan Sleevi
2014/07/14 20:35:26
drop the net::, it's cleaner that way :)
Througho
mef
2014/07/14 21:36:53
Done.
| |
| 30 public: | 30 public: |
| 31 SQLiteServerBoundCertStore( | 31 SQLiteServerBoundCertStore( |
| 32 const base::FilePath& path, | 32 const base::FilePath& path, |
| 33 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 33 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
| 34 quota::SpecialStoragePolicy* special_storage_policy); | 34 SpecialStoragePolicyDelegate* special_storage_policy); |
|
Ryan Sleevi
2014/07/10 20:20:25
this would/should be a scoped_refptr<>, if you con
mef
2014/07/11 13:29:24
FWIW quota::SpecialStoragePolicy is refcounted, bu
Ryan Sleevi
2014/07/14 19:18:04
Can you explain why it feels wrong?
mef
2014/07/14 20:18:02
Because it means that Store owns a delegate, which
Ryan Sleevi
2014/07/14 20:35:26
1) We should not have new code using Singletons, a
mef
2014/07/14 21:36:53
Acknowledged. Looking at test code passing scoped_
| |
| 35 | 35 |
| 36 // net::DefaultServerBoundCertStore::PersistentStore: | 36 // net::DefaultServerBoundCertStore::PersistentStore: |
| 37 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; | 37 virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; |
| 38 virtual void AddServerBoundCert( | 38 virtual void AddServerBoundCert( |
| 39 const net::DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE; | 39 const net::DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE; |
| 40 virtual void DeleteServerBoundCert( | 40 virtual void DeleteServerBoundCert( |
| 41 const net::DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE; | 41 const net::DefaultServerBoundCertStore::ServerBoundCert& cert) OVERRIDE; |
| 42 virtual void SetForceKeepSessionState() OVERRIDE; | 42 virtual void SetForceKeepSessionState() OVERRIDE; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~SQLiteServerBoundCertStore(); | 45 virtual ~SQLiteServerBoundCertStore(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 class Backend; | 48 class Backend; |
| 49 | 49 |
| 50 scoped_refptr<Backend> backend_; | 50 scoped_refptr<Backend> backend_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(SQLiteServerBoundCertStore); | 52 DISALLOW_COPY_AND_ASSIGN(SQLiteServerBoundCertStore); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_NET_SQLITE_SERVER_BOUND_CERT_STORE_H_ | 55 } // namespace net |
| 56 | |
| 57 #endif // NET_SQLITE_SQLITE_SERVER_BOUND_CERT_STORE_H_ | |
| OLD | NEW |