Index: base/platform_file_win.cc |
=================================================================== |
--- base/platform_file_win.cc (revision 147715) |
+++ base/platform_file_win.cc (working copy) |
@@ -113,6 +113,21 @@ |
return (CloseHandle(file) != 0); |
} |
+int64 SeekPlatformFile(PlatformFile file, |
+ PlatformFileWhence whence, |
+ int64 offset) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
+ if (file < 0 || offset < 0) |
+ return -1; |
+ |
+ LARGE_INTEGER distance, res; |
+ distance.QuadPart = offset; |
+ DWORD move_method = static_cast<DWORD>(whence); |
+ if (!SetFilePointerEx(file_, distance, &res, move_method)) |
+ return -1; |
+ return res.QuadPart; |
+} |
+ |
int ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) { |
base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |
@@ -143,6 +158,11 @@ |
return ReadPlatformFile(file, offset, data, size); |
} |
+int ReadPlatformFileCurPosNoBestEffort(PlatformFile file, |
+ char* data, int size) { |
+ return ReadPlatformFile(file, 0, data, size); |
+} |
+ |
int WritePlatformFile(PlatformFile file, int64 offset, |
const char* data, int size) { |
base::ThreadRestrictions::AssertIOAllowed(); |
@@ -168,6 +188,11 @@ |
return WritePlatformFile(file, 0, data, size); |
} |
+int WritePlatformFileCurPosNoBestEffort(PlatformFile file, |
+ const char* data, int size) { |
+ return WritePlatformFile(file, 0, data, size); |
+} |
+ |
bool TruncatePlatformFile(PlatformFile file, int64 length) { |
base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |