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_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Used for CreateFile(), etc. |result| is the return code of the operation. | 58 // Used for CreateFile(), etc. |result| is the return code of the operation. |
59 typedef base::Callback<void(base::PlatformFileError result)> StatusCallback; | 59 typedef base::Callback<void(base::PlatformFileError result)> StatusCallback; |
60 | 60 |
61 // Used for GetMetadata(). |result| is the return code of the operation, | 61 // Used for GetMetadata(). |result| is the return code of the operation, |
62 // |file_info| is the obtained file info, and |platform_path| is the path | 62 // |file_info| is the obtained file info, and |platform_path| is the path |
63 // of the file. | 63 // of the file. |
64 typedef base::Callback< | 64 typedef base::Callback< |
65 void(base::PlatformFileError result, | 65 void(base::PlatformFileError result, |
66 const base::PlatformFileInfo& file_info, | 66 const base::PlatformFileInfo& file_info, |
67 const FilePath& platform_path)> GetMetadataCallback; | 67 const base::FilePath& platform_path)> GetMetadataCallback; |
68 | 68 |
69 // Used for OpenFile(). |result| is the return code of the operation. | 69 // Used for OpenFile(). |result| is the return code of the operation. |
70 typedef base::Callback< | 70 typedef base::Callback< |
71 void(base::PlatformFileError result, | 71 void(base::PlatformFileError result, |
72 base::PlatformFile file, | 72 base::PlatformFile file, |
73 base::ProcessHandle peer_handle)> OpenFileCallback; | 73 base::ProcessHandle peer_handle)> OpenFileCallback; |
74 | 74 |
75 // Used for ReadDirectoryCallback. | 75 // Used for ReadDirectoryCallback. |
76 typedef std::vector<base::FileUtilProxy::Entry> FileEntryList; | 76 typedef std::vector<base::FileUtilProxy::Entry> FileEntryList; |
77 | 77 |
(...skipping 22 matching lines...) Expand all Loading... |
100 // file does not require any handling) the implementation can just | 100 // file does not require any handling) the implementation can just |
101 // return NULL. In a more complex case, the implementaiton can manage | 101 // return NULL. In a more complex case, the implementaiton can manage |
102 // the lifetime of the snapshot file on its own (e.g. by its cache system) | 102 // the lifetime of the snapshot file on its own (e.g. by its cache system) |
103 // but also can be notified via the reference when the file becomes no | 103 // but also can be notified via the reference when the file becomes no |
104 // longer necessary in the javascript world. | 104 // longer necessary in the javascript world. |
105 // Please see the comment for ShareableFileReference for details. | 105 // Please see the comment for ShareableFileReference for details. |
106 // | 106 // |
107 typedef base::Callback< | 107 typedef base::Callback< |
108 void(base::PlatformFileError result, | 108 void(base::PlatformFileError result, |
109 const base::PlatformFileInfo& file_info, | 109 const base::PlatformFileInfo& file_info, |
110 const FilePath& platform_path, | 110 const base::FilePath& platform_path, |
111 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> | 111 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> |
112 SnapshotFileCallback; | 112 SnapshotFileCallback; |
113 | 113 |
114 // Used for Write(). | 114 // Used for Write(). |
115 typedef base::Callback<void(base::PlatformFileError result, | 115 typedef base::Callback<void(base::PlatformFileError result, |
116 int64 bytes, | 116 int64 bytes, |
117 bool complete)> WriteCallback; | 117 bool complete)> WriteCallback; |
118 | 118 |
119 // Creates a file at |path|. If |exclusive| is true, an error is raised | 119 // Creates a file at |path|. If |exclusive| is true, an error is raised |
120 // in case a file is already present at the URL. | 120 // in case a file is already present at the URL. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 kOperationOpenFile, | 271 kOperationOpenFile, |
272 kOperationCloseFile, | 272 kOperationCloseFile, |
273 kOperationGetLocalPath, | 273 kOperationGetLocalPath, |
274 kOperationCancel, | 274 kOperationCancel, |
275 }; | 275 }; |
276 }; | 276 }; |
277 | 277 |
278 } // namespace fileapi | 278 } // namespace fileapi |
279 | 279 |
280 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 280 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |