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 d6a3b185b845cfeb6d928f2ee0f1617495a62ac8..81cb538e909921be2d847dc19c58749ac6436f77 100644 |
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc |
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc |
@@ -75,6 +75,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" |
@@ -949,12 +950,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); |
} |
@@ -1125,12 +1126,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)); |
} |