Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: components/nacl/loader/nacl_listener.cc

Issue 2501913002: Change the NaCl loader and broker processes to use the ServiceManager. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/loader/nacl_listener.h ('k') | components/nacl/loader/nacl_loader_manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_listener.cc
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
index 8cf5a31379d9405836c6b905a9945c28f13db8ed..ecefbb83a016d93803993507a6d4ef8d7e51e1c5 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.mojom.h"
#include "components/nacl/common/nacl_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 {
@@ -174,20 +168,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() {
@@ -236,17 +216,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();
}
« no previous file with comments | « components/nacl/loader/nacl_listener.h ('k') | components/nacl/loader/nacl_loader_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698