Move GetFileSize, NormalizeFilePath to base namespace
BUG=
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/102873002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238722 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: 5628570f1bef7e3fd152bcff189fc13d3fbf5c9b
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index f566efb..f3a7553 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -623,6 +623,22 @@
return true;
}
+bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
+ FilePath real_path_result;
+ if (!RealPath(path, &real_path_result))
+ return false;
+
+ // To be consistant with windows, fail if |real_path_result| is a
+ // directory.
+ stat_wrapper_t file_info;
+ if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
+ S_ISDIR(file_info.st_mode))
+ return false;
+
+ *normalized_path = real_path_result;
+ return true;
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -637,7 +653,6 @@
using base::FileEnumerator;
using base::FilePath;
using base::MakeAbsoluteFilePath;
-using base::RealPath;
using base::VerifySpecificPathControlledByUser;
base::FilePath MakeUniqueDirectory(const base::FilePath& path) {
@@ -804,22 +819,6 @@
return !ret;
}
-bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
- FilePath real_path_result;
- if (!RealPath(path, &real_path_result))
- return false;
-
- // To be consistant with windows, fail if |real_path_result| is a
- // directory.
- stat_wrapper_t file_info;
- if (CallStat(real_path_result.value().c_str(), &file_info) != 0 ||
- S_ISDIR(file_info.st_mode))
- return false;
-
- *normalized_path = real_path_result;
- return true;
-}
-
bool VerifyPathControlledByUser(const FilePath& base,
const FilePath& path,
uid_t owner_uid,