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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // its parent path is a file. | 227 // its parent path is a file. |
228 // | 228 // |
229 OperationID MoveFileLocal(const FileSystemURL& src_url, | 229 OperationID MoveFileLocal(const FileSystemURL& src_url, |
230 const FileSystemURL& dest_url, | 230 const FileSystemURL& dest_url, |
231 CopyOrMoveOption option, | 231 CopyOrMoveOption option, |
232 const StatusCallback& callback); | 232 const StatusCallback& callback); |
233 | 233 |
234 // This is called only by pepper plugin as of writing to synchronously get | 234 // This is called only by pepper plugin as of writing to synchronously get |
235 // the underlying platform path to upload a file in the sandboxed filesystem | 235 // the underlying platform path to upload a file in the sandboxed filesystem |
236 // (e.g. TEMPORARY or PERSISTENT). | 236 // (e.g. TEMPORARY or PERSISTENT). |
237 base::PlatformFileError SyncGetPlatformPath(const FileSystemURL& url, | 237 base::File::Error SyncGetPlatformPath(const FileSystemURL& url, |
238 base::FilePath* platform_path); | 238 base::FilePath* platform_path); |
239 | 239 |
240 private: | 240 private: |
241 class BeginOperationScoper; | 241 class BeginOperationScoper; |
242 | 242 |
243 struct OperationHandle { | 243 struct OperationHandle { |
244 OperationID id; | 244 OperationID id; |
245 base::WeakPtr<BeginOperationScoper> scope; | 245 base::WeakPtr<BeginOperationScoper> scope; |
246 | 246 |
247 OperationHandle(); | 247 OperationHandle(); |
248 ~OperationHandle(); | 248 ~OperationHandle(); |
249 }; | 249 }; |
250 | 250 |
251 friend class FileSystemContext; | 251 friend class FileSystemContext; |
252 explicit FileSystemOperationRunner(FileSystemContext* file_system_context); | 252 explicit FileSystemOperationRunner(FileSystemContext* file_system_context); |
253 | 253 |
254 void DidFinish(const OperationHandle& handle, | 254 void DidFinish(const OperationHandle& handle, |
255 const StatusCallback& callback, | 255 const StatusCallback& callback, |
256 base::PlatformFileError rv); | 256 base::File::Error rv); |
257 void DidGetMetadata(const OperationHandle& handle, | 257 void DidGetMetadata(const OperationHandle& handle, |
258 const GetMetadataCallback& callback, | 258 const GetMetadataCallback& callback, |
259 base::PlatformFileError rv, | 259 base::File::Error rv, |
260 const base::PlatformFileInfo& file_info); | 260 const base::File::Info& file_info); |
261 void DidReadDirectory(const OperationHandle& handle, | 261 void DidReadDirectory(const OperationHandle& handle, |
262 const ReadDirectoryCallback& callback, | 262 const ReadDirectoryCallback& callback, |
263 base::PlatformFileError rv, | 263 base::File::Error rv, |
264 const std::vector<DirectoryEntry>& entries, | 264 const std::vector<DirectoryEntry>& entries, |
265 bool has_more); | 265 bool has_more); |
266 void DidWrite(const OperationHandle& handle, | 266 void DidWrite(const OperationHandle& handle, |
267 const WriteCallback& callback, | 267 const WriteCallback& callback, |
268 base::PlatformFileError rv, | 268 base::File::Error rv, |
269 int64 bytes, | 269 int64 bytes, |
270 bool complete); | 270 bool complete); |
271 void DidOpenFile( | 271 void DidOpenFile( |
272 const OperationHandle& handle, | 272 const OperationHandle& handle, |
273 const OpenFileCallback& callback, | 273 const OpenFileCallback& callback, |
274 base::PlatformFileError rv, | 274 base::File::Error rv, |
275 base::PlatformFile file, | 275 base::PlatformFile file, |
276 const base::Closure& on_close_callback); | 276 const base::Closure& on_close_callback); |
277 void DidCreateSnapshot( | 277 void DidCreateSnapshot( |
278 const OperationHandle& handle, | 278 const OperationHandle& handle, |
279 const SnapshotFileCallback& callback, | 279 const SnapshotFileCallback& callback, |
280 base::PlatformFileError rv, | 280 base::File::Error rv, |
281 const base::PlatformFileInfo& file_info, | 281 const base::File::Info& file_info, |
282 const base::FilePath& platform_path, | 282 const base::FilePath& platform_path, |
283 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 283 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
284 | 284 |
285 void OnCopyProgress( | 285 void OnCopyProgress( |
286 const OperationHandle& handle, | 286 const OperationHandle& handle, |
287 const CopyProgressCallback& callback, | 287 const CopyProgressCallback& callback, |
288 FileSystemOperation::CopyProgressType type, | 288 FileSystemOperation::CopyProgressType type, |
289 const FileSystemURL& source_url, | 289 const FileSystemURL& source_url, |
290 const FileSystemURL& dest_url, | 290 const FileSystemURL& dest_url, |
291 int64 size); | 291 int64 size); |
(...skipping 22 matching lines...) Expand all Loading... |
314 | 314 |
315 // Callbacks for stray cancels whose target operation is already finished. | 315 // Callbacks for stray cancels whose target operation is already finished. |
316 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; | 316 std::map<OperationID, StatusCallback> stray_cancel_callbacks_; |
317 | 317 |
318 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); | 318 DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); |
319 }; | 319 }; |
320 | 320 |
321 } // namespace fileapi | 321 } // namespace fileapi |
322 | 322 |
323 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ | 323 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ |
OLD | NEW |