Chromium Code Reviews| Index: chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc |
| diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc |
| index 621e6b1d5bbfacc4211e1127d8ca1869302c0077..d9ba84a21faabab3168f133a39ea299e30258f91 100644 |
| --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc |
| +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc |
| @@ -22,6 +22,7 @@ |
| #include "ppapi/host/host_message_context.h" |
| #include "ppapi/host/ppapi_host.h" |
| #include "ppapi/proxy/ppapi_messages.h" |
| +#include "ppapi/shared_impl/file_system_util.h" |
| #include "webkit/browser/fileapi/isolated_context.h" |
| namespace chrome { |
| @@ -125,7 +126,8 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem( |
| break; |
| case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX: |
| return OpenCrxFileSystem(context); |
| - // TODO(nhiroki): Other filesystem will be implemented. (crbug.com/286242) |
| + case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE: |
| + return OpenPluginPrivateFileSystem(context); |
| } |
| NOTREACHED(); |
| context->reply_msg = |
| @@ -168,4 +170,21 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem( |
| return PP_OK; |
| } |
| +int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem( |
| + ppapi::host::HostMessageContext* context) { |
|
dmichael (off chromium)
2013/11/14 18:09:31
I don't see where you check permissions. This shou
nhiroki
2013/11/15 12:24:01
Thanks for pointing out! Added permission check he
|
| + const std::string root_name = ppapi::IsolatedFileSystemTypeToRootName( |
| + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE); |
| + const std::string fsid = |
|
dmichael (off chromium)
2013/11/14 18:09:31
nit/suggestion: these could be const& to possibly
nhiroki
2013/11/15 12:24:01
Done.
|
| + fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath( |
| + fileapi::kFileSystemTypePluginPrivate, root_name, base::FilePath()); |
| + |
| + // Grant full access of isolated filesystem to renderer process. |
| + content::ChildProcessSecurityPolicy* policy = |
| + content::ChildProcessSecurityPolicy::GetInstance(); |
| + policy->GrantCreateReadWriteFileSystem(render_process_id_, fsid); |
| + |
| + context->reply_msg = PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply(fsid); |
| + return PP_OK; |
| +} |
| + |
| } // namespace chrome |