| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ |
| 6 #define WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_util_proxy.h" | |
| 10 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
| 11 #include "webkit/chromeos/fileapi/async_file_stream.h" | 10 #include "webkit/chromeos/fileapi/async_file_stream.h" |
| 12 | 11 |
| 13 namespace fileapi { | 12 namespace fileapi { |
| 14 | 13 |
| 15 using base::PlatformFileError; | 14 using base::PlatformFileError; |
| 16 | 15 |
| 17 // The interface class of asynchronous file utils. All functions are pure | 16 // The interface class of asynchronous file utils. All functions are pure |
| 18 // virtual. | 17 // virtual. |
| 19 class FileUtilAsync { | 18 class FileUtilAsync { |
| 20 public: | 19 public: |
| 21 virtual ~FileUtilAsync() {} | 20 virtual ~FileUtilAsync() {} |
| 22 | 21 |
| 23 typedef base::FileUtilProxy::Entry DirectoryEntry; | |
| 24 | |
| 25 // Used for GetFileInfo(). |result| is the return code of the operation, | 22 // Used for GetFileInfo(). |result| is the return code of the operation, |
| 26 // and |file_info| is the obtained file info. | 23 // and |file_info| is the obtained file info. |
| 27 typedef base::Callback<void( | 24 typedef base::Callback<void( |
| 28 PlatformFileError result, | 25 PlatformFileError result, |
| 29 const base::PlatformFileInfo& file_info)> GetFileInfoCallback; | 26 const base::PlatformFileInfo& file_info)> GetFileInfoCallback; |
| 30 | 27 |
| 31 // Used for Create(), etc. |result| is the return code of the operation. | 28 // Used for Create(), etc. |result| is the return code of the operation. |
| 32 typedef base::Callback<void(PlatformFileError)> StatusCallback; | 29 typedef base::Callback<void(PlatformFileError)> StatusCallback; |
| 33 | 30 |
| 34 // Used for Open(). |result| is the return code of the operation, and | 31 // Used for Open(). |result| is the return code of the operation, and |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // TODO(olege): Maybe make it possible to read only a part of the directory. | 111 // TODO(olege): Maybe make it possible to read only a part of the directory. |
| 115 virtual void ReadDirectory(const base::FilePath& dir_path, | 112 virtual void ReadDirectory(const base::FilePath& dir_path, |
| 116 const ReadDirectoryCallback& callback) = 0; | 113 const ReadDirectoryCallback& callback) = 0; |
| 117 | 114 |
| 118 // TODO(olege): Add LocalCopy and LocalMove. | 115 // TODO(olege): Add LocalCopy and LocalMove. |
| 119 }; | 116 }; |
| 120 | 117 |
| 121 } // namespace fileapi | 118 } // namespace fileapi |
| 122 | 119 |
| 123 #endif // WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ | 120 #endif // WEBKIT_CHROMEOS_FILEAPI_FILE_SYSTEM_FILE_UTIL_ASYNC_H_ |
| OLD | NEW |