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

Side by Side Diff: crypto/nss_util_internal.h

Issue 401623006: Extract ScopedTestNSSDB from nss_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl format Created 6 years, 5 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
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 #ifndef CRYPTO_NSS_UTIL_INTERNAL_H_ 5 #ifndef CRYPTO_NSS_UTIL_INTERNAL_H_
6 #define CRYPTO_NSS_UTIL_INTERNAL_H_ 6 #define CRYPTO_NSS_UTIL_INTERNAL_H_
7 7
8 #include <secmodt.h> 8 #include <secmodt.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "crypto/crypto_export.h" 12 #include "crypto/crypto_export.h"
13 #include "crypto/scoped_nss_types.h" 13 #include "crypto/scoped_nss_types.h"
14 14
15 namespace base { 15 namespace base {
16 class FilePath; 16 class FilePath;
17 } 17 }
18 18
19 // These functions return a type defined in an NSS header, and so cannot be 19 // These functions return a type defined in an NSS header, and so cannot be
20 // declared in nss_util.h. Hence, they are declared here. 20 // declared in nss_util.h. Hence, they are declared here.
21 21
22 namespace crypto { 22 namespace crypto {
23 23
24 #if defined(USE_NSS)
25 // Opens a user database in folder |path|. Returns the slot for the opened
26 // database. Returns NULL if the database couln't be opened.
Ryan Sleevi 2014/07/22 01:25:32 This is not really a "user" DB concept, and I thin
pneubeck (no reviews) 2014/07/22 14:11:05 Done.
27 ScopedPK11Slot OpenUserDB(const base::FilePath& path,
28 const std::string& description);
29
30 #if !defined(OS_CHROMEOS)
24 // Returns a reference to the default NSS key slot for storing persistent data. 31 // Returns a reference to the default NSS key slot for storing persistent data.
25 // Caller must release returned reference with PK11_FreeSlot. 32 // Caller must release returned reference with PK11_FreeSlot.
26 // TODO(mattm): this should be if !defined(OS_CHROMEOS), but some tests need to 33 // TODO(mattm): this should be if !defined(OS_CHROMEOS), but some tests need to
27 // be fixed first. 34 // be fixed first.
Ryan Sleevi 2014/07/22 01:25:32 Guess you can remove lines 33-34 :)
pneubeck (no reviews) 2014/07/22 14:11:05 Done.
28 CRYPTO_EXPORT PK11SlotInfo* GetPersistentNSSKeySlot() WARN_UNUSED_RESULT; 35 CRYPTO_EXPORT PK11SlotInfo* GetPersistentNSSKeySlot() WARN_UNUSED_RESULT;
36 #endif
37 #endif
29 38
30 // A helper class that acquires the SECMOD list read lock while the 39 // A helper class that acquires the SECMOD list read lock while the
31 // AutoSECMODListReadLock is in scope. 40 // AutoSECMODListReadLock is in scope.
32 class CRYPTO_EXPORT AutoSECMODListReadLock { 41 class CRYPTO_EXPORT AutoSECMODListReadLock {
33 public: 42 public:
34 AutoSECMODListReadLock(); 43 AutoSECMODListReadLock();
35 ~AutoSECMODListReadLock(); 44 ~AutoSECMODListReadLock();
36 45
37 private: 46 private:
38 SECMODListLock* lock_; 47 SECMODListLock* lock_;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // loaded and |callback| is non-null, the |callback| will be run once the slot 92 // loaded and |callback| is non-null, the |callback| will be run once the slot
84 // is loaded. 93 // is loaded.
85 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( 94 CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser(
86 const std::string& username_hash, 95 const std::string& username_hash,
87 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; 96 const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT;
88 #endif // defined(OS_CHROMEOS) 97 #endif // defined(OS_CHROMEOS)
89 98
90 } // namespace crypto 99 } // namespace crypto
91 100
92 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_ 101 #endif // CRYPTO_NSS_UTIL_INTERNAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698