Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Side by Side Diff: base/file_util_proxy.h

Issue 3599011: Add truncate and cancel for FileWriter; write and tests will come in later CL... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_util_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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. If The callback can be NULL. 141 // |offset + bytes_to_write| in the file. 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
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 long long length, 172 int64 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,
173 StatusCallback* callback); 182 StatusCallback* callback);
174 183
175 // Flushes a file. The callback can be NULL. 184 // Flushes a file. The callback can be NULL.
176 static bool Flush( 185 static bool Flush(
177 scoped_refptr<MessageLoopProxy> message_loop_proxy, 186 scoped_refptr<MessageLoopProxy> message_loop_proxy,
178 base::PlatformFile file, 187 base::PlatformFile file,
179 StatusCallback* callback); 188 StatusCallback* callback);
180 189
181 private: 190 private:
182 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); 191 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy);
183 }; 192 };
184 193
185 } // namespace base 194 } // namespace base
186 195
187 #endif // BASE_FILE_UTIL_PROXY_H_ 196 #endif // BASE_FILE_UTIL_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | base/file_util_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698