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

Unified Diff: webkit/browser/fileapi/native_file_util.cc

Issue 206783004: Remove PlatforFile from fileapi/native_file_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change API to return File Created 6 years, 9 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 | « webkit/browser/fileapi/native_file_util.h ('k') | webkit/browser/fileapi/native_file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « webkit/browser/fileapi/native_file_util.h ('k') | webkit/browser/fileapi/native_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698