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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "webkit/browser/blob/blob_data_handle.h" |
14 #include "webkit/browser/fileapi/file_system_operation.h" | 15 #include "webkit/browser/fileapi/file_system_operation.h" |
15 #include "webkit/browser/fileapi/file_system_url.h" | 16 #include "webkit/browser/fileapi/file_system_url.h" |
16 #include "webkit/browser/webkit_storage_browser_export.h" | 17 #include "webkit/browser/webkit_storage_browser_export.h" |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 class URLRequestContext; | 20 class URLRequestContext; |
20 } | 21 } |
21 | 22 |
22 namespace fileapi { | 23 namespace fileapi { |
23 | 24 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Reads contents of a directory at |url|. | 91 // Reads contents of a directory at |url|. |
91 OperationID ReadDirectory(const FileSystemURL& url, | 92 OperationID ReadDirectory(const FileSystemURL& url, |
92 const ReadDirectoryCallback& callback); | 93 const ReadDirectoryCallback& callback); |
93 | 94 |
94 // Removes a file or directory at |url|. If |recursive| is true, remove | 95 // Removes a file or directory at |url|. If |recursive| is true, remove |
95 // all files and directories under the directory at |url| recursively. | 96 // all files and directories under the directory at |url| recursively. |
96 OperationID Remove(const FileSystemURL& url, bool recursive, | 97 OperationID Remove(const FileSystemURL& url, bool recursive, |
97 const StatusCallback& callback); | 98 const StatusCallback& callback); |
98 | 99 |
99 // Writes contents of |blob_url| to |url| at |offset|. | 100 // Writes contents of |blob_url| to |url| at |offset|. |
100 // |url_request_context| is used to read contents in |blob_url|. | 101 // |url_request_context| is used to read contents in |blob|. |
101 OperationID Write(const net::URLRequestContext* url_request_context, | 102 OperationID Write(const net::URLRequestContext* url_request_context, |
102 const FileSystemURL& url, | 103 const FileSystemURL& url, |
103 const GURL& blob_url, | 104 scoped_ptr<webkit_blob::BlobDataHandle> blob, |
104 int64 offset, | 105 int64 offset, |
105 const WriteCallback& callback); | 106 const WriteCallback& callback); |
106 | 107 |
107 // Truncates a file at |url| to |length|. If |length| is larger than | 108 // Truncates a file at |url| to |length|. If |length| is larger than |
108 // the original file size, the file will be extended, and the extended | 109 // the original file size, the file will be extended, and the extended |
109 // part is filled with null bytes. | 110 // part is filled with null bytes. |
110 OperationID Truncate(const FileSystemURL& url, int64 length, | 111 OperationID Truncate(const FileSystemURL& url, int64 length, |
111 const StatusCallback& callback); | 112 const StatusCallback& callback); |
112 | 113 |
113 // Tries to cancel the operation |id| [we support cancelling write or | 114 // Tries to cancel the operation |id| [we support cancelling write or |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // we can notify observers when we're done. | 274 // we can notify observers when we're done. |
274 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; | 275 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; |
275 OperationToURLSet write_target_urls_; | 276 OperationToURLSet write_target_urls_; |
276 | 277 |
277 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 278 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
278 }; | 279 }; |
279 | 280 |
280 } // namespace fileapi | 281 } // namespace fileapi |
281 | 282 |
282 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 283 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |