| 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 #include "crypto/nss_util.h" | 5 #include "crypto/nss_util.h" |
| 6 #include "crypto/nss_util_internal.h" | 6 #include "crypto/nss_util_internal.h" |
| 7 | 7 |
| 8 #include <nss.h> | 8 #include <nss.h> |
| 9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
| 10 #include <plarena.h> | 10 #include <plarena.h> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // | 139 // |
| 140 // TODO(wtc): port this function to other USE_NSS platforms. It is defined | 140 // TODO(wtc): port this function to other USE_NSS platforms. It is defined |
| 141 // only for OS_LINUX and OS_OPENBSD simply because the statfs structure | 141 // only for OS_LINUX and OS_OPENBSD simply because the statfs structure |
| 142 // is OS-specific. | 142 // is OS-specific. |
| 143 // | 143 // |
| 144 // Because this function sets an environment variable it must be run before we | 144 // Because this function sets an environment variable it must be run before we |
| 145 // go multi-threaded. | 145 // go multi-threaded. |
| 146 void UseLocalCacheOfNSSDatabaseIfNFS(const base::FilePath& database_dir) { | 146 void UseLocalCacheOfNSSDatabaseIfNFS(const base::FilePath& database_dir) { |
| 147 bool db_on_nfs = false; | 147 bool db_on_nfs = false; |
| 148 #if defined(OS_LINUX) | 148 #if defined(OS_LINUX) |
| 149 file_util::FileSystemType fs_type = file_util::FILE_SYSTEM_UNKNOWN; | 149 base::FileSystemType fs_type = base::FILE_SYSTEM_UNKNOWN; |
| 150 if (file_util::GetFileSystemType(database_dir, &fs_type)) | 150 if (base::GetFileSystemType(database_dir, &fs_type)) |
| 151 db_on_nfs = (fs_type == file_util::FILE_SYSTEM_NFS); | 151 db_on_nfs = (fs_type == base::FILE_SYSTEM_NFS); |
| 152 #elif defined(OS_OPENBSD) | 152 #elif defined(OS_OPENBSD) |
| 153 struct statfs buf; | 153 struct statfs buf; |
| 154 if (statfs(database_dir.value().c_str(), &buf) == 0) | 154 if (statfs(database_dir.value().c_str(), &buf) == 0) |
| 155 db_on_nfs = (strcmp(buf.f_fstypename, MOUNT_NFS) == 0); | 155 db_on_nfs = (strcmp(buf.f_fstypename, MOUNT_NFS) == 0); |
| 156 #else | 156 #else |
| 157 NOTIMPLEMENTED(); | 157 NOTIMPLEMENTED(); |
| 158 #endif | 158 #endif |
| 159 | 159 |
| 160 if (db_on_nfs) { | 160 if (db_on_nfs) { |
| 161 scoped_ptr<base::Environment> env(base::Environment::Create()); | 161 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 | 1149 |
| 1150 PK11SlotInfo* GetPublicNSSKeySlot() { | 1150 PK11SlotInfo* GetPublicNSSKeySlot() { |
| 1151 return g_nss_singleton.Get().GetPublicNSSKeySlot(); | 1151 return g_nss_singleton.Get().GetPublicNSSKeySlot(); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 PK11SlotInfo* GetPrivateNSSKeySlot() { | 1154 PK11SlotInfo* GetPrivateNSSKeySlot() { |
| 1155 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); | 1155 return g_nss_singleton.Get().GetPrivateNSSKeySlot(); |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 } // namespace crypto | 1158 } // namespace crypto |
| OLD | NEW |