Index: webkit/browser/fileapi/native_file_util.cc |
diff --git a/webkit/browser/fileapi/native_file_util.cc b/webkit/browser/fileapi/native_file_util.cc |
index e99e29770000dfad9cb0bcafeda9c4c182b154ca..63b548163a9b79a671d9aeba22052e6e45b741d8 100644 |
--- a/webkit/browser/fileapi/native_file_util.cc |
+++ b/webkit/browser/fileapi/native_file_util.cc |
@@ -122,27 +122,18 @@ NativeFileUtil::CopyOrMoveMode NativeFileUtil::CopyOrMoveModeForDestination( |
return MOVE; |
} |
-base::File::Error NativeFileUtil::CreateOrOpen( |
- const base::FilePath& path, int file_flags, |
- PlatformFile* file_handle, bool* created) { |
+base::File NativeFileUtil::CreateOrOpen(const base::FilePath& path, |
+ int file_flags) { |
if (!base::DirectoryExists(path.DirName())) { |
// If its parent does not exist, should return NOT_FOUND error. |
- return base::File::FILE_ERROR_NOT_FOUND; |
+ return base::File(base::File::FILE_ERROR_NOT_FOUND); |
kinuko
2014/03/26 03:35:06
Ah, ok, to return a specific error.. (I think I mi
|
} |
- if (base::DirectoryExists(path)) |
- return base::File::FILE_ERROR_NOT_A_FILE; |
- // TODO(rvargas): convert this code to use base::File. |
- base::PlatformFileError error_code = base::PLATFORM_FILE_OK; |
- *file_handle = base::CreatePlatformFile(path, file_flags, |
- created, &error_code); |
- return static_cast<base::File::Error>(error_code); |
-} |
+ // TODO(rvargas): Check |file_flags| instead. See bug 356358. |
+ if (base::DirectoryExists(path)) |
+ return base::File(base::File::FILE_ERROR_NOT_A_FILE); |
-base::File::Error NativeFileUtil::Close(PlatformFile file_handle) { |
- if (!base::ClosePlatformFile(file_handle)) |
- return base::File::FILE_ERROR_FAILED; |
- return base::File::FILE_OK; |
+ return base::File(path, file_flags); |
} |
base::File::Error NativeFileUtil::EnsureFileExists( |