OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> | 8 #include <vector> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 PassPlatformFile, | 43 PassPlatformFile, |
44 bool /* created */)> CreateOrOpenCallback; | 44 bool /* created */)> CreateOrOpenCallback; |
45 typedef base::Callback<void(PlatformFileError /* error code */, | 45 typedef base::Callback<void(PlatformFileError /* error code */, |
46 PassPlatformFile, | 46 PassPlatformFile, |
47 FilePath)> CreateTemporaryCallback; | 47 FilePath)> CreateTemporaryCallback; |
48 typedef base::Callback<void(PlatformFileError /* error code */, | 48 typedef base::Callback<void(PlatformFileError /* error code */, |
49 bool /* created */)> EnsureFileExistsCallback; | 49 bool /* created */)> EnsureFileExistsCallback; |
50 typedef base::Callback<void(PlatformFileError /* error code */, | 50 typedef base::Callback<void(PlatformFileError /* error code */, |
51 const PlatformFileInfo& /* file_info */)> | 51 const PlatformFileInfo& /* file_info */)> |
52 GetFileInfoCallback; | 52 GetFileInfoCallback; |
53 typedef Callback2<PlatformFileError /* error code */, | 53 typedef base::Callback<void(PlatformFileError /* error code */, |
54 const std::vector<Entry>&>::Type ReadDirectoryCallback; | 54 const std::vector<Entry>&)> ReadDirectoryCallback; |
55 typedef Callback3<PlatformFileError /* error code */, | 55 typedef Callback3<PlatformFileError /* error code */, |
56 const char* /* data */, | 56 const char* /* data */, |
57 int /* bytes read/written */>::Type ReadCallback; | 57 int /* bytes read/written */>::Type ReadCallback; |
58 typedef Callback2<PlatformFileError /* error code */, | 58 typedef Callback2<PlatformFileError /* error code */, |
59 int /* bytes written */>::Type WriteCallback; | 59 int /* bytes written */>::Type WriteCallback; |
60 | 60 |
61 // Creates or opens a file with the given flags. It is invalid to pass NULL | 61 // Creates or opens a file with the given flags. It is invalid to pass NULL |
62 // for the callback. | 62 // for the callback. |
63 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 63 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create |
64 // a new file at the given |file_path| and calls back with | 64 // a new file at the given |file_path| and calls back with |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const FilePath& file_path, | 108 const FilePath& file_path, |
109 const GetFileInfoCallback& callback); | 109 const GetFileInfoCallback& callback); |
110 | 110 |
111 static bool GetFileInfoFromPlatformFile( | 111 static bool GetFileInfoFromPlatformFile( |
112 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 112 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
113 PlatformFile file, | 113 PlatformFile file, |
114 const GetFileInfoCallback& callback); | 114 const GetFileInfoCallback& callback); |
115 | 115 |
116 static bool ReadDirectory(scoped_refptr<MessageLoopProxy> message_loop_proxy, | 116 static bool ReadDirectory(scoped_refptr<MessageLoopProxy> message_loop_proxy, |
117 const FilePath& file_path, | 117 const FilePath& file_path, |
118 ReadDirectoryCallback* callback); | 118 const ReadDirectoryCallback& callback); |
119 | 119 |
120 // Creates directory at given path. It's an error to create | 120 // Creates directory at given path. It's an error to create |
121 // if |exclusive| is true and dir already exists. | 121 // if |exclusive| is true and dir already exists. |
122 static bool CreateDirectory( | 122 static bool CreateDirectory( |
123 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 123 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
124 const FilePath& file_path, | 124 const FilePath& file_path, |
125 bool exclusive, | 125 bool exclusive, |
126 bool recursive, | 126 bool recursive, |
127 StatusCallback* callback); | 127 StatusCallback* callback); |
128 | 128 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 PlatformFile file, | 221 PlatformFile file, |
222 StatusCallback* callback); | 222 StatusCallback* callback); |
223 | 223 |
224 private: | 224 private: |
225 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 225 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
226 }; | 226 }; |
227 | 227 |
228 } // namespace base | 228 } // namespace base |
229 | 229 |
230 #endif // BASE_FILE_UTIL_PROXY_H_ | 230 #endif // BASE_FILE_UTIL_PROXY_H_ |
OLD | NEW |