summaryrefslogtreecommitdiffstats
path: root/base/file_util_proxy.h
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 01:24:51 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 01:24:51 +0000
commit43fad839433bfa7561f86e0f4629f5a9b2b31b3e (patch)
tree4596d8a7f4bb5e39c927d1cb8fde338779c3401f /base/file_util_proxy.h
parent23e2619fc7d0a817dd2f44a704b23cbac97c79da (diff)
downloadchromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.zip
chromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.tar.gz
chromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.tar.bz2
Add truncate and cancel for FileWriter; write and more tests will come in later CLs.
This CL also contains a fair amount of plumbing for the write call itself. BUG=none TEST=none Review URL: http://codereview.chromium.org/3599011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.h')
-rw-r--r--base/file_util_proxy.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/base/file_util_proxy.h b/base/file_util_proxy.h
index 081c11b..32b78630 100644
--- a/base/file_util_proxy.h
+++ b/base/file_util_proxy.h
@@ -138,7 +138,7 @@ class FileUtilProxy {
// Writes to a file. If |offset| is greater than the length of the file,
// |false| is returned. On success, the file pointer is moved to position
- // |offset + bytes_to_write| in the file. If The callback can be NULL.
+ // |offset + bytes_to_write| in the file. The callback can be NULL.
static bool Write(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
base::PlatformFile file,
@@ -169,7 +169,16 @@ class FileUtilProxy {
static bool Truncate(
scoped_refptr<MessageLoopProxy> message_loop_proxy,
base::PlatformFile file,
- long long length,
+ int64 length,
+ StatusCallback* callback);
+
+ // Truncates a file to the given length. If |length| is greater than the
+ // current length of the file, the file will be extended with zeroes.
+ // The callback can be NULL.
+ static bool Truncate(
+ scoped_refptr<MessageLoopProxy> message_loop_proxy,
+ const FilePath& path,
+ int64 length,
StatusCallback* callback);
// Flushes a file. The callback can be NULL.