| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // returned operation ID). | 36 // returned operation ID). |
| 37 class STORAGE_EXPORT FileSystemOperationRunner | 37 class STORAGE_EXPORT FileSystemOperationRunner |
| 38 : public base::SupportsWeakPtr<FileSystemOperationRunner> { | 38 : public base::SupportsWeakPtr<FileSystemOperationRunner> { |
| 39 public: | 39 public: |
| 40 typedef FileSystemOperation::GetMetadataCallback GetMetadataCallback; | 40 typedef FileSystemOperation::GetMetadataCallback GetMetadataCallback; |
| 41 typedef FileSystemOperation::ReadDirectoryCallback ReadDirectoryCallback; | 41 typedef FileSystemOperation::ReadDirectoryCallback ReadDirectoryCallback; |
| 42 typedef FileSystemOperation::SnapshotFileCallback SnapshotFileCallback; | 42 typedef FileSystemOperation::SnapshotFileCallback SnapshotFileCallback; |
| 43 typedef FileSystemOperation::StatusCallback StatusCallback; | 43 typedef FileSystemOperation::StatusCallback StatusCallback; |
| 44 typedef FileSystemOperation::WriteCallback WriteCallback; | 44 typedef FileSystemOperation::WriteCallback WriteCallback; |
| 45 typedef FileSystemOperation::OpenFileCallback OpenFileCallback; | 45 typedef FileSystemOperation::OpenFileCallback OpenFileCallback; |
| 46 typedef FileSystemOperation::CopyOrMoveErrorCallback CopyOrMoveErrorCallback; |
| 46 typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; | 47 typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; |
| 47 typedef FileSystemOperation::CopyFileProgressCallback | 48 typedef FileSystemOperation::CopyFileProgressCallback |
| 48 CopyFileProgressCallback; | 49 CopyFileProgressCallback; |
| 49 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; | 50 typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; |
| 50 | 51 |
| 51 typedef int OperationID; | 52 typedef int OperationID; |
| 52 | 53 |
| 53 virtual ~FileSystemOperationRunner(); | 54 virtual ~FileSystemOperationRunner(); |
| 54 | 55 |
| 55 // Cancels all inflight operations. | 56 // Cancels all inflight operations. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 // Copies a file or directory from |src_url| to |dest_url|. If | 70 // Copies a file or directory from |src_url| to |dest_url|. If |
| 70 // |src_url| is a directory, the contents of |src_url| are copied to | 71 // |src_url| is a directory, the contents of |src_url| are copied to |
| 71 // |dest_url| recursively. A new file or directory is created at | 72 // |dest_url| recursively. A new file or directory is created at |
| 72 // |dest_url| as needed. | 73 // |dest_url| as needed. |
| 73 // For |option| and |progress_callback|, see file_system_operation.h for | 74 // For |option| and |progress_callback|, see file_system_operation.h for |
| 74 // details. | 75 // details. |
| 75 OperationID Copy(const FileSystemURL& src_url, | 76 OperationID Copy(const FileSystemURL& src_url, |
| 76 const FileSystemURL& dest_url, | 77 const FileSystemURL& dest_url, |
| 77 CopyOrMoveOption option, | 78 CopyOrMoveOption option, |
| 79 const bool continue_with_error, |
| 80 const CopyOrMoveErrorCallback& error_callback, |
| 78 const CopyProgressCallback& progress_callback, | 81 const CopyProgressCallback& progress_callback, |
| 79 const StatusCallback& callback); | 82 const StatusCallback& callback); |
| 80 | 83 |
| 81 // Moves a file or directory from |src_url| to |dest_url|. A new file | 84 // Moves a file or directory from |src_url| to |dest_url|. A new file |
| 82 // or directory is created at |dest_url| as needed. | 85 // or directory is created at |dest_url| as needed. |
| 83 // For |option|, see file_system_operation.h for details. | 86 // For |option|, see file_system_operation.h for details. |
| 84 OperationID Move(const FileSystemURL& src_url, | 87 OperationID Move(const FileSystemURL& src_url, |
| 85 const FileSystemURL& dest_url, | 88 const FileSystemURL& dest_url, |
| 86 CopyOrMoveOption option, | 89 CopyOrMoveOption option, |
| 87 const StatusCallback& callback); | 90 const StatusCallback& callback); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 base::File file, | 277 base::File file, |
| 275 const base::Closure& on_close_callback); | 278 const base::Closure& on_close_callback); |
| 276 void DidCreateSnapshot( | 279 void DidCreateSnapshot( |
| 277 const OperationHandle& handle, | 280 const OperationHandle& handle, |
| 278 const SnapshotFileCallback& callback, | 281 const SnapshotFileCallback& callback, |
| 279 base::File::Error rv, | 282 base::File::Error rv, |
| 280 const base::File::Info& file_info, | 283 const base::File::Info& file_info, |
| 281 const base::FilePath& platform_path, | 284 const base::FilePath& platform_path, |
| 282 const scoped_refptr<storage::ShareableFileReference>& file_ref); | 285 const scoped_refptr<storage::ShareableFileReference>& file_ref); |
| 283 | 286 |
| 287 void OnCopyOrMoveError(const OperationHandle& handle, |
| 288 const CopyOrMoveErrorCallback& callback, |
| 289 base::File::Error error, |
| 290 const FileSystemURL& source_url, |
| 291 const FileSystemURL& dest_url); |
| 284 void OnCopyProgress( | 292 void OnCopyProgress( |
| 285 const OperationHandle& handle, | 293 const OperationHandle& handle, |
| 286 const CopyProgressCallback& callback, | 294 const CopyProgressCallback& callback, |
| 287 FileSystemOperation::CopyProgressType type, | 295 FileSystemOperation::CopyProgressType type, |
| 288 const FileSystemURL& source_url, | 296 const FileSystemURL& source_url, |
| 289 const FileSystemURL& dest_url, | 297 const FileSystemURL& dest_url, |
| 290 int64 size); | 298 int64 size); |
| 291 | 299 |
| 292 void PrepareForWrite(OperationID id, const FileSystemURL& url); | 300 void PrepareForWrite(OperationID id, const FileSystemURL& url); |
| 293 void PrepareForRead(OperationID id, const FileSystemURL& url); | 301 void PrepareForRead(OperationID id, const FileSystemURL& url); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 313 | 321 |
| 314 // Callbacks for stray cancels whose target operation is already finished. | 322 // Callbacks for stray cancels whose target operation is already finished. |
| 315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 323 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
| 316 | 324 |
| 317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 325 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
| 318 }; | 326 }; |
| 319 | 327 |
| 320 } // namespace storage | 328 } // namespace storage |
| 321 | 329 |
| 322 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 330 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| OLD | NEW |