| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/fileapi/file_system_file_util.h" | 5 #include "webkit/fileapi/file_system_file_util.h" |
| 6 | 6 |
| 7 #include "base/file_util_proxy.h" | 7 #include "base/file_util_proxy.h" |
| 8 | 8 |
| 9 namespace fileapi { | 9 namespace fileapi { |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 error_code = base::PLATFORM_FILE_OK; | 54 error_code = base::PLATFORM_FILE_OK; |
| 55 } | 55 } |
| 56 if (handle != base::kInvalidPlatformFileValue) | 56 if (handle != base::kInvalidPlatformFileValue) |
| 57 base::ClosePlatformFile(handle); | 57 base::ClosePlatformFile(handle); |
| 58 return error_code; | 58 return error_code; |
| 59 } | 59 } |
| 60 | 60 |
| 61 PlatformFileError FileSystemFileUtil::GetFileInfo( | 61 PlatformFileError FileSystemFileUtil::GetFileInfo( |
| 62 FileSystemOperationContext* unused, | 62 FileSystemOperationContext* unused, |
| 63 const FilePath& file_path, | 63 const FilePath& file_path, |
| 64 base::PlatformFileInfo* file_info) { | 64 base::PlatformFileInfo* file_info, |
| 65 FilePath* platform_file_path) { |
| 65 if (!file_util::PathExists(file_path)) | 66 if (!file_util::PathExists(file_path)) |
| 66 return base::PLATFORM_FILE_ERROR_NOT_FOUND; | 67 return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
| 67 if (!file_util::GetFileInfo(file_path, file_info)) | 68 if (!file_util::GetFileInfo(file_path, file_info)) |
| 68 return base::PLATFORM_FILE_ERROR_FAILED; | 69 return base::PLATFORM_FILE_ERROR_FAILED; |
| 69 file_info->path = file_path; | 70 *platform_file_path = file_path; |
| 70 return base::PLATFORM_FILE_OK; | 71 return base::PLATFORM_FILE_OK; |
| 71 } | 72 } |
| 72 | 73 |
| 73 PlatformFileError FileSystemFileUtil::ReadDirectory( | 74 PlatformFileError FileSystemFileUtil::ReadDirectory( |
| 74 FileSystemOperationContext* unused, | 75 FileSystemOperationContext* unused, |
| 75 const FilePath& file_path, | 76 const FilePath& file_path, |
| 76 std::vector<base::FileUtilProxy::Entry>* entries) { | 77 std::vector<base::FileUtilProxy::Entry>* entries) { |
| 77 // TODO(kkanetkar): Implement directory read in multiple chunks. | 78 // TODO(kkanetkar): Implement directory read in multiple chunks. |
| 78 if (!file_util::DirectoryExists(file_path)) | 79 if (!file_util::DirectoryExists(file_path)) |
| 79 return base::PLATFORM_FILE_ERROR_NOT_FOUND; | 80 return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return file_util::DirectoryExists(file_path); | 262 return file_util::DirectoryExists(file_path); |
| 262 } | 263 } |
| 263 | 264 |
| 264 bool FileSystemFileUtil::IsDirectoryEmpty( | 265 bool FileSystemFileUtil::IsDirectoryEmpty( |
| 265 FileSystemOperationContext* unused, | 266 FileSystemOperationContext* unused, |
| 266 const FilePath& file_path) { | 267 const FilePath& file_path) { |
| 267 return file_util::IsDirectoryEmpty(file_path); | 268 return file_util::IsDirectoryEmpty(file_path); |
| 268 } | 269 } |
| 269 | 270 |
| 270 } // namespace fileapi | 271 } // namespace fileapi |
| OLD | NEW |