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 <string> |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 | 11 |
11 #if defined(USE_NSS) | 12 #if defined(USE_NSS) |
12 class FilePath; | 13 class FilePath; |
13 #endif // defined(USE_NSS) | 14 #endif // defined(USE_NSS) |
14 | 15 |
15 // This file specifically doesn't depend on any NSS or NSPR headers because it | 16 // This file specifically doesn't depend on any NSS or NSPR headers because it |
16 // is included by various (non-crypto) parts of chrome to call the | 17 // is included by various (non-crypto) parts of chrome to call the |
17 // initialization functions. | 18 // initialization functions. |
18 namespace base { | 19 namespace base { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // WARNING: Use this with caution. | 66 // WARNING: Use this with caution. |
66 void DisableNSSForkCheck(); | 67 void DisableNSSForkCheck(); |
67 | 68 |
68 // Check if the current NSS version is greater than or equals to |version|. | 69 // Check if the current NSS version is greater than or equals to |version|. |
69 // A sample version string is "3.12.3". | 70 // A sample version string is "3.12.3". |
70 bool CheckNSSVersion(const char* version); | 71 bool CheckNSSVersion(const char* version); |
71 | 72 |
72 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
73 // Open the r/w nssdb that's stored inside the user's encrypted home directory. | 74 // Open the r/w nssdb that's stored inside the user's encrypted home directory. |
74 void OpenPersistentNSSDB(); | 75 void OpenPersistentNSSDB(); |
| 76 |
| 77 // Get name for the built-in TPM token on ChromeOS. |
| 78 std::string GetTPMTokenName(); |
75 #endif | 79 #endif |
76 | 80 |
77 // Convert a NSS PRTime value into a base::Time object. | 81 // Convert a NSS PRTime value into a base::Time object. |
78 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 82 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
79 Time PRTimeToBaseTime(int64 prtime); | 83 Time PRTimeToBaseTime(int64 prtime); |
80 | 84 |
81 #if defined(USE_NSS) | 85 #if defined(USE_NSS) |
82 // Exposed for unittests only. |path| should be an existing directory under | 86 // Exposed for unittests only. |path| should be an existing directory under |
83 // which the DB files will be placed. |description| is a user-visible name for | 87 // which the DB files will be placed. |description| is a user-visible name for |
84 // the DB, as a utf8 string, which will be truncated at 32 bytes. | 88 // the DB, as a utf8 string, which will be truncated at 32 bytes. |
(...skipping 19 matching lines...) Expand all Loading... |
104 private: | 108 private: |
105 Lock *lock_; | 109 Lock *lock_; |
106 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 110 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
107 }; | 111 }; |
108 | 112 |
109 #endif // defined(USE_NSS) | 113 #endif // defined(USE_NSS) |
110 | 114 |
111 } // namespace base | 115 } // namespace base |
112 | 116 |
113 #endif // BASE_NSS_UTIL_H_ | 117 #endif // BASE_NSS_UTIL_H_ |
OLD | NEW |