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_FILE_UTIL_PROXY_H_ | 5 #ifndef BASE_FILE_UTIL_PROXY_H_ |
6 #define BASE_FILE_UTIL_PROXY_H_ | 6 #define BASE_FILE_UTIL_PROXY_H_ |
7 | 7 |
8 #include <vector> | |
9 | |
10 #include "base/base_export.h" | 8 #include "base/base_export.h" |
11 #include "base/callback.h" | 9 #include "base/callback_forward.h" |
12 #include "base/file_path.h" | 10 #include "base/file_path.h" |
13 #include "base/file_util.h" | 11 #include "base/file_util.h" |
14 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
15 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
16 #include "base/tracked_objects.h" | 14 |
| 15 namespace tracked_objects { |
| 16 class Location; |
| 17 }; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 | 20 |
20 class TaskRunner; | 21 class TaskRunner; |
21 class Time; | 22 class Time; |
22 | 23 |
23 // This class provides asynchronous access to common file routines. | 24 // This class provides asynchronous access to common file routines. |
24 class BASE_EXPORT FileUtilProxy { | 25 class BASE_EXPORT FileUtilProxy { |
25 public: | 26 public: |
26 // Holds metadata for file or directory entry. | 27 // Holds metadata for file or directory entry. |
27 struct Entry { | 28 struct Entry { |
28 FilePath::StringType name; | 29 FilePath::StringType name; |
29 bool is_directory; | 30 bool is_directory; |
30 int64 size; | 31 int64 size; |
31 base::Time last_modified_time; | 32 base::Time last_modified_time; |
32 }; | 33 }; |
33 | 34 |
34 // This callback is used by methods that report only an error code. It is | 35 // 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, | 36 // valid to pass a null callback to any function that takes a StatusCallback, |
36 // in which case the operation will complete silently. | 37 // in which case the operation will complete silently. |
37 typedef Callback<void(PlatformFileError)> StatusCallback; | 38 typedef Callback<void(PlatformFileError)> StatusCallback; |
38 | 39 |
39 typedef Callback<void(PlatformFileError, | 40 typedef Callback<void(PlatformFileError, |
40 PassPlatformFile, | 41 PassPlatformFile, |
41 bool /* created */)> CreateOrOpenCallback; | 42 bool /* created */)> CreateOrOpenCallback; |
42 typedef Callback<void(PlatformFileError, | 43 typedef Callback<void(PlatformFileError, |
43 PassPlatformFile, | 44 PassPlatformFile, |
44 const FilePath&)> CreateTemporaryCallback; | 45 const FilePath&)> CreateTemporaryCallback; |
45 typedef Callback<void(PlatformFileError, | 46 typedef Callback<void(PlatformFileError, |
46 const PlatformFileInfo& | 47 const PlatformFileInfo&)> GetFileInfoCallback; |
47 )> GetFileInfoCallback; | |
48 typedef Callback<void(PlatformFileError, | 48 typedef Callback<void(PlatformFileError, |
49 const char* /* data */, | 49 const char* /* data */, |
50 int /* bytes read */)> ReadCallback; | 50 int /* bytes read */)> ReadCallback; |
51 typedef Callback<void(PlatformFileError, | 51 typedef Callback<void(PlatformFileError, |
52 int /* bytes written */)> WriteCallback; | 52 int /* bytes written */)> WriteCallback; |
53 | 53 |
54 typedef Callback<PlatformFileError(PlatformFile*, bool*)> CreateOrOpenTask; | 54 typedef Callback<PlatformFileError(PlatformFile*, bool*)> CreateOrOpenTask; |
55 typedef Callback<PlatformFileError(PlatformFile)> CloseTask; | 55 typedef Callback<PlatformFileError(PlatformFile)> CloseTask; |
56 typedef Callback<PlatformFileError(void)> FileTask; | 56 typedef Callback<PlatformFileError(void)> FileTask; |
57 | 57 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 PlatformFile, | 187 PlatformFile, |
188 const StatusCallback& callback); | 188 const StatusCallback& callback); |
189 | 189 |
190 private: | 190 private: |
191 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 191 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
192 }; | 192 }; |
193 | 193 |
194 } // namespace base | 194 } // namespace base |
195 | 195 |
196 #endif // BASE_FILE_UTIL_PROXY_H_ | 196 #endif // BASE_FILE_UTIL_PROXY_H_ |
OLD | NEW |