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

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

Issue 26803004: PPAPI: Add PluginPrivateFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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_file_system_host.cc
diff --git a/content/renderer/pepper/pepper_file_system_host.cc b/content/renderer/pepper/pepper_file_system_host.cc
index 1944ee3662c747f28e3ce70a306ae10b5e2b1a5c..d140a82c2e2407f0f2de9797ea1c7b48ac7d1a17 100644
--- a/content/renderer/pepper/pepper_file_system_host.cc
+++ b/content/renderer/pepper/pepper_file_system_host.cc
@@ -81,6 +81,9 @@ int32_t PepperFileSystemHost::OnResourceMessageReceived(
PPAPI_DISPATCH_HOST_RESOURCE_CALL(
PpapiHostMsg_FileSystem_InitIsolatedFileSystem,
OnHostMsgInitIsolatedFileSystem)
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL(
+ PpapiHostMsg_FileSystem_InitPluginPrivateFileSystem,
+ OnHostMsgInitPluginPrivateFileSystem)
IPC_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}
@@ -171,4 +174,27 @@ int32_t PepperFileSystemHost::OnHostMsgInitIsolatedFileSystem(
return PP_OK;
}
+int32_t PepperFileSystemHost::OnHostMsgInitPluginPrivateFileSystem(
+ ppapi::host::HostMessageContext* context,
+ const std::string& fsid) {
+ // Do not allow multiple opens.
+ if (called_open_)
+ return PP_ERROR_INPROGRESS;
+ called_open_ = true;
+
+ // Do a sanity check.
+ if (!LooksLikeAGuid(fsid))
+ return PP_ERROR_BADARGUMENT;
+
+ RenderView* view =
+ renderer_ppapi_host_->GetRenderViewForInstance(pp_instance());
+ if (!view)
+ return PP_ERROR_FAILED;
+ const GURL& url = view->GetWebView()->mainFrame()->document().url();
+ root_url_ = GURL(fileapi::GetIsolatedFileSystemRootURIString(
teravest 2013/10/29 17:14:11 There's a lot of duplication here with OnHostMsgIn
nhiroki 2013/11/12 13:36:15 Done.
+ url.GetOrigin(), fsid, "PluginPrivate"));
+ opened_ = true;
+ return PP_OK;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698