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

Side by Side Diff: crypto/nss_util.cc

Issue 11196028: Revert 162327 - Implement ScopedTestNSSDB instead of OpenTestNSSDB() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « crypto/nss_util.h ('k') | net/base/nss_cert_database_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "crypto/nss_util.h" 5 #include "crypto/nss_util.h"
6 #include "crypto/nss_util_internal.h" 6 #include "crypto/nss_util_internal.h"
7 7
8 #include <nss.h> 8 #include <nss.h>
9 #include <plarena.h> 9 #include <plarena.h>
10 #include <prerror.h> 10 #include <prerror.h>
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 LOG(ERROR) << "Failed to load NSS libraries."; 695 LOG(ERROR) << "Failed to load NSS libraries.";
696 } 696 }
697 #endif 697 #endif
698 } 698 }
699 699
700 bool CheckNSSVersion(const char* version) { 700 bool CheckNSSVersion(const char* version) {
701 return !!NSS_VersionCheck(version); 701 return !!NSS_VersionCheck(version);
702 } 702 }
703 703
704 #if defined(USE_NSS) 704 #if defined(USE_NSS)
705 ScopedTestNSSDB::ScopedTestNSSDB() 705 bool OpenTestNSSDB() {
706 : is_open_(g_nss_singleton.Get().OpenTestNSSDB()) { 706 return g_nss_singleton.Get().OpenTestNSSDB();
707 }
708
709 ScopedTestNSSDB::~ScopedTestNSSDB() {
710 // TODO(mattm): Close the dababase once NSS 3.14 is required,
711 // which fixes https://bugzilla.mozilla.org/show_bug.cgi?id=588269
712 } 707 }
713 708
714 base::Lock* GetNSSWriteLock() { 709 base::Lock* GetNSSWriteLock() {
715 return g_nss_singleton.Get().write_lock(); 710 return g_nss_singleton.Get().write_lock();
716 } 711 }
717 712
718 AutoNSSWriteLock::AutoNSSWriteLock() : lock_(GetNSSWriteLock()) { 713 AutoNSSWriteLock::AutoNSSWriteLock() : lock_(GetNSSWriteLock()) {
719 // May be NULL if the lock is not needed in our version of NSS. 714 // May be NULL if the lock is not needed in our version of NSS.
720 if (lock_) 715 if (lock_)
721 lock_->Acquire(); 716 lock_->Acquire();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 772
778 PK11SlotInfo* GetPublicNSSKeySlot() { 773 PK11SlotInfo* GetPublicNSSKeySlot() {
779 return g_nss_singleton.Get().GetPublicNSSKeySlot(); 774 return g_nss_singleton.Get().GetPublicNSSKeySlot();
780 } 775 }
781 776
782 PK11SlotInfo* GetPrivateNSSKeySlot() { 777 PK11SlotInfo* GetPrivateNSSKeySlot() {
783 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); 778 return g_nss_singleton.Get().GetPrivateNSSKeySlot();
784 } 779 }
785 780
786 } // namespace crypto 781 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/nss_util.h ('k') | net/base/nss_cert_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698