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

Unified Diff: content/renderer/pepper/pepper_file_io_host.cc

Issue 19723010: Pepper Message Filters: Port to use explicit permission grants in ChildProcessSecurityPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0044-write-support-remove-child-process-security-policy-bitmask-usage
Patch Set: Created 7 years, 5 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 | « content/content_browser.gypi ('k') | content/renderer/pepper/pepper_helper_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_file_io_host.cc
diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc
index 4750f8f797e3c5541b42bb05f1b5193de14a2ef7..96b5f6b7cbe98ad2ec3d7f6a63538a3599f32ed6 100644
--- a/content/renderer/pepper/pepper_file_io_host.cc
+++ b/content/renderer/pepper/pepper_file_io_host.cc
@@ -194,10 +194,14 @@ int32_t PepperFileIOHost::OnHostMsgOpen(
if (rv != PP_OK)
return rv;
- int flags = 0;
+ // TODO(tommycli): Eventually just pass the Pepper flags straight to the
+ // FileSystemDispatcher so it can handle doing the security check.
+ int platform_file_flags = 0;
open_flags_ = open_flags;
- if (!::ppapi::PepperFileOpenFlagsToPlatformFileFlags(open_flags, &flags))
+ if (!::ppapi::PepperFileOpenFlagsToPlatformFileFlags(open_flags,
+ &platform_file_flags)) {
return PP_ERROR_BADARGUMENT;
+ }
EnterResourceNoLock<PPB_FileRef_API> enter(file_ref_resource, true);
if (enter.failed())
@@ -223,7 +227,7 @@ int32_t PepperFileIOHost::OnHostMsgOpen(
weak_factory_.GetWeakPtr(),
context->MakeReplyMessageContext());
file_system_dispatcher->OpenFile(
- file_system_url_, flags,
+ file_system_url_, platform_file_flags,
base::Bind(&DidOpenFileSystemURL, callback),
base::Bind(&DidFailOpenFileSystemURL, callback));
} else {
@@ -232,7 +236,7 @@ int32_t PepperFileIOHost::OnHostMsgOpen(
if (file_system_type_ != PP_FILESYSTEMTYPE_EXTERNAL || !helper)
return PP_ERROR_FAILED;
if (!helper->AsyncOpenFile(
- file_ref->GetSystemPath(), flags,
+ file_ref->GetSystemPath(), open_flags,
base::Bind(&PepperFileIOHost::ExecutePlatformOpenFileCallback,
weak_factory_.GetWeakPtr(),
context->MakeReplyMessageContext())))
« no previous file with comments | « content/content_browser.gypi ('k') | content/renderer/pepper/pepper_helper_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698