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_FILE_UTIL_PROXY_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 typedef FileSystemOperation::GetMetadataCallback GetFileInfoCallback; | 34 typedef FileSystemOperation::GetMetadataCallback GetFileInfoCallback; |
35 typedef FileSystemOperation::ReadDirectoryCallback ReadDirectoryCallback; | 35 typedef FileSystemOperation::ReadDirectoryCallback ReadDirectoryCallback; |
36 | 36 |
37 typedef base::Callback< | 37 typedef base::Callback< |
38 void(base::PlatformFileError result, | 38 void(base::PlatformFileError result, |
39 const base::PlatformFileInfo& file_info, | 39 const base::PlatformFileInfo& file_info, |
40 const FilePath& platform_path, | 40 const FilePath& platform_path, |
41 FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)> | 41 FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)> |
42 SnapshotFileCallback; | 42 SnapshotFileCallback; |
43 | 43 |
44 // Deletes a file or a directory on the given context's task_runner. | 44 // Deletes a file on the given context's task_runner. |
45 // It is an error to delete a non-empty directory with recursive=false. | 45 static bool DeleteFile( |
46 static bool Delete( | |
47 FileSystemOperationContext* context, | 46 FileSystemOperationContext* context, |
48 FileSystemFileUtil* file_util, | 47 FileSystemFileUtil* file_util, |
49 const FileSystemURL& url, | 48 const FileSystemURL& url, |
50 bool recursive, | 49 const StatusCallback& callback); |
| 50 |
| 51 // Deletes a directory on the given context's task_runner. |
| 52 static bool DeleteDirectory( |
| 53 FileSystemOperationContext* context, |
| 54 FileSystemFileUtil* file_util, |
| 55 const FileSystemURL& url, |
51 const StatusCallback& callback); | 56 const StatusCallback& callback); |
52 | 57 |
53 // Creates or opens a file with the given flags by calling |file_util|'s | 58 // Creates or opens a file with the given flags by calling |file_util|'s |
54 // CreateOrOpen method on the given context's task_runner. | 59 // CreateOrOpen method on the given context's task_runner. |
55 static bool CreateOrOpen( | 60 static bool CreateOrOpen( |
56 FileSystemOperationContext* context, | 61 FileSystemOperationContext* context, |
57 FileSystemFileUtil* file_util, | 62 FileSystemFileUtil* file_util, |
58 const FileSystemURL& url, | 63 const FileSystemURL& url, |
59 int file_flags, | 64 int file_flags, |
60 const CreateOrOpenCallback& callback); | 65 const CreateOrOpenCallback& callback); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 int64 length, | 172 int64 length, |
168 const StatusCallback& callback); | 173 const StatusCallback& callback); |
169 | 174 |
170 private: | 175 private: |
171 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); | 176 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemFileUtilProxy); |
172 }; | 177 }; |
173 | 178 |
174 } // namespace fileapi | 179 } // namespace fileapi |
175 | 180 |
176 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ | 181 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_PROXY_H_ |
OLD | NEW |