| 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, |
| 148 const OpenFileCallback& callback); | 149 const OpenFileCallback& callback); |
| 149 | 150 |
| 150 // Creates a local snapshot file for a given |url| and returns the | 151 // Creates a local snapshot file for a given |url| and returns the |
| 151 // metadata and platform url of the snapshot file via |callback|. | 152 // metadata and platform url of the snapshot file via |callback|. |
| 152 // In local filesystem cases the implementation may simply return | 153 // In local filesystem cases the implementation may simply return |
| 153 // the metadata of the file itself (as well as GetMetadata does), | 154 // the metadata of the file itself (as well as GetMetadata does), |
| 154 // while in remote filesystem case the backend may want to download the file | 155 // while in remote filesystem case the backend may want to download the file |
| 155 // into a temporary snapshot file and return the metadata of the | 156 // into a temporary snapshot file and return the metadata of the |
| 156 // temporary file. Or if the implementaiton already has the local cache | 157 // temporary file. Or if the implementaiton already has the local cache |
| 157 // data for |url| it can simply return the url to the cache. | 158 // 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... |
| 266 void DidWrite(const OperationHandle& handle, | 267 void DidWrite(const OperationHandle& handle, |
| 267 const WriteCallback& callback, | 268 const WriteCallback& callback, |
| 268 base::PlatformFileError rv, | 269 base::PlatformFileError rv, |
| 269 int64 bytes, | 270 int64 bytes, |
| 270 bool complete); | 271 bool complete); |
| 271 void DidOpenFile( | 272 void DidOpenFile( |
| 272 const OperationHandle& handle, | 273 const OperationHandle& handle, |
| 273 const OpenFileCallback& callback, | 274 const OpenFileCallback& callback, |
| 274 base::PlatformFileError rv, | 275 base::PlatformFileError rv, |
| 275 base::PlatformFile file, | 276 base::PlatformFile file, |
| 276 const base::Closure& on_close_callback); | 277 const base::Closure& on_close_callback, |
| 278 base::ProcessHandle peer_handle); |
| 277 void DidCreateSnapshot( | 279 void DidCreateSnapshot( |
| 278 const OperationHandle& handle, | 280 const OperationHandle& handle, |
| 279 const SnapshotFileCallback& callback, | 281 const SnapshotFileCallback& callback, |
| 280 base::PlatformFileError rv, | 282 base::PlatformFileError rv, |
| 281 const base::PlatformFileInfo& file_info, | 283 const base::PlatformFileInfo& file_info, |
| 282 const base::FilePath& platform_path, | 284 const base::FilePath& platform_path, |
| 283 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 285 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
| 284 | 286 |
| 285 void OnCopyProgress( | 287 void OnCopyProgress( |
| 286 const OperationHandle& handle, | 288 const OperationHandle& handle, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 314 | 316 |
| 315 // Callbacks for stray cancels whose target operation is already finished. | 317 // Callbacks for stray cancels whose target operation is already finished. |
| 316 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 318 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
| 317 | 319 |
| 318 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 320 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
| 319 }; | 321 }; |
| 320 | 322 |
| 321 } // namespace fileapi | 323 } // namespace fileapi |
| 322 | 324 |
| 323 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 325 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
| OLD | NEW |