| 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/cert_database.h" | 5 #include "net/cert/cert_database.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 #include <secmod.h> | 9 #include <secmod.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/observer_list_threadsafe.h" | 14 #include "base/observer_list_threadsafe.h" |
| 15 #include "crypto/nss_util.h" | 15 #include "crypto/nss_util.h" |
| 16 #include "crypto/scoped_nss_types.h" | 16 #include "crypto/scoped_nss_types.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "net/cert/x509_certificate.h" | 18 #include "net/cert/x509_certificate.h" |
| 19 #include "net/cert/x509_util_nss.h" | 19 #include "net/cert/x509_util_nss.h" |
| 20 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" | 20 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" |
| 21 #include "base/trace_event/trace_event.h" |
| 21 | 22 |
| 22 // PSM = Mozilla's Personal Security Manager. | 23 // PSM = Mozilla's Personal Security Manager. |
| 23 namespace psm = mozilla_security_manager; | 24 namespace psm = mozilla_security_manager; |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| 26 | 27 |
| 27 CertDatabase::CertDatabase() | 28 CertDatabase::CertDatabase() |
| 28 : observer_list_(new base::ObserverListThreadSafe<Observer>) { | 29 : observer_list_(new base::ObserverListThreadSafe<Observer>) { |
| 29 crypto::EnsureNSSInit(); | 30 crypto::EnsureNSSInit(); |
| 30 } | 31 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 59 cert_list.push_back(cert_obj); | 60 cert_list.push_back(cert_obj); |
| 60 int result = psm::ImportUserCert(cert_list); | 61 int result = psm::ImportUserCert(cert_list); |
| 61 | 62 |
| 62 if (result == OK) | 63 if (result == OK) |
| 63 NotifyObserversOfCertAdded(NULL); | 64 NotifyObserversOfCertAdded(NULL); |
| 64 | 65 |
| 65 return result; | 66 return result; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace net | 69 } // namespace net |
| OLD | NEW |