diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 17:41:00 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 17:41:00 +0000 |
commit | 45446a5e18df7910f64a690a5d6389b70e30f985 (patch) | |
tree | 5318a1c6e14aa8600a2d958929da77019d1ef4a8 /base/platform_file_win.cc | |
parent | 42d5be693f7cc623caa3df6bfb2bcc4f6861cb36 (diff) | |
download | chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.zip chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.tar.gz chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.tar.bz2 |
Turn on file access checks on Win.
BUG=60211
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=64960
Review URL: http://codereview.chromium.org/4222005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/platform_file_win.cc')
-rw-r--r-- | base/platform_file_win.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc index 3aa02e8..34d8e45 100644 --- a/base/platform_file_win.cc +++ b/base/platform_file_win.cc @@ -6,6 +6,7 @@ #include "base/file_path.h" #include "base/logging.h" +#include "base/thread_restrictions.h" namespace base { @@ -13,6 +14,8 @@ PlatformFile CreatePlatformFile(const FilePath& name, int flags, bool* created, PlatformFileError* error_code) { + base::ThreadRestrictions::AssertIOAllowed(); + DWORD disposition = 0; if (flags & PLATFORM_FILE_OPEN) @@ -108,10 +111,12 @@ PlatformFile CreatePlatformFile(const std::wstring& name, int flags, } 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 ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) { int WritePlatformFile(PlatformFile file, int64 offset, const char* data, int size) { + base::ThreadRestrictions::AssertIOAllowed(); if (file == kInvalidPlatformFileValue) return -1; @@ -151,6 +157,7 @@ int WritePlatformFile(PlatformFile file, int64 offset, } bool TruncatePlatformFile(PlatformFile file, int64 length) { + base::ThreadRestrictions::AssertIOAllowed(); if (file == kInvalidPlatformFileValue) return false; @@ -176,11 +183,13 @@ bool TruncatePlatformFile(PlatformFile file, int64 length) { } 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 TouchPlatformFile(PlatformFile file, const base::Time& last_access_time, } bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) { + base::ThreadRestrictions::AssertIOAllowed(); if (!info) return false; |