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_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ | 5 #ifndef NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ |
6 #define NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ | 6 #define NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Deletes all of the certs. Does not delete them from |store_|. | 83 // Deletes all of the certs. Does not delete them from |store_|. |
84 void DeleteAllInMemory(); | 84 void DeleteAllInMemory(); |
85 | 85 |
86 // Called by all non-static functions to ensure that the cert store has | 86 // Called by all non-static functions to ensure that the cert store has |
87 // been initialized. | 87 // been initialized. |
88 // TODO(mattm): since we load asynchronously now, maybe we should start | 88 // TODO(mattm): since we load asynchronously now, maybe we should start |
89 // loading immediately on construction, or provide some method to initiate | 89 // loading immediately on construction, or provide some method to initiate |
90 // loading? | 90 // loading? |
91 void InitIfNecessary() { | 91 void InitIfNecessary() { |
92 if (!initialized_) { | 92 if (!initialized_) { |
93 if (store_) { | 93 if (store_.get()) { |
94 InitStore(); | 94 InitStore(); |
95 } else { | 95 } else { |
96 loaded_ = true; | 96 loaded_ = true; |
97 } | 97 } |
98 initialized_ = true; | 98 initialized_ = true; |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 // Initializes the backing store and reads existing certs from it. | 102 // Initializes the backing store and reads existing certs from it. |
103 // Should only be called by InitIfNecessary(). | 103 // Should only be called by InitIfNecessary(). |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 PersistentStore(); | 186 PersistentStore(); |
187 virtual ~PersistentStore(); | 187 virtual ~PersistentStore(); |
188 | 188 |
189 private: | 189 private: |
190 DISALLOW_COPY_AND_ASSIGN(PersistentStore); | 190 DISALLOW_COPY_AND_ASSIGN(PersistentStore); |
191 }; | 191 }; |
192 | 192 |
193 } // namespace net | 193 } // namespace net |
194 | 194 |
195 #endif // NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ | 195 #endif // NET_SSL_DEFAULT_SERVER_BOUND_CERT_STORE_H_ |
OLD | NEW |