Chromium Code Reviews| Index: chrome/nacl/nacl_listener.cc |
| =================================================================== |
| --- chrome/nacl/nacl_listener.cc (revision 143037) |
| +++ chrome/nacl/nacl_listener.cc (working copy) |
| @@ -13,13 +13,19 @@ |
| #include "base/message_loop.h" |
| #include "base/rand_util.h" |
| #include "chrome/common/nacl_messages.h" |
| +#include "chrome/nacl/nacl_ipc_adapter.h" |
| #include "chrome/nacl/nacl_validation_db.h" |
| #include "chrome/nacl/nacl_validation_query.h" |
| +#include "ipc/ipc_channel_handle.h" |
| +#include "ipc/ipc_switches.h" |
| #include "ipc/ipc_sync_channel.h" |
| #include "ipc/ipc_sync_message_filter.h" |
| -#include "ipc/ipc_switches.h" |
| #include "native_client/src/trusted/service_runtime/sel_main_chrome.h" |
| +#if defined(OS_POSIX) |
| +#include "base/file_descriptor_posix.h" |
| +#endif |
| + |
| #if defined(OS_LINUX) |
| #include "content/public/common/child_process_sandbox_support_linux.h" |
| #endif |
| @@ -188,6 +194,24 @@ |
| return; |
| } |
| + if (params.enable_ipc_proxy) { |
| + // Create the server side of the channel and notify the process host so it |
| + // can reply to the renderer, which will connect as client. |
| + IPC::ChannelHandle channel_handle = |
| + IPC::Channel::GenerateVerifiedChannelID("nacl"); |
| + |
| + scoped_refptr<NaClIPCAdapter> ipc_adapter(new NaClIPCAdapter( |
| + channel_handle, io_thread_.message_loop_proxy())); |
| + args->initial_ipc_desc = ipc_adapter.get()->MakeNaClDesc(); |
| + |
| +#if defined (OS_POSIX) |
|
Mark Seaborn
2012/06/20 19:24:40
There should be no space after 'defined'
bbudge
2012/06/21 00:00:46
Done.
|
| + channel_handle.socket = base::FileDescriptor( |
| + ipc_adapter.get()->TakeClientFileDescriptor(), true); |
| +#endif |
| + |
| + Send(new NaClProcessHostMsg_PpapiChannelCreated(channel_handle)); |
| + } |
| + |
| std::vector<nacl::FileDescriptor> handles = params.handles; |
| #if defined(OS_LINUX) || defined(OS_MACOSX) |