| 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_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util_proxy.h" | 12 #include "base/file_util_proxy.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/tracked_objects.h" | 15 #include "base/tracked_objects.h" |
| 16 #include "webkit/fileapi/file_system_file_util.h" | 16 #include "webkit/fileapi/file_system_file_util.h" |
| 17 #include "webkit/fileapi/file_system_operation_interface.h" | 17 #include "webkit/fileapi/file_system_operation.h" |
| 18 | 18 |
| 19 namespace fileapi { | 19 namespace fileapi { |
| 20 | 20 |
| 21 using base::PlatformFile; | 21 using base::PlatformFile; |
| 22 using base::PlatformFileError; | 22 using base::PlatformFileError; |
| 23 using base::PlatformFileInfo; | 23 using base::PlatformFileInfo; |
| 24 | 24 |
| 25 class FileSystemFileUtil; | 25 class FileSystemFileUtil; |
| 26 class FileSystemOperationContext; | 26 class FileSystemOperationContext; |
| 27 class FileSystemURL; | 27 class FileSystemURL; |
| 28 | 28 |
| 29 // This class provides asynchronous access to FileSystemFileUtil methods for | 29 // This class provides asynchronous access to FileSystemFileUtil methods for |
| 30 // FileSystem API operations. This also implements cross-FileUtil copy/move | 30 // FileSystem API operations. This also implements cross-FileUtil copy/move |
| 31 // operations on top of FileSystemFileUtil methods. | 31 // operations on top of FileSystemFileUtil methods. |
| 32 class FileSystemFileUtilProxy { | 32 class FileSystemFileUtilProxy { |
| 33 public: | 33 public: |
| 34 // Some of the proxy routines are just wrapping around the FileUtilProxy's | 34 // Some of the proxy routines are just wrapping around the FileUtilProxy's |
| 35 // relay methods, so we use the same types as FileUtilProxy for them. | 35 // relay methods, so we use the same types as FileUtilProxy for them. |
| 36 typedef base::FileUtilProxy::Entry Entry; | 36 typedef base::FileUtilProxy::Entry Entry; |
| 37 typedef base::FileUtilProxy::CreateOrOpenCallback CreateOrOpenCallback; | 37 typedef base::FileUtilProxy::CreateOrOpenCallback CreateOrOpenCallback; |
| 38 | 38 |
| 39 typedef base::Callback<void(PlatformFileError status)> StatusCallback; | 39 typedef base::Callback<void(PlatformFileError status)> StatusCallback; |
| 40 typedef base::Callback<void(PlatformFileError status, | 40 typedef base::Callback<void(PlatformFileError status, |
| 41 bool created)> EnsureFileExistsCallback; | 41 bool created)> EnsureFileExistsCallback; |
| 42 typedef FileSystemOperationInterface::GetMetadataCallback GetFileInfoCallback; | 42 typedef FileSystemOperation::GetMetadataCallback GetFileInfoCallback; |
| 43 typedef FileSystemOperationInterface::ReadDirectoryCallback | 43 typedef FileSystemOperation::ReadDirectoryCallback ReadDirectoryCallback; |
| 44 ReadDirectoryCallback; | |
| 45 | 44 |
| 46 typedef base::Callback< | 45 typedef base::Callback< |
| 47 void(base::PlatformFileError result, | 46 void(base::PlatformFileError result, |
| 48 const base::PlatformFileInfo& file_info, | 47 const base::PlatformFileInfo& file_info, |
| 49 const FilePath& platform_path, | 48 const FilePath& platform_path, |
| 50 FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)> | 49 FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)> |
| 51 SnapshotFileCallback; | 50 SnapshotFileCallback; |
| 52 | 51 |
| 53 // Deletes a file or a directory on the given context's task_runner. | 52 // Deletes a file or a directory on the given context's task_runner. |
| 54 // It is an error to delete a non-empty directory with recursive=false. | 53 // It is an error to delete a non-empty directory with recursive=false. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 int64 length, | 165 int64 length, |
| 167 const StatusCallback& callback); | 166 const StatusCallback& callback); |
| 168 | 167 |
| 169 private: | 168 private: |
| 170 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); | 169 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); |
| 171 }; | 170 }; |
| 172 | 171 |
| 173 } // namespace fileapi | 172 } // namespace fileapi |
| 174 | 173 |
| 175 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 174 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
| OLD | NEW |