| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ORIGIN_BOUND_CERT_STORE_H_ | 5 #ifndef NET_BASE_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ |
| 6 #define NET_BASE_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ | 6 #define NET_BASE_DEFAULT_ORIGIN_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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // WARNING: THE CALLBACK WILL RUN ON A RANDOM THREAD. IT MUST BE THREAD SAFE. | 50 // WARNING: THE CALLBACK WILL RUN ON A RANDOM THREAD. IT MUST BE THREAD SAFE. |
| 51 // It may be posted to the current thread, or it may run on the thread that | 51 // It may be posted to the current thread, or it may run on the thread that |
| 52 // actually does the flushing. Your Task should generally post a notification | 52 // actually does the flushing. Your Task should generally post a notification |
| 53 // to the thread you actually want to be notified on. | 53 // to the thread you actually want to be notified on. |
| 54 void FlushStore(Task* completion_task); | 54 void FlushStore(Task* completion_task); |
| 55 | 55 |
| 56 // OriginBoundCertStore implementation. | 56 // OriginBoundCertStore implementation. |
| 57 virtual bool GetOriginBoundCert(const std::string& origin, | 57 virtual bool GetOriginBoundCert(const std::string& origin, |
| 58 std::string* private_key_result, | 58 std::string* private_key_result, |
| 59 std::string* cert_result) OVERRIDE; | 59 std::string* cert_result) OVERRIDE; |
| 60 virtual bool SetOriginBoundCert(const std::string& origin, | 60 virtual void SetOriginBoundCert(const std::string& origin, |
| 61 const std::string& private_key, | 61 const std::string& private_key, |
| 62 const std::string& cert) OVERRIDE; | 62 const std::string& cert) OVERRIDE; |
| 63 virtual void DeleteOriginBoundCert(const std::string& origin) OVERRIDE; |
| 64 virtual void DeleteAll() OVERRIDE; |
| 65 virtual void GetAllOriginBoundCerts( |
| 66 std::vector<OriginBoundCertInfo>* origin_bound_certs) OVERRIDE; |
| 63 virtual int GetCertCount() OVERRIDE; | 67 virtual int GetCertCount() OVERRIDE; |
| 64 | 68 |
| 65 private: | 69 private: |
| 66 static const size_t kMaxCerts; | 70 static const size_t kMaxCerts; |
| 67 | 71 |
| 68 // Deletes all of the certs. Does not delete them from |store_|. | 72 // Deletes all of the certs. Does not delete them from |store_|. |
| 69 void DeleteAll(); | 73 void DeleteAllInMemory(); |
| 70 | 74 |
| 71 // Called by all non-static functions to ensure that the cert store has | 75 // Called by all non-static functions to ensure that the cert store has |
| 72 // been initialized. This is not done during creating so it doesn't block | 76 // been initialized. This is not done during creating so it doesn't block |
| 73 // the window showing. | 77 // the window showing. |
| 74 // Note: this method should always be called with lock_ held. | 78 // Note: this method should always be called with lock_ held. |
| 75 void InitIfNecessary() { | 79 void InitIfNecessary() { |
| 76 if (!initialized_) { | 80 if (!initialized_) { |
| 77 if (store_) | 81 if (store_) |
| 78 InitStore(); | 82 InitStore(); |
| 79 initialized_ = true; | 83 initialized_ = true; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 protected: | 159 protected: |
| 156 PersistentStore(); | 160 PersistentStore(); |
| 157 | 161 |
| 158 private: | 162 private: |
| 159 DISALLOW_COPY_AND_ASSIGN(PersistentStore); | 163 DISALLOW_COPY_AND_ASSIGN(PersistentStore); |
| 160 }; | 164 }; |
| 161 | 165 |
| 162 } // namespace net | 166 } // namespace net |
| 163 | 167 |
| 164 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ | 168 #endif // NET_DEFAULT_ORIGIN_BOUND_CERT_STORE_H_ |
| OLD | NEW |