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 NET_BASE_DEFAULT_SERVER_BOUND_CERT_STORE_H_ | 5 #ifndef NET_BASE_DEFAULT_SERVER_BOUND_CERT_STORE_H_ |
| 6 #define NET_BASE_DEFAULT_SERVER_BOUND_CERT_STORE_H_ | 6 #define NET_BASE_DEFAULT_SERVER_BOUND_CERT_STORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(DefaultServerBoundCertStore); | 123 DISALLOW_COPY_AND_ASSIGN(DefaultServerBoundCertStore); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 typedef base::RefCountedThreadSafe<DefaultServerBoundCertStore::PersistentStore> | 126 typedef base::RefCountedThreadSafe<DefaultServerBoundCertStore::PersistentStore> |
| 127 RefcountedPersistentStore; | 127 RefcountedPersistentStore; |
| 128 | 128 |
| 129 class NET_EXPORT DefaultServerBoundCertStore::PersistentStore | 129 class NET_EXPORT DefaultServerBoundCertStore::PersistentStore |
| 130 : public RefcountedPersistentStore { | 130 : public RefcountedPersistentStore { |
| 131 public: | 131 public: |
| 132 virtual ~PersistentStore() {} | |
| 133 | |
| 134 // Initializes the store and retrieves the existing certs. This will be | 132 // Initializes the store and retrieves the existing certs. This will be |
| 135 // called only once at startup. Note that the certs are individually allocated | 133 // called only once at startup. Note that the certs are individually allocated |
| 136 // and that ownership is transferred to the caller upon return. | 134 // and that ownership is transferred to the caller upon return. |
| 137 virtual bool Load( | 135 virtual bool Load( |
| 138 std::vector<ServerBoundCert*>* certs) = 0; | 136 std::vector<ServerBoundCert*>* certs) = 0; |
| 139 | 137 |
| 140 virtual void AddServerBoundCert(const ServerBoundCert& cert) = 0; | 138 virtual void AddServerBoundCert(const ServerBoundCert& cert) = 0; |
| 141 | 139 |
| 142 virtual void DeleteServerBoundCert(const ServerBoundCert& cert) = 0; | 140 virtual void DeleteServerBoundCert(const ServerBoundCert& cert) = 0; |
| 143 | 141 |
| 144 // Sets the value of the user preference whether the persistent storage | 142 // Sets the value of the user preference whether the persistent storage |
| 145 // must be deleted upon destruction. | 143 // must be deleted upon destruction. |
| 146 virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0; | 144 virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0; |
| 147 | 145 |
| 148 // Flush the store and post the given Task when complete. | 146 // Flush the store and post the given Task when complete. |
| 149 virtual void Flush(const base::Closure& completion_task) = 0; | 147 virtual void Flush(const base::Closure& completion_task) = 0; |
| 150 | 148 |
| 151 protected: | 149 protected: |
| 150 friend class base::RefCountedThreadSafe<PersistentStore>; | |
|
wtc
2012/04/17 23:16:18
Can we use the RefcountedPersistentStore typedef h
Ryan Sleevi
2012/04/17 23:42:42
I'm not sure that's much better. The use of the ty
| |
| 152 PersistentStore(); | 151 PersistentStore(); |
| 152 virtual ~PersistentStore() {} | |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 DISALLOW_COPY_AND_ASSIGN(PersistentStore); | 155 DISALLOW_COPY_AND_ASSIGN(PersistentStore); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace net | 158 } // namespace net |
| 159 | 159 |
| 160 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ | 160 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ |
| OLD | NEW |