Index: base/platform_file_win.cc |
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc |
index 272dfd1d31dc39a7be3efadd3ca48294d9121704..12dfaaa3ee5f31c9a0418970f4801ed5c520c537 100644 |
--- a/base/platform_file_win.cc |
+++ b/base/platform_file_win.cc |
@@ -113,6 +113,21 @@ bool ClosePlatformFile(PlatformFile file) { |
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 @@ int ReadPlatformFileNoBestEffort(PlatformFile file, int64 offset, char* data, |
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 @@ int WritePlatformFileAtCurrentPos(PlatformFile file, const char* data, |
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) |