| 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 #include "net/cert/nss_cert_database.h" | 5 #include "net/cert/nss_cert_database.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <certdb.h> | 8 #include <certdb.h> |
| 9 #include <keyhi.h> | 9 #include <keyhi.h> |
| 10 #include <pk11pub.h> | 10 #include <pk11pub.h> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const scoped_refptr<X509Certificate>& cert, | 75 const scoped_refptr<X509Certificate>& cert, |
| 76 int err) | 76 int err) |
| 77 : certificate(cert), net_error(err) {} | 77 : certificate(cert), net_error(err) {} |
| 78 | 78 |
| 79 NSSCertDatabase::ImportCertFailure::~ImportCertFailure() {} | 79 NSSCertDatabase::ImportCertFailure::~ImportCertFailure() {} |
| 80 | 80 |
| 81 NSSCertDatabase::NSSCertDatabase(crypto::ScopedPK11Slot public_slot, | 81 NSSCertDatabase::NSSCertDatabase(crypto::ScopedPK11Slot public_slot, |
| 82 crypto::ScopedPK11Slot private_slot) | 82 crypto::ScopedPK11Slot private_slot) |
| 83 : public_slot_(public_slot.Pass()), | 83 : public_slot_(public_slot.Pass()), |
| 84 private_slot_(private_slot.Pass()), | 84 private_slot_(private_slot.Pass()), |
| 85 observer_list_(new ObserverListThreadSafe<Observer>), | 85 observer_list_(new base::ObserverListThreadSafe<Observer>), |
| 86 weak_factory_(this) { | 86 weak_factory_(this) { |
| 87 CHECK(public_slot_); | 87 CHECK(public_slot_); |
| 88 | 88 |
| 89 // This also makes sure that NSS has been initialized. | 89 // This also makes sure that NSS has been initialized. |
| 90 CertDatabase* cert_db = CertDatabase::GetInstance(); | 90 CertDatabase* cert_db = CertDatabase::GetInstance(); |
| 91 cert_notification_forwarder_.reset(new CertNotificationForwarder(cert_db)); | 91 cert_notification_forwarder_.reset(new CertNotificationForwarder(cert_db)); |
| 92 AddObserver(cert_notification_forwarder_.get()); | 92 AddObserver(cert_notification_forwarder_.get()); |
| 93 | 93 |
| 94 psm::EnsurePKCS12Init(); | 94 psm::EnsurePKCS12Init(); |
| 95 } | 95 } |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } else { | 471 } else { |
| 472 if (SEC_DeletePermCertificate(cert->os_cert_handle())) { | 472 if (SEC_DeletePermCertificate(cert->os_cert_handle())) { |
| 473 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError(); | 473 LOG(ERROR) << "SEC_DeletePermCertificate failed: " << PORT_GetError(); |
| 474 return false; | 474 return false; |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 return true; | 477 return true; |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace net | 480 } // namespace net |
| OLD | NEW |