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

Unified Diff: base/file_util_win.cc

Issue 101143006: Convert base::file_util to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base:: Created 6 years, 11 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 | « base/file_util_unittest.cc ('k') | base/files/file_path_watcher_win.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 44c1205aa659acc7f8249098d3faeaae7bee732d..6ff1820a0bc3555ed8c4baeb259ead5b9b228c01 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -91,7 +91,7 @@ bool DeleteFile(const FilePath& path, bool recursive) {
if (!recursive) {
// If not recursing, then first check to see if |path| is a directory.
// If it is, then remove it with RemoveDirectory.
- PlatformFileInfo file_info;
+ File::Info file_info;
if (GetFileInfo(path, &file_info) && file_info.is_directory)
return RemoveDirectory(path.value().c_str()) != 0;
@@ -143,7 +143,7 @@ bool DeleteFileAfterReboot(const FilePath& path) {
bool ReplaceFile(const FilePath& from_path,
const FilePath& to_path,
- PlatformFileError* error) {
+ File::Error* error) {
ThreadRestrictions::AssertIOAllowed();
// Try a simple move first. It will only succeed when |to_path| doesn't
// already exist.
@@ -158,7 +158,7 @@ bool ReplaceFile(const FilePath& from_path,
return true;
}
if (error)
- *error = LastErrorToPlatformFileError(GetLastError());
+ *error = File::OSErrorToFileError(GetLastError());
return false;
}
@@ -328,7 +328,7 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix,
}
bool CreateDirectoryAndGetError(const FilePath& full_path,
- PlatformFileError* error) {
+ File::Error* error) {
ThreadRestrictions::AssertIOAllowed();
// If the path exists, we've succeeded if it's a directory, failed otherwise.
@@ -343,7 +343,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
DLOG(WARNING) << "CreateDirectory(" << full_path_str << "), "
<< "conflicts with existing file.";
if (error) {
- *error = PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
+ *error = File::FILE_ERROR_NOT_A_DIRECTORY;
}
return false;
}
@@ -356,14 +356,14 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
FilePath parent_path(full_path.DirName());
if (parent_path.value() == full_path.value()) {
if (error) {
- *error = PLATFORM_FILE_ERROR_NOT_FOUND;
+ *error = File::FILE_ERROR_NOT_FOUND;
}
return false;
}
if (!CreateDirectoryAndGetError(parent_path, error)) {
DLOG(WARNING) << "Failed to create one of the parent directories.";
if (error) {
- DCHECK(*error != PLATFORM_FILE_OK);
+ DCHECK(*error != File::FILE_OK);
}
return false;
}
@@ -378,7 +378,7 @@ bool CreateDirectoryAndGetError(const FilePath& full_path,
return true;
} else {
if (error)
- *error = LastErrorToPlatformFileError(error_code);
+ *error = File::OSErrorToFileError(error_code);
DLOG(WARNING) << "Failed to create directory " << full_path_str
<< ", last error is " << error_code << ".";
return false;
@@ -505,7 +505,7 @@ bool IsLink(const FilePath& file_path) {
return false;
}
-bool GetFileInfo(const FilePath& file_path, PlatformFileInfo* results) {
+bool GetFileInfo(const FilePath& file_path, File::Info* results) {
ThreadRestrictions::AssertIOAllowed();
WIN32_FILE_ATTRIBUTE_DATA attr;
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_path_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698