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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.cc

Issue 340050: Add the plumbing and test code for plugins opening files from the sandbox. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 30698)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -390,6 +390,7 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCacheMode, OnSetCacheMode)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileSize, OnGetFileSize)
IPC_MESSAGE_HANDLER(ViewHostMsg_Keygen, OnKeygen)
+ IPC_MESSAGE_HANDLER(ViewMsg_OpenFileForPlugin, OnOpenFileForPlugin)
#if defined(USE_TCMALLOC)
IPC_MESSAGE_HANDLER(ViewHostMsg_RendererTcmalloc, OnRendererTcmalloc)
#endif
@@ -399,9 +400,8 @@
IPC_END_MESSAGE_MAP_EX()
}
- if (!msg_is_ok) {
+ if (!msg_is_ok)
BrowserRenderProcessHost::BadMessageTerminateProcess(msg.type(), handle());
- }
return handled;
}
@@ -1163,6 +1163,24 @@
*signed_public_key = keygen_handler->GenKeyAndSignChallenge();
}
+void ResourceMessageFilter::OnOpenFileForPlugin(
+ const FilePath& file_name,
+ ViewMsg_OpenFileForPluginResponse_Params* result) {
+ // TODO(brettw) finish up this API. This will allow sandboxed plugins to open
+ // certain restricted files by opening the file from the browser and
+ // duplicating the file into the renderer.
+ //
+ // This needs to be done with care because of the security implications. Don't
+ // implement this without getting a thorough security review.
+#if defined(OS_WIN)
+ result->file_handle = NULL;
+#elif defined(OS_POSIX)
+ // TODO(brettw) this currently violates the API provided since it specifies
+ // NULL means error, and this will give -1. We need to be consistent.
+ result->file_handle = base::FileDescriptor();
+#endif
+}
+
#if defined(USE_TCMALLOC)
void ResourceMessageFilter::OnRendererTcmalloc(base::ProcessId pid,
const std::string& output) {
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698