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 // Initialize NSS without a persistent DB. This is used the special case | |
wtc
2011/03/15 00:21:45
Nit: add "in" or "for" before "the special case"
Alpha Left Google
2011/03/15 01:27:51
Done.
| |
41 // where access of persistent DB is prohibited. This method is only used in | |
42 // the renderer process to enable use of the NSS crypto library. | |
wtc
2011/03/15 00:21:45
Avoid mentioning "renderer process" in the 'base'
Alpha Left Google
2011/03/15 01:27:51
Done.
| |
43 // | |
44 // NSS will be initialized with an empty temporary DB with no root certs. | |
45 // Access to user security modules is also not allowed. | |
wtc
2011/03/15 00:21:45
This should say:
NSS will be initialized without
| |
46 // | |
47 // This function is thread-safe, and NSS will only ever be initialized once. | |
48 // NSS will be properly shut down on program exit. | |
49 // | |
50 // After calling this function, calling EnsureNSSInit() will have no effect. | |
51 // | |
52 // *ONLY USE THIS IN THE RENDERER PROCESS* | |
wtc
2011/03/15 00:21:45
This warning should be removed, or made more gener
Alpha Left Google
2011/03/15 01:27:51
Done.
| |
53 void EnsureNSSNoDBInit(); | |
54 | |
55 // This methos is used to disable checks in NSS when used in a forked process. | |
wtc
2011/03/15 00:21:45
Typo: methos => method
Please document that Disab
Alpha Left Google
2011/03/15 01:27:51
Done.
| |
56 // NSS is fork-sensitive to avoid problems when using user security modules in | |
57 // a forked process. However if we are sure there are no modules loaded before | |
58 // the process is forked then there is no harm disabling the check. | |
59 // | |
60 // *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 |