Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_NSS_UTIL_H_ | 5 #ifndef BASE_NSS_UTIL_H_ |
| 6 #define BASE_NSS_UTIL_H_ | 6 #define BASE_NSS_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 // Initialize NRPR if it isn't already initialized. This function is | 30 // Initialize NRPR if it isn't already initialized. This function is |
| 31 // thread-safe, and NSPR will only ever be initialized once. NSPR will be | 31 // thread-safe, and NSPR will only ever be initialized once. NSPR will be |
| 32 // properly shut down on program exit. | 32 // properly shut down on program exit. |
| 33 void EnsureNSPRInit(); | 33 void EnsureNSPRInit(); |
| 34 | 34 |
| 35 // Initialize NSS if it isn't already initialized. This must be called before | 35 // Initialize NSS if it isn't already initialized. This must be called before |
| 36 // any other NSS functions. This function is thread-safe, and NSS will only | 36 // any other NSS functions. This function is thread-safe, and NSS will only |
| 37 // ever be initialized once. NSS will be properly shut down on program exit. | 37 // ever be initialized once. NSS will be properly shut down on program exit. |
| 38 void EnsureNSSInit(); | 38 void EnsureNSSInit(); |
| 39 | 39 |
| 40 // Call this before calling EnsureNSSInit() will force NSS to initialize | |
| 41 // without a persistent DB. This is used for the special case where access of | |
| 42 // persistent DB is prohibited. | |
|
wtc
2011/03/15 21:37:20
Please document that this function is applicable t
| |
| 43 // | |
| 44 // NSS will be initialized without loading any user security modules, including | |
| 45 // the built-in root certificates module. User security modules need to be | |
| 46 // loaded manually after NSS initialization. | |
|
wtc
2011/03/15 21:37:20
I still think omitting the InitDefaultRootCerts ca
| |
| 47 // | |
| 48 // If EnsureNSSInit() is called before then this function has no effect. | |
| 49 // | |
| 50 // WARNING: Use this with caution. | |
| 51 void ForceNSSNoDBInit(); | |
| 52 | |
| 53 // This methods is used to disable checks in NSS when used in a forked process. | |
| 54 // NSS is fork-sensitive to avoid problems when using user security modules in | |
|
wtc
2011/03/15 21:37:20
Nit: what does "fork-sensitive" mean? Please rewo
| |
| 55 // a forked process. However if we are sure there are no modules loaded before | |
| 56 // the process is forked then there is no harm disabling the check. | |
| 57 // | |
| 58 // This method must be called before EnsureNSSInit() to take effect. | |
| 59 // | |
| 60 // WARNING: Use this with caution. | |
| 61 void DisableNSSForkCheck(); | |
| 62 | |
| 40 // Check if the current NSS version is greater than or equals to |version|. | 63 // Check if the current NSS version is greater than or equals to |version|. |
| 41 // A sample version string is "3.12.3". | 64 // A sample version string is "3.12.3". |
| 42 bool CheckNSSVersion(const char* version); | 65 bool CheckNSSVersion(const char* version); |
| 43 | 66 |
| 44 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
| 45 // Open the r/w nssdb that's stored inside the user's encrypted home directory. | 68 // Open the r/w nssdb that's stored inside the user's encrypted home directory. |
| 46 void OpenPersistentNSSDB(); | 69 void OpenPersistentNSSDB(); |
| 47 #endif | 70 #endif |
| 48 | 71 |
| 49 // Convert a NSS PRTime value into a base::Time object. | 72 // Convert a NSS PRTime value into a base::Time object. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 76 private: | 99 private: |
| 77 Lock *lock_; | 100 Lock *lock_; |
| 78 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 101 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
| 79 }; | 102 }; |
| 80 | 103 |
| 81 #endif // defined(USE_NSS) | 104 #endif // defined(USE_NSS) |
| 82 | 105 |
| 83 } // namespace base | 106 } // namespace base |
| 84 | 107 |
| 85 #endif // BASE_NSS_UTIL_H_ | 108 #endif // BASE_NSS_UTIL_H_ |
| OLD | NEW |