| 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 #include "base/nss_util.h" | 5 #include "base/nss_util.h" |
| 6 #include "base/nss_util_internal.h" | 6 #include "base/nss_util_internal.h" |
| 7 | 7 |
| 8 #include <nss.h> | 8 #include <nss.h> |
| 9 #include <plarena.h> | 9 #include <plarena.h> |
| 10 #include <prerror.h> | 10 #include <prerror.h> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // TODO(wtc): port this function to other USE_NSS platforms. It is defined | 76 // TODO(wtc): port this function to other USE_NSS platforms. It is defined |
| 77 // only for OS_LINUX simply because the statfs structure is OS-specific. | 77 // only for OS_LINUX simply because the statfs structure is OS-specific. |
| 78 void UseLocalCacheOfNSSDatabaseIfNFS(const FilePath& database_dir) { | 78 void UseLocalCacheOfNSSDatabaseIfNFS(const FilePath& database_dir) { |
| 79 #if defined(OS_LINUX) | 79 #if defined(OS_LINUX) |
| 80 struct statfs buf; | 80 struct statfs buf; |
| 81 if (statfs(database_dir.value().c_str(), &buf) == 0) { | 81 if (statfs(database_dir.value().c_str(), &buf) == 0) { |
| 82 if (buf.f_type == NFS_SUPER_MAGIC) { | 82 if (buf.f_type == NFS_SUPER_MAGIC) { |
| 83 scoped_ptr<base::Environment> env(base::Environment::Create()); | 83 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 84 const char* use_cache_env_var = "NSS_SDB_USE_CACHE"; | 84 const char* use_cache_env_var = "NSS_SDB_USE_CACHE"; |
| 85 if (!env->HasVar(use_cache_env_var)) | 85 if (!env->HasVar(use_cache_env_var)) |
| 86 env->SetEnv(use_cache_env_var, "yes"); | 86 env->SetVar(use_cache_env_var, "yes"); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 #endif // defined(OS_LINUX) | 89 #endif // defined(OS_LINUX) |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Load nss's built-in root certs. | 92 // Load nss's built-in root certs. |
| 93 SECMODModule *InitDefaultRootCerts() { | 93 SECMODModule *InitDefaultRootCerts() { |
| 94 const char* kModulePath = "libnssckbi.so"; | 94 const char* kModulePath = "libnssckbi.so"; |
| 95 char modparams[1024]; | 95 char modparams[1024]; |
| 96 snprintf(modparams, sizeof(modparams), | 96 snprintf(modparams, sizeof(modparams), |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 exploded.millisecond = prxtime.tm_usec / 1000; | 328 exploded.millisecond = prxtime.tm_usec / 1000; |
| 329 | 329 |
| 330 return Time::FromUTCExploded(exploded); | 330 return Time::FromUTCExploded(exploded); |
| 331 } | 331 } |
| 332 | 332 |
| 333 PK11SlotInfo* GetDefaultNSSKeySlot() { | 333 PK11SlotInfo* GetDefaultNSSKeySlot() { |
| 334 return Singleton<NSSInitSingleton>::get()->GetDefaultKeySlot(); | 334 return Singleton<NSSInitSingleton>::get()->GetDefaultKeySlot(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace base | 337 } // namespace base |
| OLD | NEW |