OLD | NEW |
1 // Copyright (c) 2011 The LevelDB Authors. All rights reserved. | 1 // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. | 3 // found in the LICENSE file. See the AUTHORS file for names of contributors. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 } | 976 } |
977 bool removed = locks_.Remove(my_lock->name_); | 977 bool removed = locks_.Remove(my_lock->name_); |
978 DCHECK(removed); | 978 DCHECK(removed); |
979 delete my_lock; | 979 delete my_lock; |
980 return result; | 980 return result; |
981 } | 981 } |
982 | 982 |
983 Status ChromiumEnv::GetTestDirectory(std::string* path) { | 983 Status ChromiumEnv::GetTestDirectory(std::string* path) { |
984 mu_.Acquire(); | 984 mu_.Acquire(); |
985 if (test_directory_.empty()) { | 985 if (test_directory_.empty()) { |
986 if (!::file_util::CreateNewTempDirectory(kLevelDBTestDirectoryPrefix, | 986 if (!base::CreateNewTempDirectory(kLevelDBTestDirectoryPrefix, |
987 &test_directory_)) { | 987 &test_directory_)) { |
988 mu_.Release(); | 988 mu_.Release(); |
989 RecordErrorAt(kGetTestDirectory); | 989 RecordErrorAt(kGetTestDirectory); |
990 return MakeIOError( | 990 return MakeIOError( |
991 "Could not create temp directory.", "", kGetTestDirectory); | 991 "Could not create temp directory.", "", kGetTestDirectory); |
992 } | 992 } |
993 } | 993 } |
994 *path = FilePathToString(test_directory_); | 994 *path = FilePathToString(test_directory_); |
995 mu_.Release(); | 995 mu_.Release(); |
996 return Status::OK(); | 996 return Status::OK(); |
997 } | 997 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 Env* IDBEnv() { | 1203 Env* IDBEnv() { |
1204 return leveldb_env::idb_env.Pointer(); | 1204 return leveldb_env::idb_env.Pointer(); |
1205 } | 1205 } |
1206 | 1206 |
1207 Env* Env::Default() { | 1207 Env* Env::Default() { |
1208 return leveldb_env::default_env.Pointer(); | 1208 return leveldb_env::default_env.Pointer(); |
1209 } | 1209 } |
1210 | 1210 |
1211 } // namespace leveldb | 1211 } // namespace leveldb |
1212 | 1212 |
OLD | NEW |