Index: chrome/nacl/nacl_listener.cc |
=================================================================== |
--- chrome/nacl/nacl_listener.cc (revision 136022) |
+++ chrome/nacl/nacl_listener.cc (working copy) |
@@ -11,12 +11,14 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
+#include "chrome/common/chrome_switches.h" |
#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 +144,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 +202,17 @@ |
return; |
} |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableNaClIPCProxy)) { |
+ // 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. |
dmichael (off chromium)
2012/05/10 19:38:58
heh... I think I'm going to need to draw a sequen
bbudge
2012/05/11 01:21:16
I couldn't get it to work creating the channels in
|
+ 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) |