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::ErrorBehavior ErrorBehavior; |
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 ErrorBehavior error_behavior, |
78 const CopyProgressCallback& progress_callback, | 80 const CopyProgressCallback& progress_callback, |
79 const StatusCallback& callback); | 81 const StatusCallback& callback); |
80 | 82 |
81 // Moves a file or directory from |src_url| to |dest_url|. A new file | 83 // Moves a file or directory from |src_url| to |dest_url|. A new file |
82 // or directory is created at |dest_url| as needed. | 84 // or directory is created at |dest_url| as needed. |
83 // For |option|, see file_system_operation.h for details. | 85 // For |option|, see file_system_operation.h for details. |
84 OperationID Move(const FileSystemURL& src_url, | 86 OperationID Move(const FileSystemURL& src_url, |
85 const FileSystemURL& dest_url, | 87 const FileSystemURL& dest_url, |
86 CopyOrMoveOption option, | 88 CopyOrMoveOption option, |
87 const StatusCallback& callback); | 89 const StatusCallback& callback); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 315 |
314 // Callbacks for stray cancels whose target operation is already finished. | 316 // Callbacks for stray cancels whose target operation is already finished. |
315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 317 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
316 | 318 |
317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 319 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
318 }; | 320 }; |
319 | 321 |
320 } // namespace storage | 322 } // namespace storage |
321 | 323 |
322 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 324 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |