| 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/base/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 "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/observer_list_threadsafe.h" | 12 #include "base/observer_list_threadsafe.h" |
| 13 #include "crypto/nss_util.h" | 13 #include "crypto/nss_util.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/base/nss_cert_database.h" | 15 #include "net/cert/nss_cert_database.h" |
| 16 #include "net/base/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 // Helper that observes events from the NSSCertDatabase and forwards them to | 20 // Helper that observes events from the NSSCertDatabase and forwards them to |
| 21 // the given CertDatabase. | 21 // the given CertDatabase. |
| 22 class CertDatabase::Notifier : public NSSCertDatabase::Observer { | 22 class CertDatabase::Notifier : public NSSCertDatabase::Observer { |
| 23 public: | 23 public: |
| 24 explicit Notifier(CertDatabase* cert_db) : cert_db_(cert_db) { | 24 explicit Notifier(CertDatabase* cert_db) : cert_db_(cert_db) { |
| 25 NSSCertDatabase::GetInstance()->AddObserver(this); | 25 NSSCertDatabase::GetInstance()->AddObserver(this); |
| 26 } | 26 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 if (!slot) { | 95 if (!slot) { |
| 96 LOG(ERROR) << "Couldn't import user certificate."; | 96 LOG(ERROR) << "Couldn't import user certificate."; |
| 97 return ERR_ADD_USER_CERT_FAILED; | 97 return ERR_ADD_USER_CERT_FAILED; |
| 98 } | 98 } |
| 99 PK11_FreeSlot(slot); | 99 PK11_FreeSlot(slot); |
| 100 NotifyObserversOfCertAdded(cert_obj); | 100 NotifyObserversOfCertAdded(cert_obj); |
| 101 return OK; | 101 return OK; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace net | 104 } // namespace net |
| OLD | NEW |