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 #include "net/base/default_origin_bound_cert_store.h" | 5 #include "net/base/default_origin_bound_cert_store.h" |
6 | 6 |
| 7 #include "base/bind.h" |
7 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
8 | 9 |
9 namespace net { | 10 namespace net { |
10 | 11 |
11 // static | 12 // static |
12 const size_t DefaultOriginBoundCertStore::kMaxCerts = 3300; | 13 const size_t DefaultOriginBoundCertStore::kMaxCerts = 3300; |
13 | 14 |
14 DefaultOriginBoundCertStore::DefaultOriginBoundCertStore( | 15 DefaultOriginBoundCertStore::DefaultOriginBoundCertStore( |
15 PersistentStore* store) | 16 PersistentStore* store) |
16 : initialized_(false), | 17 : initialized_(false), |
17 store_(store) {} | 18 store_(store) {} |
18 | 19 |
19 void DefaultOriginBoundCertStore::FlushStore(Task* completion_task) { | 20 void DefaultOriginBoundCertStore::FlushStore( |
| 21 const base::Closure& completion_task) { |
20 base::AutoLock autolock(lock_); | 22 base::AutoLock autolock(lock_); |
21 | 23 |
22 if (initialized_ && store_) | 24 if (initialized_ && store_) |
23 store_->Flush(completion_task); | 25 store_->Flush(completion_task); |
24 else if (completion_task) | 26 else if (!completion_task.is_null()) |
25 MessageLoop::current()->PostTask(FROM_HERE, completion_task); | 27 MessageLoop::current()->PostTask(FROM_HERE, completion_task); |
26 } | 28 } |
27 | 29 |
28 bool DefaultOriginBoundCertStore::GetOriginBoundCert( | 30 bool DefaultOriginBoundCertStore::GetOriginBoundCert( |
29 const std::string& origin, | 31 const std::string& origin, |
30 std::string* private_key_result, | 32 std::string* private_key_result, |
31 std::string* cert_result) { | 33 std::string* cert_result) { |
32 base::AutoLock autolock(lock_); | 34 base::AutoLock autolock(lock_); |
33 InitIfNecessary(); | 35 InitIfNecessary(); |
34 | 36 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 const std::string& origin, | 166 const std::string& origin, |
165 const std::string& private_key, | 167 const std::string& private_key, |
166 const std::string& cert) | 168 const std::string& cert) |
167 : origin_(origin), | 169 : origin_(origin), |
168 private_key_(private_key), | 170 private_key_(private_key), |
169 cert_(cert) {} | 171 cert_(cert) {} |
170 | 172 |
171 DefaultOriginBoundCertStore::PersistentStore::PersistentStore() {} | 173 DefaultOriginBoundCertStore::PersistentStore::PersistentStore() {} |
172 | 174 |
173 } // namespace net | 175 } // namespace net |
OLD | NEW |