| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chromeos/cert_loader.h" | 5 #include "chromeos/cert_loader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 void CertLoader::CertificatesLoaded( | 202 void CertLoader::CertificatesLoaded( |
| 203 std::unique_ptr<net::CertificateList> all_certs) { | 203 std::unique_ptr<net::CertificateList> all_certs) { |
| 204 DCHECK(thread_checker_.CalledOnValidThread()); | 204 DCHECK(thread_checker_.CalledOnValidThread()); |
| 205 VLOG(1) << "CertificatesLoaded: " << all_certs->size(); | 205 VLOG(1) << "CertificatesLoaded: " << all_certs->size(); |
| 206 | 206 |
| 207 crypto::ScopedPK11Slot system_slot = database_->GetSystemSlot(); | 207 crypto::ScopedPK11Slot system_slot = database_->GetSystemSlot(); |
| 208 base::PostTaskWithTraitsAndReplyWithResult( | 208 base::PostTaskWithTraitsAndReplyWithResult( |
| 209 FROM_HERE, | 209 FROM_HERE, |
| 210 base::TaskTraits() | 210 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 211 .WithShutdownBehavior( | |
| 212 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) | |
| 213 .MayBlock(), | |
| 214 base::BindOnce(&FilterSystemTokenCertificates, | 211 base::BindOnce(&FilterSystemTokenCertificates, |
| 215 base::Unretained(all_certs.get()), std::move(system_slot)), | 212 base::Unretained(all_certs.get()), std::move(system_slot)), |
| 216 base::BindOnce(&CertLoader::UpdateCertificates, | 213 base::BindOnce(&CertLoader::UpdateCertificates, |
| 217 weak_factory_.GetWeakPtr(), std::move(all_certs))); | 214 weak_factory_.GetWeakPtr(), std::move(all_certs))); |
| 218 } | 215 } |
| 219 | 216 |
| 220 void CertLoader::UpdateCertificates( | 217 void CertLoader::UpdateCertificates( |
| 221 std::unique_ptr<net::CertificateList> all_certs, | 218 std::unique_ptr<net::CertificateList> all_certs, |
| 222 std::unique_ptr<net::CertificateList> system_certs) { | 219 std::unique_ptr<net::CertificateList> system_certs) { |
| 223 DCHECK(thread_checker_.CalledOnValidThread()); | 220 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 242 for (auto& observer : observers_) | 239 for (auto& observer : observers_) |
| 243 observer.OnCertificatesLoaded(*all_certs_, initial_load); | 240 observer.OnCertificatesLoaded(*all_certs_, initial_load); |
| 244 } | 241 } |
| 245 | 242 |
| 246 void CertLoader::OnCertDBChanged() { | 243 void CertLoader::OnCertDBChanged() { |
| 247 VLOG(1) << "OnCertDBChanged"; | 244 VLOG(1) << "OnCertDBChanged"; |
| 248 LoadCertificates(); | 245 LoadCertificates(); |
| 249 } | 246 } |
| 250 | 247 |
| 251 } // namespace chromeos | 248 } // namespace chromeos |
| OLD | NEW |