OLD | NEW |
---|---|
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_H_ | 5 #ifndef CRYPTO_NSS_UTIL_H_ |
6 #define CRYPTO_NSS_UTIL_H_ | 6 #define CRYPTO_NSS_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 DISALLOW_COPY_AND_ASSIGN(ScopedTestNSSChromeOSUser); | 141 DISALLOW_COPY_AND_ASSIGN(ScopedTestNSSChromeOSUser); |
142 }; | 142 }; |
143 #endif | 143 #endif |
144 | 144 |
145 // Convert a NSS PRTime value into a base::Time object. | 145 // Convert a NSS PRTime value into a base::Time object. |
146 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 146 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
147 CRYPTO_EXPORT base::Time PRTimeToBaseTime(int64 prtime); | 147 CRYPTO_EXPORT base::Time PRTimeToBaseTime(int64 prtime); |
148 | 148 |
149 // Convert a base::Time object into a PRTime value. | 149 // Convert a base::Time object into a PRTime value. |
150 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. | 150 // We use a int64 instead of PRTime here to avoid depending on NSPR headers. |
151 CRYPTO_EXPORT int64 BaseTimeToPRTime(base::Time time); | 151 CRYPTO_EXPORT int64 BaseTimeToPRTime(const base::Time& time); |
wtc
2014/02/04 01:26:02
Are you sure this change is necessary? base::Time
Lei Zhang
2014/02/04 01:34:21
It just stood out since we generally pass by const
| |
152 | 152 |
153 #if defined(USE_NSS) | 153 #if defined(USE_NSS) |
154 // Exposed for unittests only. | 154 // Exposed for unittests only. |
155 // TODO(mattm): When NSS 3.14 is the minimum version required, | 155 // TODO(mattm): When NSS 3.14 is the minimum version required, |
156 // switch back to using a separate user DB for each test. | 156 // switch back to using a separate user DB for each test. |
157 // Because of https://bugzilla.mozilla.org/show_bug.cgi?id=588269 , the | 157 // Because of https://bugzilla.mozilla.org/show_bug.cgi?id=588269 , the |
158 // opened user DB is not automatically closed. | 158 // opened user DB is not automatically closed. |
159 class CRYPTO_EXPORT_PRIVATE ScopedTestNSSDB { | 159 class CRYPTO_EXPORT_PRIVATE ScopedTestNSSDB { |
160 public: | 160 public: |
161 ScopedTestNSSDB(); | 161 ScopedTestNSSDB(); |
(...skipping 25 matching lines...) Expand all Loading... | |
187 private: | 187 private: |
188 base::Lock *lock_; | 188 base::Lock *lock_; |
189 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); | 189 DISALLOW_COPY_AND_ASSIGN(AutoNSSWriteLock); |
190 }; | 190 }; |
191 | 191 |
192 #endif // defined(USE_NSS) | 192 #endif // defined(USE_NSS) |
193 | 193 |
194 } // namespace crypto | 194 } // namespace crypto |
195 | 195 |
196 #endif // CRYPTO_NSS_UTIL_H_ | 196 #endif // CRYPTO_NSS_UTIL_H_ |
OLD | NEW |