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

Unified Diff: base/file_util_win.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index be58630ccb403e381daaf6eeddc6a30c82be2941..e65520431d24c2877124dfa179b8954e47a3dcbc 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -390,6 +390,18 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
}
}
+bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
+ ThreadRestrictions::AssertIOAllowed();
+ FilePath mapped_file;
+ if (!file_util::NormalizeToNativeFilePath(path, &mapped_file))
+ return false;
+ // NormalizeToNativeFilePath() will return a path that starts with
+ // "\Device\Harddisk...". Helper DevicePathToDriveLetterPath()
+ // will find a drive letter which maps to the path's device, so
+ // that we return a path starting with a drive letter.
+ return file_util::DevicePathToDriveLetterPath(mapped_file, real_path);
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -547,18 +559,6 @@ bool SetCurrentDirectory(const FilePath& directory) {
return ret != 0;
}
-bool NormalizeFilePath(const FilePath& path, FilePath* real_path) {
- base::ThreadRestrictions::AssertIOAllowed();
- FilePath mapped_file;
- if (!NormalizeToNativeFilePath(path, &mapped_file))
- return false;
- // NormalizeToNativeFilePath() will return a path that starts with
- // "\Device\Harddisk...". Helper DevicePathToDriveLetterPath()
- // will find a drive letter which maps to the path's device, so
- // that we return a path starting with a drive letter.
- return DevicePathToDriveLetterPath(mapped_file, real_path);
-}
-
bool DevicePathToDriveLetterPath(const FilePath& nt_device_path,
FilePath* out_drive_letter_path) {
base::ThreadRestrictions::AssertIOAllowed();
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698