Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: third_party/leveldatabase/env_chromium.cc

Issue 102873002: Move GetFileSize, NormalizeFilePath to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sql/test/test_helpers.cc ('k') | webkit/browser/database/database_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <string.h> 7 #include <string.h>
8 8
9 #include <deque> 9 #include <deque>
10 10
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 if (!::base::DeleteFile(CreateFilePath(name), false)) { 856 if (!::base::DeleteFile(CreateFilePath(name), false)) {
857 result = MakeIOError(name, "Could not delete directory.", kDeleteDir); 857 result = MakeIOError(name, "Could not delete directory.", kDeleteDir);
858 RecordErrorAt(kDeleteDir); 858 RecordErrorAt(kDeleteDir);
859 } 859 }
860 return result; 860 return result;
861 } 861 }
862 862
863 Status ChromiumEnv::GetFileSize(const std::string& fname, uint64_t* size) { 863 Status ChromiumEnv::GetFileSize(const std::string& fname, uint64_t* size) {
864 Status s; 864 Status s;
865 int64_t signed_size; 865 int64_t signed_size;
866 if (!::file_util::GetFileSize(CreateFilePath(fname), &signed_size)) { 866 if (!::base::GetFileSize(CreateFilePath(fname), &signed_size)) {
867 *size = 0; 867 *size = 0;
868 s = MakeIOError(fname, "Could not determine file size.", kGetFileSize); 868 s = MakeIOError(fname, "Could not determine file size.", kGetFileSize);
869 RecordErrorAt(kGetFileSize); 869 RecordErrorAt(kGetFileSize);
870 } else { 870 } else {
871 *size = static_cast<uint64_t>(signed_size); 871 *size = static_cast<uint64_t>(signed_size);
872 } 872 }
873 return s; 873 return s;
874 } 874 }
875 875
876 Status ChromiumEnv::RenameFile(const std::string& src, const std::string& dst) { 876 Status ChromiumEnv::RenameFile(const std::string& src, const std::string& dst) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 Env* IDBEnv() { 1207 Env* IDBEnv() {
1208 return leveldb_env::idb_env.Pointer(); 1208 return leveldb_env::idb_env.Pointer();
1209 } 1209 }
1210 1210
1211 Env* Env::Default() { 1211 Env* Env::Default() {
1212 return leveldb_env::default_env.Pointer(); 1212 return leveldb_env::default_env.Pointer();
1213 } 1213 }
1214 1214
1215 } // namespace leveldb 1215 } // namespace leveldb
1216 1216
OLDNEW
« no previous file with comments | « sql/test/test_helpers.cc ('k') | webkit/browser/database/database_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698