OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 10 #include "base/callback.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 static bool Read( | 131 static bool Read( |
132 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 132 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
133 base::PlatformFile file, | 133 base::PlatformFile file, |
134 int64 offset, | 134 int64 offset, |
135 char* buffer, | 135 char* buffer, |
136 int bytes_to_read, | 136 int bytes_to_read, |
137 ReadWriteCallback* callback); | 137 ReadWriteCallback* callback); |
138 | 138 |
139 // Writes to a file. If |offset| is greater than the length of the file, | 139 // Writes to a file. If |offset| is greater than the length of the file, |
140 // |false| is returned. On success, the file pointer is moved to position | 140 // |false| is returned. On success, the file pointer is moved to position |
141 // |offset + bytes_to_write| in the file. The callback can be NULL. | 141 // |offset + bytes_to_write| in the file. If The callback can be NULL. |
142 static bool Write( | 142 static bool Write( |
143 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 143 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
144 base::PlatformFile file, | 144 base::PlatformFile file, |
145 int64 offset, | 145 int64 offset, |
146 const char* buffer, | 146 const char* buffer, |
147 int bytes_to_write, | 147 int bytes_to_write, |
148 ReadWriteCallback* callback); | 148 ReadWriteCallback* callback); |
149 | 149 |
150 // Touches a file. The callback can be NULL. | 150 // Touches a file. The callback can be NULL. |
151 static bool Touch( | 151 static bool Touch( |
(...skipping 10 matching lines...) Expand all Loading... |
162 const base::Time& last_access_time, | 162 const base::Time& last_access_time, |
163 const base::Time& last_modified_time, | 163 const base::Time& last_modified_time, |
164 StatusCallback* callback); | 164 StatusCallback* callback); |
165 | 165 |
166 // Truncates a file to the given length. If |length| is greater than the | 166 // Truncates a file to the given length. If |length| is greater than the |
167 // current length of the file, the file will be extended with zeroes. | 167 // current length of the file, the file will be extended with zeroes. |
168 // The callback can be NULL. | 168 // The callback can be NULL. |
169 static bool Truncate( | 169 static bool Truncate( |
170 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 170 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
171 base::PlatformFile file, | 171 base::PlatformFile file, |
172 int64 length, | 172 long long length, |
173 StatusCallback* callback); | |
174 | |
175 // Truncates a file to the given length. If |length| is greater than the | |
176 // current length of the file, the file will be extended with zeroes. | |
177 // The callback can be NULL. | |
178 static bool Truncate( | |
179 scoped_refptr<MessageLoopProxy> message_loop_proxy, | |
180 const FilePath& path, | |
181 int64 length, | |
182 StatusCallback* callback); | 173 StatusCallback* callback); |
183 | 174 |
184 // Flushes a file. The callback can be NULL. | 175 // Flushes a file. The callback can be NULL. |
185 static bool Flush( | 176 static bool Flush( |
186 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 177 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
187 base::PlatformFile file, | 178 base::PlatformFile file, |
188 StatusCallback* callback); | 179 StatusCallback* callback); |
189 | 180 |
190 private: | 181 private: |
191 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 182 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
192 }; | 183 }; |
193 | 184 |
194 } // namespace base | 185 } // namespace base |
195 | 186 |
196 #endif // BASE_FILE_UTIL_PROXY_H_ | 187 #endif // BASE_FILE_UTIL_PROXY_H_ |
OLD | NEW |