| 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_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
| 13 | 13 |
| 14 namespace tracked_objects { | 14 namespace tracked_objects { |
| 15 class Location; | 15 class Location; |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 | 19 |
| 20 class TaskRunner; | 20 class TaskRunner; |
| 21 class Time; | 21 class Time; |
| 22 | 22 |
| 23 // This class provides asynchronous access to common file routines. | 23 // This class provides asynchronous access to common file routines. |
| 24 class BASE_EXPORT FileUtilProxy { | 24 class BASE_EXPORT FileUtilProxy { |
| 25 public: | 25 public: |
| 26 // Holds metadata for file or directory entry. | |
| 27 struct Entry { | |
| 28 FilePath::StringType name; | |
| 29 bool is_directory; | |
| 30 int64 size; | |
| 31 base::Time last_modified_time; | |
| 32 }; | |
| 33 | |
| 34 // This callback is used by methods that report only an error code. It is | 26 // This callback is used by methods that report only an error code. It is |
| 35 // valid to pass a null callback to any function that takes a StatusCallback, | 27 // valid to pass a null callback to any function that takes a StatusCallback, |
| 36 // in which case the operation will complete silently. | 28 // in which case the operation will complete silently. |
| 37 typedef Callback<void(PlatformFileError)> StatusCallback; | 29 typedef Callback<void(PlatformFileError)> StatusCallback; |
| 38 | 30 |
| 39 typedef Callback<void(PlatformFileError, | 31 typedef Callback<void(PlatformFileError, |
| 40 PassPlatformFile, | 32 PassPlatformFile, |
| 41 bool /* created */)> CreateOrOpenCallback; | 33 bool /* created */)> CreateOrOpenCallback; |
| 42 typedef Callback<void(PlatformFileError, | 34 typedef Callback<void(PlatformFileError, |
| 43 PassPlatformFile, | 35 PassPlatformFile, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 PlatformFile, | 193 PlatformFile, |
| 202 const StatusCallback& callback); | 194 const StatusCallback& callback); |
| 203 | 195 |
| 204 private: | 196 private: |
| 205 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 197 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
| 206 }; | 198 }; |
| 207 | 199 |
| 208 } // namespace base | 200 } // namespace base |
| 209 | 201 |
| 210 #endif // BASE_FILES_FILE_UTIL_PROXY_H_ | 202 #endif // BASE_FILES_FILE_UTIL_PROXY_H_ |
| OLD | NEW |