Index: components/nacl/loader/nacl_listener.cc |
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
index 300b47f58c8a6fe5262cf60360f5c7557b08134f..619315e6cd10fd5f338e2baea020bfa021f96242 100644 |
--- a/components/nacl/loader/nacl_listener.cc |
+++ b/components/nacl/loader/nacl_listener.cc |
@@ -26,6 +26,7 @@ |
#include "build/build_config.h" |
#include "components/nacl/common/nacl_messages.h" |
#include "components/nacl/common/nacl_renderer_messages.h" |
+#include "components/nacl/common/nacl_service.h" |
#include "components/nacl/common/nacl_switches.h" |
#include "components/nacl/loader/nacl_ipc_adapter.h" |
#include "components/nacl/loader/nacl_validation_db.h" |
@@ -34,16 +35,10 @@ |
#include "ipc/ipc_channel_handle.h" |
#include "ipc/ipc_sync_channel.h" |
#include "ipc/ipc_sync_message_filter.h" |
-#include "mojo/edk/embedder/embedder.h" |
-#include "mojo/edk/embedder/scoped_ipc_support.h" |
#include "native_client/src/public/chrome_main.h" |
#include "native_client/src/public/nacl_app.h" |
#include "native_client/src/public/nacl_desc.h" |
- |
-#if defined(OS_POSIX) |
-#include "base/posix/global_descriptors.h" |
-#include "content/public/common/content_descriptors.h" |
-#endif |
+#include "services/service_manager/public/cpp/service_context.h" |
#if defined(OS_LINUX) |
#include "content/public/common/child_process_sandbox_support_linux.h" |
@@ -53,7 +48,6 @@ |
#include <io.h> |
#include "content/public/common/sandbox_init.h" |
-#include "mojo/edk/embedder/platform_channel_pair.h" |
#endif |
namespace { |
@@ -175,20 +169,6 @@ NaClListener::NaClListener() |
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
DCHECK(g_listener == NULL); |
g_listener = this; |
- |
- mojo_ipc_support_ = |
- base::MakeUnique<mojo::edk::ScopedIPCSupport>(io_thread_.task_runner()); |
-#if defined(OS_WIN) |
- mojo::edk::ScopedPlatformHandle platform_channel( |
- mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( |
- *base::CommandLine::ForCurrentProcess())); |
-#else |
- mojo::edk::ScopedPlatformHandle platform_channel( |
- mojo::edk::PlatformHandle( |
- base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))); |
-#endif |
- DCHECK(platform_channel.is_valid()); |
- mojo::edk::SetParentPipeHandle(std::move(platform_channel)); |
} |
NaClListener::~NaClListener() { |
@@ -237,17 +217,14 @@ class FileTokenMessageFilter : public IPC::MessageFilter { |
}; |
void NaClListener::Listen() { |
- mojo::ScopedMessagePipeHandle handle( |
- mojo::edk::CreateChildMessagePipe( |
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
- switches::kMojoChannelToken))); |
- DCHECK(handle.is_valid()); |
- |
channel_ = IPC::SyncChannel::Create(this, io_thread_.task_runner().get(), |
&shutdown_event_); |
filter_ = channel_->CreateSyncMessageFilter(); |
channel_->AddFilter(new FileTokenMessageFilter()); |
- channel_->Init(handle.release(), IPC::Channel::MODE_CLIENT, true); |
+ mojo::ScopedMessagePipeHandle channel_handle; |
+ std::unique_ptr<service_manager::ServiceContext> service_context = |
+ CreateNaClServiceContext(io_thread_.task_runner(), &channel_handle); |
+ channel_->Init(channel_handle.release(), IPC::Channel::MODE_CLIENT, true); |
main_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
base::RunLoop().Run(); |
} |