| 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 BASE_FILES_FILE_UTIL_PROXY_H_ | 5 #ifndef BASE_FILES_FILE_UTIL_PROXY_H_ |
| 6 #define BASE_FILES_FILE_UTIL_PROXY_H_ | 6 #define BASE_FILES_FILE_UTIL_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const File::Info&)> GetFileInfoCallback; | 28 const File::Info&)> GetFileInfoCallback; |
| 29 | 29 |
| 30 // Retrieves the information about a file. It is invalid to pass a null | 30 // Retrieves the information about a file. It is invalid to pass a null |
| 31 // callback. | 31 // callback. |
| 32 // This returns false if task posting to |task_runner| has failed. | 32 // This returns false if task posting to |task_runner| has failed. |
| 33 static bool GetFileInfo( | 33 static bool GetFileInfo( |
| 34 TaskRunner* task_runner, | 34 TaskRunner* task_runner, |
| 35 const FilePath& file_path, | 35 const FilePath& file_path, |
| 36 const GetFileInfoCallback& callback); | 36 const GetFileInfoCallback& callback); |
| 37 | 37 |
| 38 // Deletes a file or a directory. | |
| 39 // It is an error to delete a non-empty directory with recursive=false. | |
| 40 // This returns false if task posting to |task_runner| has failed. | |
| 41 static bool DeleteFile(TaskRunner* task_runner, | |
| 42 const FilePath& file_path, | |
| 43 bool recursive, | |
| 44 const StatusCallback& callback); | |
| 45 | |
| 46 // Touches a file. The callback can be null. | 38 // Touches a file. The callback can be null. |
| 47 // This returns false if task posting to |task_runner| has failed. | 39 // This returns false if task posting to |task_runner| has failed. |
| 48 static bool Touch( | 40 static bool Touch( |
| 49 TaskRunner* task_runner, | 41 TaskRunner* task_runner, |
| 50 const FilePath& file_path, | 42 const FilePath& file_path, |
| 51 const Time& last_access_time, | 43 const Time& last_access_time, |
| 52 const Time& last_modified_time, | 44 const Time& last_modified_time, |
| 53 const StatusCallback& callback); | 45 const StatusCallback& callback); |
| 54 | 46 |
| 55 private: | 47 private: |
| 56 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 48 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
| 57 }; | 49 }; |
| 58 | 50 |
| 59 } // namespace base | 51 } // namespace base |
| 60 | 52 |
| 61 #endif // BASE_FILES_FILE_UTIL_PROXY_H_ | 53 #endif // BASE_FILES_FILE_UTIL_PROXY_H_ |
| OLD | NEW |