diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 06:07:32 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 06:07:32 +0000 |
commit | 6851e940187c108e558296e44879c3021d5da516 (patch) | |
tree | 7074cf2bd77492339f02dd53038565254d15cf88 /content | |
parent | d65be0be718541a76b0210e2b142191c1bbdbd2b (diff) | |
download | chromium_src-6851e940187c108e558296e44879c3021d5da516.zip chromium_src-6851e940187c108e558296e44879c3021d5da516.tar.gz chromium_src-6851e940187c108e558296e44879c3021d5da516.tar.bz2 |
PPAPI: Add FileIO::OpenDev for Map() and plugin-side writes
BUG=253999,194304
Review URL: https://chromiumcodereview.appspot.com/23686013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/renderer/pepper/pepper_file_io_host.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc index 6b9cfc5..d472da2 100644 --- a/content/renderer/pepper/pepper_file_io_host.cc +++ b/content/renderer/pepper/pepper_file_io_host.cc @@ -530,12 +530,15 @@ void PepperFileIOHost::ExecutePlatformOpenFileCallback( if (!(file_for_transit == IPC::InvalidPlatformFileForTransit())) { // Send the file descriptor to the plugin process. This is used in the // plugin for any file operations that can be done there. - // IMPORTANT: Clear PP_FILEOPENFLAG_WRITE and PP_FILEOPENFLAG_APPEND so - // the plugin can't write and so bypass our quota checks. - int32_t no_write_flags = - open_flags_ & ~(PP_FILEOPENFLAG_WRITE | PP_FILEOPENFLAG_APPEND); + int32_t flags_to_send = open_flags_; + if (!host()->permissions().HasPermission(ppapi::PERMISSION_DEV)) { + // IMPORTANT: Clear PP_FILEOPENFLAG_WRITE and PP_FILEOPENFLAG_APPEND so + // the plugin can't write and so bypass our quota checks. + flags_to_send = + open_flags_ & ~(PP_FILEOPENFLAG_WRITE | PP_FILEOPENFLAG_APPEND); + } ppapi::proxy::SerializedHandle file_handle; - file_handle.set_file_handle(file_for_transit, no_write_flags); + file_handle.set_file_handle(file_for_transit, flags_to_send); reply_context.params.AppendHandle(file_handle); } } |