Index: chrome/nacl/nacl_listener.cc |
=================================================================== |
--- chrome/nacl/nacl_listener.cc (revision 135227) |
+++ chrome/nacl/nacl_listener.cc (working copy) |
@@ -14,9 +14,10 @@ |
#include "chrome/common/nacl_messages.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) |
@@ -142,8 +143,10 @@ |
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)); |
+ nacl_ipc_manager_.Init(io_thread_.message_loop_proxy()); |
#if defined(OS_WIN) |
DCHECK(g_listener == NULL); |
g_listener = this; |
@@ -198,6 +201,14 @@ |
return; |
} |
+ // 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"); |
+ nacl_ppapi_channel_ = nacl_ipc_manager_.CreateChannel(channel_handle); |
+ |
+ Send(new NaClProcessHostMsg_PpapiChannelCreated(channel_handle)); |
+ |
std::vector<nacl::FileDescriptor> handles = params.handles; |
#if defined(OS_LINUX) || defined(OS_MACOSX) |