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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Reads contents of a directory at |url|. | 97 // Reads contents of a directory at |url|. |
97 OperationID ReadDirectory(const FileSystemURL& url, | 98 OperationID ReadDirectory(const FileSystemURL& url, |
98 const ReadDirectoryCallback& callback); | 99 const ReadDirectoryCallback& callback); |
99 | 100 |
100 // Removes a file or directory at |url|. If |recursive| is true, remove | 101 // Removes a file or directory at |url|. If |recursive| is true, remove |
101 // all files and directories under the directory at |url| recursively. | 102 // all files and directories under the directory at |url| recursively. |
102 OperationID Remove(const FileSystemURL& url, bool recursive, | 103 OperationID Remove(const FileSystemURL& url, bool recursive, |
103 const StatusCallback& callback); | 104 const StatusCallback& callback); |
104 | 105 |
105 // Writes contents of |blob_url| to |url| at |offset|. | 106 // Writes contents of |blob_url| to |url| at |offset|. |
106 // |url_request_context| is used to read contents in |blob_url|. | 107 // |url_request_context| is used to read contents in |blob|. |
107 OperationID Write(const net::URLRequestContext* url_request_context, | 108 OperationID Write(const net::URLRequestContext* url_request_context, |
108 const FileSystemURL& url, | 109 const FileSystemURL& url, |
109 const GURL& blob_url, | 110 scoped_ptr<webkit_blob::BlobDataHandle> blob, |
110 int64 offset, | 111 int64 offset, |
111 const WriteCallback& callback); | 112 const WriteCallback& callback); |
112 | 113 |
113 // Truncates a file at |url| to |length|. If |length| is larger than | 114 // Truncates a file at |url| to |length|. If |length| is larger than |
114 // the original file size, the file will be extended, and the extended | 115 // the original file size, the file will be extended, and the extended |
115 // part is filled with null bytes. | 116 // part is filled with null bytes. |
116 OperationID Truncate(const FileSystemURL& url, int64 length, | 117 OperationID Truncate(const FileSystemURL& url, int64 length, |
117 const StatusCallback& callback); | 118 const StatusCallback& callback); |
118 | 119 |
119 // Tries to cancel the operation |id| [we support cancelling write or | 120 // Tries to cancel the operation |id| [we support cancelling write or |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // we can notify observers when we're done. | 289 // we can notify observers when we're done. |
289 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; | 290 typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; |
290 OperationToURLSet write_target_urls_; | 291 OperationToURLSet write_target_urls_; |
291 | 292 |
292 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 293 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
293 }; | 294 }; |
294 | 295 |
295 } // namespace fileapi | 296 } // namespace fileapi |
296 | 297 |
297 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 298 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |