| Index: webkit/glue/webfileutilities_impl.cc
|
| ===================================================================
|
| --- webkit/glue/webfileutilities_impl.cc (revision 151422)
|
| +++ webkit/glue/webfileutilities_impl.cc (working copy)
|
| @@ -116,16 +116,16 @@
|
| 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 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 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
|
|
|