Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: net/cert/nss_cert_database.cc

Issue 556243003: Make the private slot optional in NSSCertDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/nss_cert_database.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database.cc
diff --git a/net/cert/nss_cert_database.cc b/net/cert/nss_cert_database.cc
index 0d24ea6e03a52e23b6e36140ff7e08fa3084961a..9707973d753037b18914b71d569280282b38dfdd 100644
--- a/net/cert/nss_cert_database.cc
+++ b/net/cert/nss_cert_database.cc
@@ -84,8 +84,7 @@ NSSCertDatabase::NSSCertDatabase(crypto::ScopedPK11Slot public_slot,
private_slot_(private_slot.Pass()),
observer_list_(new ObserverListThreadSafe<Observer>),
weak_factory_(this) {
- DCHECK(public_slot_);
- DCHECK(private_slot_);
+ CHECK(public_slot_);
// This also makes sure that NSS has been initialized.
CertDatabase* cert_db = CertDatabase::GetInstance();
@@ -141,6 +140,8 @@ crypto::ScopedPK11Slot NSSCertDatabase::GetPublicSlot() const {
}
crypto::ScopedPK11Slot NSSCertDatabase::GetPrivateSlot() const {
+ if (!private_slot_)
+ return crypto::ScopedPK11Slot();
return crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get()));
}
« no previous file with comments | « net/cert/nss_cert_database.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698