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 WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 6 #define WEBKIT_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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "webkit/browser/blob/blob_data_handle.h" | 16 #include "webkit/browser/blob/blob_data_handle.h" |
17 #include "webkit/browser/fileapi/file_system_operation.h" | 17 #include "webkit/browser/fileapi/file_system_operation.h" |
18 #include "webkit/browser/fileapi/file_system_url.h" | 18 #include "webkit/browser/fileapi/file_system_url.h" |
19 #include "webkit/browser/webkit_storage_browser_export.h" | 19 #include "webkit/browser/storage_export.h" |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 class URLRequestContext; | 22 class URLRequestContext; |
23 } | 23 } |
24 | 24 |
25 namespace storage { | 25 namespace storage { |
26 | 26 |
27 class FileSystemURL; | 27 class FileSystemURL; |
28 class FileSystemContext; | 28 class FileSystemContext; |
29 | 29 |
30 // A central interface for running FileSystem API operations. | 30 // A central interface for running FileSystem API operations. |
31 // All operation methods take callback and returns OperationID, which is | 31 // All operation methods take callback and returns OperationID, which is |
32 // an integer value which can be used for cancelling an operation. | 32 // an integer value which can be used for cancelling an operation. |
33 // All operation methods return kErrorOperationID if running (posting) an | 33 // All operation methods return kErrorOperationID if running (posting) an |
34 // operation fails, in addition to dispatching the callback with an error | 34 // operation fails, in addition to dispatching the callback with an error |
35 // code (therefore in most cases the caller does not need to check the | 35 // code (therefore in most cases the caller does not need to check the |
36 // returned operation ID). | 36 // returned operation ID). |
37 class WEBKIT_STORAGE_BROWSER_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::CopyProgressCallback CopyProgressCallback; | 46 typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; |
47 typedef FileSystemOperation::CopyFileProgressCallback | 47 typedef FileSystemOperation::CopyFileProgressCallback |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 // Callbacks for stray cancels whose target operation is already finished. | 314 // Callbacks for stray cancels whose target operation is already finished. |
315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 315 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
316 | 316 |
317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 317 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
318 }; | 318 }; |
319 | 319 |
320 } // namespace storage | 320 } // namespace storage |
321 | 321 |
322 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 322 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |