Chromium Code Reviews| 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)) { |
|
Mark Seaborn
2012/05/11 22:45:30
There are two problems with this in the nacl_helpe
bbudge
2012/05/15 15:44:01
Changed to use a bool sent from the browser.
|
| + // 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) |