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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index d489f498bd6408240afe5b746ae82f498bf86551..678d442a0271d88d768cde72200b0f9136908699 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -76,6 +76,7 @@
#include "ppapi/proxy/url_loader_resource.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/file_path.h"
+#include "ppapi/shared_impl/file_type_conversion.h"
#include "ppapi/shared_impl/platform_file.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
@@ -950,12 +951,12 @@ void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult(
bool PepperPluginDelegateImpl::AsyncOpenFile(
const base::FilePath& path,
- int flags,
+ int pp_open_flags,
const AsyncOpenFileCallback& callback) {
int message_id = pending_async_open_files_.Add(
new AsyncOpenFileCallback(callback));
- IPC::Message* msg = new ViewHostMsg_AsyncOpenFile(
- render_view_->routing_id(), path, flags, message_id);
+ IPC::Message* msg = new ViewHostMsg_AsyncOpenPepperFile(
+ render_view_->routing_id(), path, pp_open_flags, message_id);
return render_view_->Send(msg);
}
@@ -1126,12 +1127,21 @@ void PepperPluginDelegateImpl::DidUpdateFile(const GURL& path, int64_t delta) {
void PepperPluginDelegateImpl::AsyncOpenFileSystemURL(
const GURL& path,
- int flags,
+ int pp_open_flags,
const AsyncOpenFileSystemURLCallback& callback) {
+ // 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;
+ if (!ppapi::PepperFileOpenFlagsToPlatformFileFlags(
+ pp_open_flags, &platform_file_flags)) {
+ DidFailOpenFileSystemURL(callback, base::PLATFORM_FILE_ERROR_FAILED);
+ return;
+ }
+
FileSystemDispatcher* file_system_dispatcher =
ChildThread::current()->file_system_dispatcher();
file_system_dispatcher->OpenFile(
- path, flags,
+ path, platform_file_flags,
base::Bind(&DidOpenFileSystemURL, callback),
base::Bind(&DidFailOpenFileSystemURL, callback));
}

Powered by Google App Engine
This is Rietveld 408576698