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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const std::string& private_key, | 69 const std::string& private_key, |
70 const std::string& cert) OVERRIDE; | 70 const std::string& cert) OVERRIDE; |
71 virtual void DeleteServerBoundCert(const std::string& server_identifier) | 71 virtual void DeleteServerBoundCert(const std::string& server_identifier) |
72 OVERRIDE; | 72 OVERRIDE; |
73 virtual void DeleteAllCreatedBetween(base::Time delete_begin, | 73 virtual void DeleteAllCreatedBetween(base::Time delete_begin, |
74 base::Time delete_end) OVERRIDE; | 74 base::Time delete_end) OVERRIDE; |
75 virtual void DeleteAll() OVERRIDE; | 75 virtual void DeleteAll() OVERRIDE; |
76 virtual void GetAllServerBoundCerts( | 76 virtual void GetAllServerBoundCerts( |
77 ServerBoundCertList* server_bound_certs) OVERRIDE; | 77 ServerBoundCertList* server_bound_certs) OVERRIDE; |
78 virtual int GetCertCount() OVERRIDE; | 78 virtual int GetCertCount() OVERRIDE; |
| 79 virtual void SetForceKeepSessionState() OVERRIDE; |
79 | 80 |
80 private: | 81 private: |
81 static const size_t kMaxCerts; | 82 static const size_t kMaxCerts; |
82 | 83 |
83 // Deletes all of the certs. Does not delete them from |store_|. | 84 // Deletes all of the certs. Does not delete them from |store_|. |
84 void DeleteAllInMemory(); | 85 void DeleteAllInMemory(); |
85 | 86 |
86 // Called by all non-static functions to ensure that the cert store has | 87 // Called by all non-static functions to ensure that the cert store has |
87 // been initialized. This is not done during creating so it doesn't block | 88 // been initialized. This is not done during creating so it doesn't block |
88 // the window showing. | 89 // the window showing. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Initializes the store and retrieves the existing certs. This will be | 133 // Initializes the store and retrieves the existing certs. This will be |
133 // called only once at startup. Note that the certs are individually allocated | 134 // called only once at startup. Note that the certs are individually allocated |
134 // and that ownership is transferred to the caller upon return. | 135 // and that ownership is transferred to the caller upon return. |
135 virtual bool Load( | 136 virtual bool Load( |
136 std::vector<ServerBoundCert*>* certs) = 0; | 137 std::vector<ServerBoundCert*>* certs) = 0; |
137 | 138 |
138 virtual void AddServerBoundCert(const ServerBoundCert& cert) = 0; | 139 virtual void AddServerBoundCert(const ServerBoundCert& cert) = 0; |
139 | 140 |
140 virtual void DeleteServerBoundCert(const ServerBoundCert& cert) = 0; | 141 virtual void DeleteServerBoundCert(const ServerBoundCert& cert) = 0; |
141 | 142 |
142 // Sets the value of the user preference whether the persistent storage | 143 // When invoked, instructs the store to keep session related data on |
143 // must be deleted upon destruction. | 144 // destruction. |
144 virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0; | 145 virtual void SetForceKeepSessionState() = 0; |
145 | 146 |
146 // Flush the store and post the given Task when complete. | 147 // Flush the store and post the given Task when complete. |
147 virtual void Flush(const base::Closure& completion_task) = 0; | 148 virtual void Flush(const base::Closure& completion_task) = 0; |
148 | 149 |
149 protected: | 150 protected: |
150 friend class base::RefCountedThreadSafe<PersistentStore>; | 151 friend class base::RefCountedThreadSafe<PersistentStore>; |
151 | 152 |
152 PersistentStore(); | 153 PersistentStore(); |
153 virtual ~PersistentStore(); | 154 virtual ~PersistentStore(); |
154 | 155 |
155 private: | 156 private: |
156 DISALLOW_COPY_AND_ASSIGN(PersistentStore); | 157 DISALLOW_COPY_AND_ASSIGN(PersistentStore); |
157 }; | 158 }; |
158 | 159 |
159 } // namespace net | 160 } // namespace net |
160 | 161 |
161 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ | 162 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ |
OLD | NEW |