| 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) {
|
|
|