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

Unified Diff: base/files/file_util_posix.cc

Issue 2875563002: base: get rid of RealPath() function (Closed)
Patch Set: Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util_posix.cc
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index bc74b940539b25310809e55bc2952d0f9f8a55cd..37c24e9c4eb9f81106cc9b983a25d2bdbfebaea2 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -87,17 +87,6 @@ static int CallLstat(const char *path, stat_wrapper_t *sb) {
#endif // !(defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL))
#if !defined(OS_NACL_NONSFI)
-// Helper for NormalizeFilePath(), defined below.
-bool RealPath(const FilePath& path, FilePath* real_path) {
- ThreadRestrictions::AssertIOAllowed(); // For realpath().
- FilePath::CharType buf[PATH_MAX];
- if (!realpath(path.value().c_str(), buf))
- return false;
-
- *real_path = FilePath(buf);
- return true;
-}
-
// Helper for VerifyPathControlledByUser.
bool VerifySpecificPathControlledByUser(const FilePath& path,
uid_t owner_uid,
@@ -677,8 +666,8 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
}
bool NormalizeFilePath(const FilePath& path, FilePath* normalized_path) {
- FilePath real_path_result;
- if (!RealPath(path, &real_path_result))
+ FilePath real_path_result = MakeAbsoluteFilePath(path);
+ if (real_path_result.empty())
return false;
// To be consistant with windows, fail if |real_path_result| is a
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698