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

Unified Diff: ppapi/shared_impl/file_type_conversion.cc

Issue 16765005: Pepper: Add append support to FileIO. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment: M29 -> Chrome 29. 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 | « ppapi/c/ppb_file_io.h ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/file_type_conversion.cc
diff --git a/ppapi/shared_impl/file_type_conversion.cc b/ppapi/shared_impl/file_type_conversion.cc
index 87edeb0cd51b64eadd5ed055492f29b3f04da193..f9d65704ab9265056792fdc7c2632d0c8621130a 100644
--- a/ppapi/shared_impl/file_type_conversion.cc
+++ b/ppapi/shared_impl/file_type_conversion.cc
@@ -45,6 +45,7 @@ bool PepperFileOpenFlagsToPlatformFileFlags(int32_t pp_open_flags,
bool pp_create = !!(pp_open_flags & PP_FILEOPENFLAG_CREATE);
bool pp_truncate = !!(pp_open_flags & PP_FILEOPENFLAG_TRUNCATE);
bool pp_exclusive = !!(pp_open_flags & PP_FILEOPENFLAG_EXCLUSIVE);
+ bool pp_append = !!(pp_open_flags & PP_FILEOPENFLAG_APPEND);
int flags = 0;
if (pp_read)
@@ -53,6 +54,11 @@ bool PepperFileOpenFlagsToPlatformFileFlags(int32_t pp_open_flags,
flags |= base::PLATFORM_FILE_WRITE;
flags |= base::PLATFORM_FILE_WRITE_ATTRIBUTES;
}
+ if (pp_append) {
+ if (pp_write)
+ return false;
+ flags |= base::PLATFORM_FILE_APPEND;
+ }
if (pp_truncate && !pp_write)
return false;
« no previous file with comments | « ppapi/c/ppb_file_io.h ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698