Index: base/platform_file_win.cc |
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc |
index b7861e621b0ed254650d59911271b226057be382..92f1c1f3f59333df2e8b6080dd28dc9e7b5c7fd4 100644 |
--- a/base/platform_file_win.cc |
+++ b/base/platform_file_win.cc |
@@ -115,6 +115,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) |
@@ -145,6 +160,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(); |
@@ -170,6 +190,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) |