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

Unified Diff: base/platform_file_win.cc

Issue 15861011: Add an "append flag" to base::PlatformFile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignore write offset when PLATFORM_FILE_APPEND. Created 7 years, 6 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
« no previous file with comments | « base/platform_file_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_win.cc
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index cdc06bd1ca2bd192f150d89316d24f5348c5eb05..977a819fcfa70eef7cde008a4909324071700a26 100644
--- a/base/platform_file_win.cc
+++ b/base/platform_file_win.cc
@@ -51,9 +51,15 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
return NULL;
}
- DWORD access = (flags & PLATFORM_FILE_READ) ? GENERIC_READ : 0;
+ DWORD access = 0;
if (flags & PLATFORM_FILE_WRITE)
- access |= GENERIC_WRITE;
+ access = GENERIC_WRITE;
+ if (flags & PLATFORM_FILE_APPEND) {
+ DCHECK(!access);
+ access = FILE_APPEND_DATA;
+ }
+ if (flags & PLATFORM_FILE_READ)
+ access |= GENERIC_READ;
if (flags & PLATFORM_FILE_WRITE_ATTRIBUTES)
access |= FILE_WRITE_ATTRIBUTES;
if (flags & PLATFORM_FILE_EXECUTE)
« no previous file with comments | « base/platform_file_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698