| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILEAPI_FILE_SYSTEM_OPERATION_INTERFACE_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_INTERFACE_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util_proxy.h" | 10 #include "base/file_util_proxy.h" |
| 11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "base/process.h" | 12 #include "base/process.h" |
| 13 #include "webkit/blob/shareable_file_reference.h" | 13 #include "webkit/blob/shareable_file_reference.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class Time; | 16 class Time; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 46 // method(CreateFile, CreateDirectory, Copy, Move, DirectoryExists, | 46 // method(CreateFile, CreateDirectory, Copy, Move, DirectoryExists, |
| 47 // GetMetadata, ReadDirectory and Remove) may be called during the | 47 // GetMetadata, ReadDirectory and Remove) may be called during the |
| 48 // lifetime of this object and it should be called no more than once. | 48 // lifetime of this object and it should be called no more than once. |
| 49 // | 49 // |
| 50 // 2) Be self-destructed, or get deleted via base::Owned() after the | 50 // 2) Be self-destructed, or get deleted via base::Owned() after the |
| 51 // operation finishes and completion callback is called. | 51 // operation finishes and completion callback is called. |
| 52 // | 52 // |
| 53 // 3) Deliver the results of operations to the client via the callback function | 53 // 3) Deliver the results of operations to the client via the callback function |
| 54 // passed as the last parameter of the method. | 54 // passed as the last parameter of the method. |
| 55 // | 55 // |
| 56 class FileSystemOperationInterface { | 56 class FileSystemOperation { |
| 57 public: | 57 public: |
| 58 virtual ~FileSystemOperationInterface() {} | 58 virtual ~FileSystemOperation() {} |
| 59 | 59 |
| 60 // Used for CreateFile(), etc. |result| is the return code of the operation. | 60 // Used for CreateFile(), etc. |result| is the return code of the operation. |
| 61 typedef base::Callback<void(base::PlatformFileError result)> StatusCallback; | 61 typedef base::Callback<void(base::PlatformFileError result)> StatusCallback; |
| 62 | 62 |
| 63 // Used for GetMetadata(). |result| is the return code of the operation, | 63 // Used for GetMetadata(). |result| is the return code of the operation, |
| 64 // |file_info| is the obtained file info, and |platform_path| is the path | 64 // |file_info| is the obtained file info, and |platform_path| is the path |
| 65 // of the file. | 65 // of the file. |
| 66 typedef base::Callback< | 66 typedef base::Callback< |
| 67 void(base::PlatformFileError result, | 67 void(base::PlatformFileError result, |
| 68 const base::PlatformFileInfo& file_info, | 68 const base::PlatformFileInfo& file_info, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 kOperationTouchFile, | 271 kOperationTouchFile, |
| 272 kOperationOpenFile, | 272 kOperationOpenFile, |
| 273 kOperationCloseFile, | 273 kOperationCloseFile, |
| 274 kOperationGetLocalPath, | 274 kOperationGetLocalPath, |
| 275 kOperationCancel, | 275 kOperationCancel, |
| 276 }; | 276 }; |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 } // namespace fileapi | 279 } // namespace fileapi |
| 280 | 280 |
| 281 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_INTERFACE_H_ | 281 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| OLD | NEW |