OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_ASYNC_FILE_UTIL_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
| 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
12 #include "webkit/common/fileapi/directory_entry.h" | 13 #include "webkit/common/fileapi/directory_entry.h" |
13 #include "webkit/storage/webkit_storage_export.h" | 14 #include "webkit/storage/webkit_storage_export.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class Time; | 17 class Time; |
17 } | 18 } |
18 | 19 |
19 namespace webkit_blob { | 20 namespace webkit_blob { |
20 class ShareableFileReference; | 21 class ShareableFileReference; |
21 } | 22 } |
22 | 23 |
23 namespace fileapi { | 24 namespace fileapi { |
24 | 25 |
25 class FileSystemOperationContext; | 26 class FileSystemOperationContext; |
26 class FileSystemURL; | 27 class FileSystemURL; |
27 | 28 |
28 // An interface which provides filesystem-specific file operations for | 29 // An interface which provides filesystem-specific file operations for |
29 // LocalFileSystemOperation. | 30 // LocalFileSystemOperation. |
30 // | 31 // |
31 // Each filesystem which needs to be dispatched from LocalFileSystemOperation | 32 // Each filesystem which needs to be dispatched from LocalFileSystemOperation |
32 // must implement this interface or a synchronous version of interface: | 33 // must implement this interface or a synchronous version of interface: |
33 // FileSystemFileUtil. | 34 // FileSystemFileUtil. |
34 // | 35 // |
| 36 // As far as an instance of this class is owned by a MountPointProvider |
| 37 // (which is owned by FileSystemContext), it's guaranteed that this instance's |
| 38 // alive while FileSystemOperationContext given to each operation is kept |
| 39 // alive. (Note that this instance might be freed on different thread |
| 40 // from the thread it is created.) |
35 class WEBKIT_STORAGE_EXPORT AsyncFileUtil { | 41 class WEBKIT_STORAGE_EXPORT AsyncFileUtil { |
36 public: | 42 public: |
37 typedef base::Callback< | 43 typedef base::Callback< |
38 void(base::PlatformFileError result)> StatusCallback; | 44 void(base::PlatformFileError result)> StatusCallback; |
39 | 45 |
40 typedef base::FileUtilProxy::CreateOrOpenCallback CreateOrOpenCallback; | 46 typedef base::FileUtilProxy::CreateOrOpenCallback CreateOrOpenCallback; |
41 | 47 |
42 typedef base::Callback< | 48 typedef base::Callback< |
43 void(base::PlatformFileError result, | 49 void(base::PlatformFileError result, |
44 bool created)> EnsureFileExistsCallback; | 50 bool created)> EnsureFileExistsCallback; |
(...skipping 23 matching lines...) Expand all Loading... |
68 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 74 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create |
69 // a new file at the given |url| and calls back with | 75 // a new file at the given |url| and calls back with |
70 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |url| already exists. | 76 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |url| already exists. |
71 // | 77 // |
72 // LocalFileSystemOperation::OpenFile calls this. | 78 // LocalFileSystemOperation::OpenFile calls this. |
73 // This is used only by Pepper/NaCL File API. | 79 // This is used only by Pepper/NaCL File API. |
74 // | 80 // |
75 // This returns false if it fails to post an async task. | 81 // This returns false if it fails to post an async task. |
76 // | 82 // |
77 virtual bool CreateOrOpen( | 83 virtual bool CreateOrOpen( |
78 FileSystemOperationContext* context, | 84 scoped_ptr<FileSystemOperationContext> context, |
79 const FileSystemURL& url, | 85 const FileSystemURL& url, |
80 int file_flags, | 86 int file_flags, |
81 const CreateOrOpenCallback& callback) = 0; | 87 const CreateOrOpenCallback& callback) = 0; |
82 | 88 |
83 // Ensures that the given |url| exist. This creates a empty new file | 89 // Ensures that the given |url| exist. This creates a empty new file |
84 // at |url| if the |url| does not exist. | 90 // at |url| if the |url| does not exist. |
85 // | 91 // |
86 // LocalFileSystemOperation::CreateFile calls this. | 92 // LocalFileSystemOperation::CreateFile calls this. |
87 // | 93 // |
88 // This returns false if it fails to post an async task. | 94 // This returns false if it fails to post an async task. |
89 // | 95 // |
90 // This reports following error code via |callback|: | 96 // This reports following error code via |callback|: |
91 // - PLATFORM_FILE_OK and created==true if a file has not existed and | 97 // - PLATFORM_FILE_OK and created==true if a file has not existed and |
92 // is created at |url|. | 98 // is created at |url|. |
93 // - PLATFORM_FILE_OK and created==false if the file already exists. | 99 // - PLATFORM_FILE_OK and created==false if the file already exists. |
94 // - Other error code (with created=false) if a file hasn't existed yet | 100 // - Other error code (with created=false) if a file hasn't existed yet |
95 // and there was an error while creating a new file. | 101 // and there was an error while creating a new file. |
96 // | 102 // |
97 virtual bool EnsureFileExists( | 103 virtual bool EnsureFileExists( |
98 FileSystemOperationContext* context, | 104 scoped_ptr<FileSystemOperationContext> context, |
99 const FileSystemURL& url, | 105 const FileSystemURL& url, |
100 const EnsureFileExistsCallback& callback) = 0; | 106 const EnsureFileExistsCallback& callback) = 0; |
101 | 107 |
102 // Creates directory at given url. | 108 // Creates directory at given url. |
103 // | 109 // |
104 // LocalFileSystemOperation::CreateDirectory calls this. | 110 // LocalFileSystemOperation::CreateDirectory calls this. |
105 // | 111 // |
106 // This returns false if it fails to post an async task. | 112 // This returns false if it fails to post an async task. |
107 // | 113 // |
108 // This reports following error code via |callback|: | 114 // This reports following error code via |callback|: |
109 // - PLATFORM_FILE_ERROR_NOT_FOUND if the |url|'s parent directory | 115 // - PLATFORM_FILE_ERROR_NOT_FOUND if the |url|'s parent directory |
110 // does not exist and |recursive| is false. | 116 // does not exist and |recursive| is false. |
111 // - PLATFORM_FILE_ERROR_EXISTS if a directory already exists at |url| | 117 // - PLATFORM_FILE_ERROR_EXISTS if a directory already exists at |url| |
112 // and |exclusive| is true. | 118 // and |exclusive| is true. |
113 // - PLATFORM_FILE_ERROR_EXISTS if a file already exists at |url| | 119 // - PLATFORM_FILE_ERROR_EXISTS if a file already exists at |url| |
114 // (regardless of |exclusive| value). | 120 // (regardless of |exclusive| value). |
115 // - Other error code if it failed to create a directory. | 121 // - Other error code if it failed to create a directory. |
116 // | 122 // |
117 virtual bool CreateDirectory( | 123 virtual bool CreateDirectory( |
118 FileSystemOperationContext* context, | 124 scoped_ptr<FileSystemOperationContext> context, |
119 const FileSystemURL& url, | 125 const FileSystemURL& url, |
120 bool exclusive, | 126 bool exclusive, |
121 bool recursive, | 127 bool recursive, |
122 const StatusCallback& callback) = 0; | 128 const StatusCallback& callback) = 0; |
123 | 129 |
124 // Retrieves the information about a file. | 130 // Retrieves the information about a file. |
125 // | 131 // |
126 // LocalFileSystemOperation::GetMetadata calls this. | 132 // LocalFileSystemOperation::GetMetadata calls this. |
127 // | 133 // |
128 // This returns false if it fails to post an async task. | 134 // This returns false if it fails to post an async task. |
129 // | 135 // |
130 // This reports following error code via |callback|: | 136 // This reports following error code via |callback|: |
131 // - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist. | 137 // - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist. |
132 // - Other error code if there was an error while retrieving the file info. | 138 // - Other error code if there was an error while retrieving the file info. |
133 // | 139 // |
134 virtual bool GetFileInfo( | 140 virtual bool GetFileInfo( |
135 FileSystemOperationContext* context, | 141 scoped_ptr<FileSystemOperationContext> context, |
136 const FileSystemURL& url, | 142 const FileSystemURL& url, |
137 const GetFileInfoCallback& callback) = 0; | 143 const GetFileInfoCallback& callback) = 0; |
138 | 144 |
139 // Reads contents of a directory at |path|. | 145 // Reads contents of a directory at |path|. |
140 // | 146 // |
141 // LocalFileSystemOperation::ReadDirectory calls this. | 147 // LocalFileSystemOperation::ReadDirectory calls this. |
142 // | 148 // |
143 // Note that the |name| field of each entry in |file_list| | 149 // Note that the |name| field of each entry in |file_list| |
144 // returned by |callback| should have a base file name | 150 // returned by |callback| should have a base file name |
145 // of the entry relative to the directory, but not an absolute path. | 151 // of the entry relative to the directory, but not an absolute path. |
146 // | 152 // |
147 // (E.g. if ReadDirectory is called for a directory | 153 // (E.g. if ReadDirectory is called for a directory |
148 // 'path/to/dir' and the directory has entries 'a' and 'b', | 154 // 'path/to/dir' and the directory has entries 'a' and 'b', |
149 // the returned |file_list| should include entries whose names | 155 // the returned |file_list| should include entries whose names |
150 // are 'a' and 'b', but not '/path/to/dir/a' and '/path/to/dir/b'.) | 156 // are 'a' and 'b', but not '/path/to/dir/a' and '/path/to/dir/b'.) |
151 // | 157 // |
152 // This returns false if it fails to post an async task. | 158 // This returns false if it fails to post an async task. |
153 // | 159 // |
154 // This reports following error code via |callback|: | 160 // This reports following error code via |callback|: |
155 // - PLATFORM_FILE_ERROR_NOT_FOUND if the target directory doesn't exist. | 161 // - PLATFORM_FILE_ERROR_NOT_FOUND if the target directory doesn't exist. |
156 // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if an entry exists at |url| but | 162 // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if an entry exists at |url| but |
157 // is a file (not a directory). | 163 // is a file (not a directory). |
158 // | 164 // |
159 virtual bool ReadDirectory( | 165 virtual bool ReadDirectory( |
160 FileSystemOperationContext* context, | 166 scoped_ptr<FileSystemOperationContext> context, |
161 const FileSystemURL& url, | 167 const FileSystemURL& url, |
162 const ReadDirectoryCallback& callback) = 0; | 168 const ReadDirectoryCallback& callback) = 0; |
163 | 169 |
164 // Modifies timestamps of a file or directory at |url| with | 170 // Modifies timestamps of a file or directory at |url| with |
165 // |last_access_time| and |last_modified_time|. The function DOES NOT | 171 // |last_access_time| and |last_modified_time|. The function DOES NOT |
166 // create a file unlike 'touch' command on Linux. | 172 // create a file unlike 'touch' command on Linux. |
167 // | 173 // |
168 // LocalFileSystemOperation::TouchFile calls this. | 174 // LocalFileSystemOperation::TouchFile calls this. |
169 // This is used only by Pepper/NaCL File API. | 175 // This is used only by Pepper/NaCL File API. |
170 // | 176 // |
171 // This returns false if it fails to post an async task. | 177 // This returns false if it fails to post an async task. |
172 virtual bool Touch( | 178 virtual bool Touch( |
173 FileSystemOperationContext* context, | 179 scoped_ptr<FileSystemOperationContext> context, |
174 const FileSystemURL& url, | 180 const FileSystemURL& url, |
175 const base::Time& last_access_time, | 181 const base::Time& last_access_time, |
176 const base::Time& last_modified_time, | 182 const base::Time& last_modified_time, |
177 const StatusCallback& callback) = 0; | 183 const StatusCallback& callback) = 0; |
178 | 184 |
179 // Truncates a file at |path| to |length|. If |length| is larger than | 185 // Truncates a file at |path| to |length|. If |length| is larger than |
180 // the original file size, the file will be extended, and the extended | 186 // the original file size, the file will be extended, and the extended |
181 // part is filled with null bytes. | 187 // part is filled with null bytes. |
182 // | 188 // |
183 // LocalFileSystemOperation::Truncate calls this. | 189 // LocalFileSystemOperation::Truncate calls this. |
184 // | 190 // |
185 // This returns false if it fails to post an async task. | 191 // This returns false if it fails to post an async task. |
186 // | 192 // |
187 // This reports following error code via |callback|: | 193 // This reports following error code via |callback|: |
188 // - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist. | 194 // - PLATFORM_FILE_ERROR_NOT_FOUND if the file doesn't exist. |
189 // | 195 // |
190 virtual bool Truncate( | 196 virtual bool Truncate( |
191 FileSystemOperationContext* context, | 197 scoped_ptr<FileSystemOperationContext> context, |
192 const FileSystemURL& url, | 198 const FileSystemURL& url, |
193 int64 length, | 199 int64 length, |
194 const StatusCallback& callback) = 0; | 200 const StatusCallback& callback) = 0; |
195 | 201 |
196 // Copies a file from |src_url| to |dest_url|. | 202 // Copies a file from |src_url| to |dest_url|. |
197 // This must be called for files that belong to the same filesystem | 203 // This must be called for files that belong to the same filesystem |
198 // (i.e. type() and origin() of the |src_url| and |dest_url| must match). | 204 // (i.e. type() and origin() of the |src_url| and |dest_url| must match). |
199 // | 205 // |
200 // LocalFileSystemOperation::Copy calls this for same-filesystem copy case. | 206 // LocalFileSystemOperation::Copy calls this for same-filesystem copy case. |
201 // | 207 // |
202 // This returns false if it fails to post an async task. | 208 // This returns false if it fails to post an async task. |
203 // | 209 // |
204 // This reports following error code via |callback|: | 210 // This reports following error code via |callback|: |
205 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| | 211 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| |
206 // or the parent directory of |dest_url| does not exist. | 212 // or the parent directory of |dest_url| does not exist. |
207 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. | 213 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. |
208 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and | 214 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and |
209 // is not a file. | 215 // is not a file. |
210 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and | 216 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and |
211 // its parent path is a file. | 217 // its parent path is a file. |
212 // | 218 // |
213 virtual bool CopyFileLocal( | 219 virtual bool CopyFileLocal( |
214 FileSystemOperationContext* context, | 220 scoped_ptr<FileSystemOperationContext> context, |
215 const FileSystemURL& src_url, | 221 const FileSystemURL& src_url, |
216 const FileSystemURL& dest_url, | 222 const FileSystemURL& dest_url, |
217 const StatusCallback& callback) = 0; | 223 const StatusCallback& callback) = 0; |
218 | 224 |
219 // Moves a local file from |src_url| to |dest_url|. | 225 // Moves a local file from |src_url| to |dest_url|. |
220 // This must be called for files that belong to the same filesystem | 226 // This must be called for files that belong to the same filesystem |
221 // (i.e. type() and origin() of the |src_url| and |dest_url| must match). | 227 // (i.e. type() and origin() of the |src_url| and |dest_url| must match). |
222 // | 228 // |
223 // LocalFileSystemOperation::Move calls this for same-filesystem move case. | 229 // LocalFileSystemOperation::Move calls this for same-filesystem move case. |
224 // | 230 // |
225 // This returns false if it fails to post an async task. | 231 // This returns false if it fails to post an async task. |
226 // | 232 // |
227 // This reports following error code via |callback|: | 233 // This reports following error code via |callback|: |
228 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| | 234 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| |
229 // or the parent directory of |dest_url| does not exist. | 235 // or the parent directory of |dest_url| does not exist. |
230 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. | 236 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. |
231 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and | 237 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and |
232 // is not a file. | 238 // is not a file. |
233 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and | 239 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and |
234 // its parent path is a file. | 240 // its parent path is a file. |
235 // | 241 // |
236 virtual bool MoveFileLocal( | 242 virtual bool MoveFileLocal( |
237 FileSystemOperationContext* context, | 243 scoped_ptr<FileSystemOperationContext> context, |
238 const FileSystemURL& src_url, | 244 const FileSystemURL& src_url, |
239 const FileSystemURL& dest_url, | 245 const FileSystemURL& dest_url, |
240 const StatusCallback& callback) = 0; | 246 const StatusCallback& callback) = 0; |
241 | 247 |
242 // Copies in a single file from a different filesystem. | 248 // Copies in a single file from a different filesystem. |
243 // | 249 // |
244 // LocalFileSystemOperation::Copy or Move calls this for cross-filesystem | 250 // LocalFileSystemOperation::Copy or Move calls this for cross-filesystem |
245 // cases. | 251 // cases. |
246 // | 252 // |
247 // This returns false if it fails to post an async task. | 253 // This returns false if it fails to post an async task. |
248 // | 254 // |
249 // This reports following error code via |callback|: | 255 // This reports following error code via |callback|: |
250 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path| | 256 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path| |
251 // or the parent directory of |dest_url| does not exist. | 257 // or the parent directory of |dest_url| does not exist. |
252 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and | 258 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and |
253 // is not a file. | 259 // is not a file. |
254 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and | 260 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and |
255 // its parent path is a file. | 261 // its parent path is a file. |
256 // | 262 // |
257 virtual bool CopyInForeignFile( | 263 virtual bool CopyInForeignFile( |
258 FileSystemOperationContext* context, | 264 scoped_ptr<FileSystemOperationContext> context, |
259 const base::FilePath& src_file_path, | 265 const base::FilePath& src_file_path, |
260 const FileSystemURL& dest_url, | 266 const FileSystemURL& dest_url, |
261 const StatusCallback& callback) = 0; | 267 const StatusCallback& callback) = 0; |
262 | 268 |
263 // Deletes a single file. | 269 // Deletes a single file. |
264 // | 270 // |
265 // LocalFileSystemOperation::RemoveFile calls this. | 271 // LocalFileSystemOperation::RemoveFile calls this. |
266 // | 272 // |
267 // This returns false if it fails to post an async task. | 273 // This returns false if it fails to post an async task. |
268 // | 274 // |
269 // This reports following error code via |callback|: | 275 // This reports following error code via |callback|: |
270 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. | 276 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. |
271 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. | 277 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. |
272 // | 278 // |
273 virtual bool DeleteFile( | 279 virtual bool DeleteFile( |
274 FileSystemOperationContext* context, | 280 scoped_ptr<FileSystemOperationContext> context, |
275 const FileSystemURL& url, | 281 const FileSystemURL& url, |
276 const StatusCallback& callback) = 0; | 282 const StatusCallback& callback) = 0; |
277 | 283 |
278 // Removes a single empty directory. | 284 // Removes a single empty directory. |
279 // | 285 // |
280 // LocalFileSystemOperation::RemoveDirectory calls this. | 286 // LocalFileSystemOperation::RemoveDirectory calls this. |
281 // | 287 // |
282 // This returns false if it fails to post an async task. | 288 // This returns false if it fails to post an async task. |
283 // | 289 // |
284 // This reports following error code via |callback|: | 290 // This reports following error code via |callback|: |
285 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. | 291 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. |
286 // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if |url| is not a directory. | 292 // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if |url| is not a directory. |
287 // - PLATFORM_FILE_ERROR_NOT_EMPTY if |url| is not empty. | 293 // - PLATFORM_FILE_ERROR_NOT_EMPTY if |url| is not empty. |
288 // | 294 // |
289 virtual bool DeleteDirectory( | 295 virtual bool DeleteDirectory( |
290 FileSystemOperationContext* context, | 296 scoped_ptr<FileSystemOperationContext> context, |
291 const FileSystemURL& url, | 297 const FileSystemURL& url, |
292 const StatusCallback& callback) = 0; | 298 const StatusCallback& callback) = 0; |
293 | 299 |
294 // Creates a local snapshot file for a given |url| and returns the | 300 // Creates a local snapshot file for a given |url| and returns the |
295 // metadata and platform path of the snapshot file via |callback|. | 301 // metadata and platform path of the snapshot file via |callback|. |
296 // In regular filesystem cases the implementation may simply return | 302 // In regular filesystem cases the implementation may simply return |
297 // the metadata of the file itself (as well as GetMetadata does), | 303 // the metadata of the file itself (as well as GetMetadata does), |
298 // while in non-regular filesystem case the backend may create a | 304 // while in non-regular filesystem case the backend may create a |
299 // temporary snapshot file which holds the file data and return | 305 // temporary snapshot file which holds the file data and return |
300 // the metadata of the temporary file. | 306 // the metadata of the temporary file. |
(...skipping 17 matching lines...) Expand all Loading... |
318 // This returns false if it fails to post an async task. | 324 // This returns false if it fails to post an async task. |
319 // | 325 // |
320 // This reports following error code via |callback|: | 326 // This reports following error code via |callback|: |
321 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. | 327 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. |
322 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| exists but is a directory. | 328 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| exists but is a directory. |
323 // | 329 // |
324 // The field values of |file_info| are undefined (implementation | 330 // The field values of |file_info| are undefined (implementation |
325 // dependent) in error cases, and the caller should always | 331 // dependent) in error cases, and the caller should always |
326 // check the return code. | 332 // check the return code. |
327 virtual bool CreateSnapshotFile( | 333 virtual bool CreateSnapshotFile( |
328 FileSystemOperationContext* context, | 334 scoped_ptr<FileSystemOperationContext> context, |
329 const FileSystemURL& url, | 335 const FileSystemURL& url, |
330 const CreateSnapshotFileCallback& callback) = 0; | 336 const CreateSnapshotFileCallback& callback) = 0; |
331 | 337 |
332 private: | 338 private: |
333 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 339 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
334 }; | 340 }; |
335 | 341 |
336 } // namespace fileapi | 342 } // namespace fileapi |
337 | 343 |
338 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 344 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
OLD | NEW |