Index: webkit/glue/webfileutilities_impl.cc |
diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc |
index 56b5944456d19f2f50cb66982e8ed68f561fcd80..2f2481bf22d17e4cd3a87e1991e7ec059c3f05c0 100644 |
--- a/webkit/glue/webfileutilities_impl.cc |
+++ b/webkit/glue/webfileutilities_impl.cc |
@@ -116,16 +116,16 @@ long long WebFileUtilitiesImpl::seekFile(base::PlatformFile handle, |
int origin) { |
if (handle == base::kInvalidPlatformFileValue) |
return -1; |
- net::FileStream file_stream(handle, 0, NULL); |
- return file_stream.SeekSync(static_cast<net::Whence>(origin), offset); |
+ return base::SeekPlatformFile(handle, |
+ static_cast<base::PlatformFileWhence>(origin), |
+ offset); |
} |
bool WebFileUtilitiesImpl::truncateFile(base::PlatformFile handle, |
long long offset) { |
if (handle == base::kInvalidPlatformFileValue || offset < 0) |
return false; |
- net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE, NULL); |
- return file_stream.Truncate(offset) >= 0; |
+ return base::TruncatePlatformFile(handle, offset); |
} |
int WebFileUtilitiesImpl::readFromFile(base::PlatformFile handle, |
@@ -133,10 +133,7 @@ int WebFileUtilitiesImpl::readFromFile(base::PlatformFile handle, |
int length) { |
if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) |
return -1; |
- std::string buffer; |
- buffer.resize(length); |
- net::FileStream file_stream(handle, base::PLATFORM_FILE_READ, NULL); |
- return file_stream.ReadSync(data, length); |
+ return base::ReadPlatformFileCurPosNoBestEffort(handle, data, length); |
} |
int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, |
@@ -144,8 +141,7 @@ int WebFileUtilitiesImpl::writeToFile(base::PlatformFile handle, |
int length) { |
if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) |
return -1; |
- net::FileStream file_stream(handle, base::PLATFORM_FILE_WRITE, NULL); |
- return file_stream.WriteSync(data, length); |
+ return base::WritePlatformFileCurPosNoBestEffort(handle, data, length); |
} |
} // namespace webkit_glue |