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

Unified Diff: base/platform_file_win.cc

Issue 4222005: Turn on file access checks on Win. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Second try Created 10 years, 1 month 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
« no previous file with comments | « base/file_version_info_win.cc ('k') | base/win/registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « base/file_version_info_win.cc ('k') | base/win/registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698