| 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 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 if (error_code == base::PLATFORM_FILE_ERROR_EXISTS) { | 54 if (error_code == base::PLATFORM_FILE_ERROR_EXISTS) { |
| 55 // Make sure created_ is false. | 55 // Make sure created_ is false. |
| 56 *created = false; | 56 *created = false; |
| 57 error_code = base::PLATFORM_FILE_OK; | 57 error_code = base::PLATFORM_FILE_OK; |
| 58 } | 58 } |
| 59 if (handle != base::kInvalidPlatformFileValue) | 59 if (handle != base::kInvalidPlatformFileValue) |
| 60 base::ClosePlatformFile(handle); | 60 base::ClosePlatformFile(handle); |
| 61 return error_code; | 61 return error_code; |
| 62 } | 62 } |
| 63 | 63 |
| 64 PlatformFileError FileSystemFileUtil::GetLocalFilePath( |
| 65 FileSystemOperationContext* context, |
| 66 const FilePath& virtual_path, |
| 67 FilePath* local_path) { |
| 68 *local_path = virtual_path; |
| 69 return base::PLATFORM_FILE_OK; |
| 70 } |
| 71 |
| 64 PlatformFileError FileSystemFileUtil::GetFileInfo( | 72 PlatformFileError FileSystemFileUtil::GetFileInfo( |
| 65 FileSystemOperationContext* unused, | 73 FileSystemOperationContext* unused, |
| 66 const FilePath& file_path, | 74 const FilePath& file_path, |
| 67 base::PlatformFileInfo* file_info, | 75 base::PlatformFileInfo* file_info, |
| 68 FilePath* platform_file_path) { | 76 FilePath* platform_file_path) { |
| 69 if (!file_util::PathExists(file_path)) | 77 if (!file_util::PathExists(file_path)) |
| 70 return base::PLATFORM_FILE_ERROR_NOT_FOUND; | 78 return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
| 71 if (!file_util::GetFileInfo(file_path, file_info)) | 79 if (!file_util::GetFileInfo(file_path, file_info)) |
| 72 return base::PLATFORM_FILE_ERROR_FAILED; | 80 return base::PLATFORM_FILE_ERROR_FAILED; |
| 73 *platform_file_path = file_path; | 81 *platform_file_path = file_path; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 373 |
| 366 FileSystemFileUtil::AbstractFileEnumerator* | 374 FileSystemFileUtil::AbstractFileEnumerator* |
| 367 FileSystemFileUtil::CreateFileEnumerator(const FilePath& root_path) { | 375 FileSystemFileUtil::CreateFileEnumerator(const FilePath& root_path) { |
| 368 return new FileSystemFileEnumerator( | 376 return new FileSystemFileEnumerator( |
| 369 root_path, true, static_cast<file_util::FileEnumerator::FILE_TYPE>( | 377 root_path, true, static_cast<file_util::FileEnumerator::FILE_TYPE>( |
| 370 file_util::FileEnumerator::FILES | | 378 file_util::FileEnumerator::FILES | |
| 371 file_util::FileEnumerator::DIRECTORIES)); | 379 file_util::FileEnumerator::DIRECTORIES)); |
| 372 } | 380 } |
| 373 | 381 |
| 374 } // namespace fileapi | 382 } // namespace fileapi |
| OLD | NEW |