Index: components/nacl/loader/nonsfi/nonsfi_listener.cc |
diff --git a/components/nacl/loader/nonsfi/nonsfi_listener.cc b/components/nacl/loader/nonsfi/nonsfi_listener.cc |
index baef08c9878f3296af82a4ae1fbd662adf078036..b7fe6daeca584f08cc4c31aeefcc1882eec73ac3 100644 |
--- a/components/nacl/loader/nonsfi/nonsfi_listener.cc |
+++ b/components/nacl/loader/nonsfi/nonsfi_listener.cc |
@@ -10,11 +10,11 @@ |
#include "base/file_descriptor_posix.h" |
#include "base/logging.h" |
#include "base/memory/ptr_util.h" |
-#include "base/posix/global_descriptors.h" |
#include "base/rand_util.h" |
#include "base/run_loop.h" |
#include "build/build_config.h" |
#include "components/nacl/common/nacl_messages.h" |
+#include "components/nacl/common/nacl_service.h" |
#include "components/nacl/common/nacl_types.h" |
#include "components/nacl/loader/nacl_trusted_listener.h" |
#include "components/nacl/loader/nonsfi/nonsfi_main.h" |
@@ -23,11 +23,10 @@ |
#include "ipc/ipc_channel.h" |
#include "ipc/ipc_channel_handle.h" |
#include "ipc/ipc_sync_channel.h" |
-#include "mojo/edk/embedder/embedder.h" |
-#include "mojo/edk/embedder/scoped_ipc_support.h" |
#include "native_client/src/public/nonsfi/irt_random.h" |
#include "ppapi/nacl_irt/irt_manifest.h" |
#include "ppapi/nacl_irt/plugin_startup.h" |
+#include "services/service_manager/public/cpp/service_context.h" |
#if !defined(OS_NACL_NONSFI) |
#error "This file must be built for nacl_helper_nonsfi." |
@@ -43,34 +42,21 @@ NonSfiListener::NonSfiListener() |
key_fd_map_(new std::map<std::string, int>) { |
io_thread_.StartWithOptions( |
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
- |
- mojo_ipc_support_ = |
- base::MakeUnique<mojo::edk::ScopedIPCSupport>(io_thread_.task_runner()); |
- mojo::edk::ScopedPlatformHandle platform_channel( |
- mojo::edk::PlatformHandle( |
- base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))); |
- DCHECK(platform_channel.is_valid()); |
- mojo::edk::SetParentPipeHandle(std::move(platform_channel)); |
} |
NonSfiListener::~NonSfiListener() { |
} |
void NonSfiListener::Listen() { |
- mojo::ScopedMessagePipeHandle handle( |
- mojo::edk::CreateChildMessagePipe( |
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
- switches::kMojoChannelToken))); |
- DCHECK(handle.is_valid()); |
- IPC::ChannelHandle channel_handle = IPC::ChannelHandle(handle.release()); |
- |
- channel_ = IPC::SyncChannel::Create( |
- channel_handle, |
- IPC::Channel::MODE_CLIENT, |
- this, // As a Listener. |
- io_thread_.task_runner().get(), |
- true, // Create pipe now. |
- &shutdown_event_); |
+ mojo::ScopedMessagePipeHandle channel_handle; |
+ std::unique_ptr<service_manager::ServiceContext> service_context = |
+ CreateNaClServiceContext(io_thread_.task_runner(), &channel_handle); |
+ channel_ = IPC::SyncChannel::Create(channel_handle.release(), |
+ IPC::Channel::MODE_CLIENT, |
+ this, // As a Listener. |
+ io_thread_.task_runner(), |
+ true, // Create pipe now. |
+ &shutdown_event_); |
base::RunLoop().Run(); |
} |