| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 const CopyProgressCallback& callback, | 293 const CopyProgressCallback& callback, |
| 294 FileSystemOperation::CopyProgressType type, | 294 FileSystemOperation::CopyProgressType type, |
| 295 const FileSystemURL& source_url, | 295 const FileSystemURL& source_url, |
| 296 const FileSystemURL& dest_url, | 296 const FileSystemURL& dest_url, |
| 297 int64_t size); | 297 int64_t size); |
| 298 | 298 |
| 299 void PrepareForWrite(OperationID id, const FileSystemURL& url); | 299 void PrepareForWrite(OperationID id, const FileSystemURL& url); |
| 300 void PrepareForRead(OperationID id, const FileSystemURL& url); | 300 void PrepareForRead(OperationID id, const FileSystemURL& url); |
| 301 | 301 |
| 302 // These must be called at the beginning and end of any async operations. | 302 // These must be called at the beginning and end of any async operations. |
| 303 OperationHandle BeginOperation(FileSystemOperation* operation, | 303 OperationHandle BeginOperation(std::unique_ptr<FileSystemOperation> operation, |
| 304 base::WeakPtr<BeginOperationScoper> scope); | 304 base::WeakPtr<BeginOperationScoper> scope); |
| 305 void FinishOperation(OperationID id); | 305 void FinishOperation(OperationID id); |
| 306 | 306 |
| 307 // Not owned; file_system_context owns this. | 307 // Not owned; file_system_context owns this. |
| 308 FileSystemContext* file_system_context_; | 308 FileSystemContext* file_system_context_; |
| 309 | 309 |
| 310 // IDMap<FileSystemOperation, IDMapOwnPointer> operations_; | 310 // IDMap<FileSystemOperation, IDMapOwnPointer> operations_; |
| 311 IDMap<FileSystemOperation, IDMapOwnPointer> operations_; | 311 IDMap<FileSystemOperation, IDMapOwnPointer> operations_; |
| 312 | 312 |
| 313 // We keep track of the file to be modified by each operation so that | 313 // We keep track of the file to be modified by each operation so that |
| 314 // we can notify observers when we're done. | 314 // we can notify observers when we're done. |
| 315 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; | 315 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; |
| 316 OperationToURLSet write_target_urls_; | 316 OperationToURLSet write_target_urls_; |
| 317 | 317 |
| 318 // Operations that are finished but not yet fire their callbacks. | 318 // Operations that are finished but not yet fire their callbacks. |
| 319 std::set<OperationID> finished_operations_; | 319 std::set<OperationID> finished_operations_; |
| 320 | 320 |
| 321 // Callbacks for stray cancels whose target operation is already finished. | 321 // Callbacks for stray cancels whose target operation is already finished. |
| 322 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 322 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
| 323 | 323 |
| 324 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 324 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
| 325 }; | 325 }; |
| 326 | 326 |
| 327 } // namespace storage | 327 } // namespace storage |
| 328 | 328 |
| 329 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 329 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| OLD | NEW |