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> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 // Opens a file at |url| with |file_flags|, where flags are OR'ed | 139 // Opens a file at |url| with |file_flags|, where flags are OR'ed |
140 // values of base::PlatformFileFlags. | 140 // values of base::PlatformFileFlags. |
141 // | 141 // |
142 // |peer_handle| is the process handle of a pepper plugin process, which | 142 // |peer_handle| is the process handle of a pepper plugin process, which |
143 // is necessary for underlying IPC calls with Pepper plugins. | 143 // is necessary for underlying IPC calls with Pepper plugins. |
144 // | 144 // |
145 // This function is used only by Pepper as of writing. | 145 // This function is used only by Pepper as of writing. |
146 OperationID OpenFile(const FileSystemURL& url, | 146 OperationID OpenFile(const FileSystemURL& url, |
147 int file_flags, | 147 int file_flags, |
148 base::ProcessHandle peer_handle, | |
149 const OpenFileCallback& callback); | 148 const OpenFileCallback& callback); |
150 | 149 |
151 // Creates a local snapshot file for a given |url| and returns the | 150 // Creates a local snapshot file for a given |url| and returns the |
152 // metadata and platform url of the snapshot file via |callback|. | 151 // metadata and platform url of the snapshot file via |callback|. |
153 // In local filesystem cases the implementation may simply return | 152 // In local filesystem cases the implementation may simply return |
154 // the metadata of the file itself (as well as GetMetadata does), | 153 // the metadata of the file itself (as well as GetMetadata does), |
155 // while in remote filesystem case the backend may want to download the file | 154 // while in remote filesystem case the backend may want to download the file |
156 // into a temporary snapshot file and return the metadata of the | 155 // into a temporary snapshot file and return the metadata of the |
157 // temporary file. Or if the implementaiton already has the local cache | 156 // temporary file. Or if the implementaiton already has the local cache |
158 // data for |url| it can simply return the url to the cache. | 157 // data for |url| it can simply return the url to the cache. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void DidWrite(const OperationHandle& handle, | 266 void DidWrite(const OperationHandle& handle, |
268 const WriteCallback& callback, | 267 const WriteCallback& callback, |
269 base::PlatformFileError rv, | 268 base::PlatformFileError rv, |
270 int64 bytes, | 269 int64 bytes, |
271 bool complete); | 270 bool complete); |
272 void DidOpenFile( | 271 void DidOpenFile( |
273 const OperationHandle& handle, | 272 const OperationHandle& handle, |
274 const OpenFileCallback& callback, | 273 const OpenFileCallback& callback, |
275 base::PlatformFileError rv, | 274 base::PlatformFileError rv, |
276 base::PlatformFile file, | 275 base::PlatformFile file, |
277 const base::Closure& on_close_callback, | 276 const base::Closure& on_close_callback); |
278 base::ProcessHandle peer_handle); | |
279 void DidCreateSnapshot( | 277 void DidCreateSnapshot( |
280 const OperationHandle& handle, | 278 const OperationHandle& handle, |
281 const SnapshotFileCallback& callback, | 279 const SnapshotFileCallback& callback, |
282 base::PlatformFileError rv, | 280 base::PlatformFileError rv, |
283 const base::PlatformFileInfo& file_info, | 281 const base::PlatformFileInfo& file_info, |
284 const base::FilePath& platform_path, | 282 const base::FilePath& platform_path, |
285 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 283 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
286 | 284 |
287 void OnCopyProgress( | 285 void OnCopyProgress( |
288 const OperationHandle& handle, | 286 const OperationHandle& handle, |
(...skipping 27 matching lines...) Expand all Loading... |
316 | 314 |
317 // Callbacks for stray cancels whose target operation is already finished. | 315 // Callbacks for stray cancels whose target operation is already finished. |
318 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 316 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
319 | 317 |
320 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 318 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
321 }; | 319 }; |
322 | 320 |
323 } // namespace fileapi | 321 } // namespace fileapi |
324 | 322 |
325 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 323 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |