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

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

Issue 274903002: Remove PlatformFile from fileapi::FileSystemFileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 6 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 | « webkit/browser/fileapi/local_file_util.h ('k') | webkit/browser/fileapi/native_file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/local_file_util.cc
diff --git a/webkit/browser/fileapi/local_file_util.cc b/webkit/browser/fileapi/local_file_util.cc
index 90d45e3f0b1f8718408cc331d5ee8f2e49876f1b..3b823aa99f6f2b5a283cccab2ca24bce8a874378 100644
--- a/webkit/browser/fileapi/local_file_util.cc
+++ b/webkit/browser/fileapi/local_file_util.cc
@@ -76,33 +76,18 @@ LocalFileUtil::LocalFileUtil() {}
LocalFileUtil::~LocalFileUtil() {}
-base::File::Error LocalFileUtil::CreateOrOpen(
+base::File LocalFileUtil::CreateOrOpen(
FileSystemOperationContext* context,
- const FileSystemURL& url, int file_flags,
- base::PlatformFile* file_handle, bool* created) {
- *created = false;
+ const FileSystemURL& url, int file_flags) {
base::FilePath file_path;
base::File::Error error = GetLocalFilePath(context, url, &file_path);
if (error != base::File::FILE_OK)
- return error;
+ return base::File(error);
// Disallow opening files in symlinked paths.
if (base::IsLink(file_path))
- return base::File::FILE_ERROR_NOT_FOUND;
+ return base::File(base::File::FILE_ERROR_NOT_FOUND);
- // TODO(rvargas): make FileSystemFileUtil use base::File.
- base::File file = NativeFileUtil::CreateOrOpen(file_path, file_flags);
- if (!file.IsValid())
- return file.error_details();
-
- *created = file.created();
- *file_handle = file.TakePlatformFile();
- return base::File::FILE_OK;
-}
-
-base::File::Error LocalFileUtil::Close(FileSystemOperationContext* context,
- base::PlatformFile file) {
- base::File auto_closed(file);
- return base::File::FILE_OK;
+ return NativeFileUtil::CreateOrOpen(file_path, file_flags);
}
base::File::Error LocalFileUtil::EnsureFileExists(
« no previous file with comments | « webkit/browser/fileapi/local_file_util.h ('k') | webkit/browser/fileapi/native_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698