Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: base/platform_file_win.cc

Issue 10701050: net: Implement canceling of all async operations in FileStream. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698