| Index: chrome/nacl/nacl_listener.cc
|
| ===================================================================
|
| --- chrome/nacl/nacl_listener.cc (revision 137169)
|
| +++ chrome/nacl/nacl_listener.cc (working copy)
|
| @@ -12,17 +12,23 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop.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_LINUX)
|
| #include "content/public/common/child_process_sandbox_support_linux.h"
|
| #endif
|
|
|
| +#if defined(OS_POSIX)
|
| +#include "base/file_descriptor_posix.h"
|
| +#endif
|
| +
|
| #if defined(OS_WIN)
|
| #include <fcntl.h>
|
| #include <io.h>
|
| @@ -142,6 +148,7 @@
|
| NaClListener::NaClListener() : shutdown_event_(true, false),
|
| io_thread_("NaCl_IOThread"),
|
| main_loop_(NULL),
|
| + nacl_ppapi_channel_(NULL),
|
| debug_enabled_(false) {
|
| io_thread_.StartWithOptions(base::Thread::Options(MessageLoop::TYPE_IO, 0));
|
| #if defined(OS_WIN)
|
| @@ -198,6 +205,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 then try to 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()));
|
| + nacl_ppapi_channel_ = ipc_adapter.get()->MakeNaClDesc();
|
| +
|
| +#if defined (OS_POSIX)
|
| + 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)
|
|
|