Index: base/platform_file_win.cc |
=================================================================== |
--- base/platform_file_win.cc (revision 64981) |
+++ base/platform_file_win.cc (working copy) |
@@ -6,6 +6,7 @@ |
#include "base/file_path.h" |
#include "base/logging.h" |
+#include "base/thread_restrictions.h" |
namespace base { |
@@ -13,6 +14,8 @@ |
int flags, |
bool* created, |
PlatformFileError* error_code) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
+ |
DWORD disposition = 0; |
if (flags & PLATFORM_FILE_OPEN) |
@@ -108,10 +111,12 @@ |
} |
bool ClosePlatformFile(PlatformFile file) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
return (CloseHandle(file) != 0); |
} |
int ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |
return -1; |
@@ -133,6 +138,7 @@ |
int WritePlatformFile(PlatformFile file, int64 offset, |
const char* data, int size) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |
return -1; |
@@ -151,6 +157,7 @@ |
} |
bool TruncatePlatformFile(PlatformFile file, int64 length) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |
return false; |
@@ -176,11 +183,13 @@ |
} |
bool FlushPlatformFile(PlatformFile file) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
return ((file != kInvalidPlatformFileValue) && ::FlushFileBuffers(file)); |
} |
bool TouchPlatformFile(PlatformFile file, const base::Time& last_access_time, |
const base::Time& last_modified_time) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
if (file == kInvalidPlatformFileValue) |
return false; |
@@ -191,6 +200,7 @@ |
} |
bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
if (!info) |
return false; |