| Index: content/child/mojo/mojo_application.cc
|
| diff --git a/content/child/mojo/mojo_application.cc b/content/child/mojo/mojo_application.cc
|
| index cd369d3d541e95437d3f0a4fc197adde0138ece7..3405e573fe3b8cf5670a9b8aff0c86d470a731d6 100644
|
| --- a/content/child/mojo/mojo_application.cc
|
| +++ b/content/child/mojo/mojo_application.cc
|
| @@ -12,6 +12,7 @@
|
| #include "content/common/mojo/channel_init.h"
|
| #include "content/common/mojo/mojo_messages.h"
|
| #include "ipc/ipc_message.h"
|
| +#include "mojo/edk/embedder/embedder.h"
|
| #include "mojo/public/cpp/bindings/interface_ptr.h"
|
|
|
| namespace content {
|
| @@ -34,6 +35,27 @@ bool MojoApplication::OnMessageReceived(const IPC::Message& msg) {
|
| return handled;
|
| }
|
|
|
| +void MojoApplication::InitWithToken(std::string token) {
|
| + mojo::ScopedMessagePipeHandle handle =
|
| + mojo::edk::CreateChildMessagePipe(token);
|
| + InitWithPipe(std::move(handle));
|
| +}
|
| +
|
| +void MojoApplication::InitWithPipe(mojo::ScopedMessagePipeHandle handle) {
|
| + DCHECK(handle.is_valid());
|
| +
|
| + mojom::ApplicationSetupPtr application_setup;
|
| + application_setup.Bind(
|
| + mojo::InterfacePtrInfo<mojom::ApplicationSetup>(std::move(handle), 0u));
|
| +
|
| + mojo::shell::mojom::InterfaceProviderPtr services;
|
| + mojo::shell::mojom::InterfaceProviderPtr exposed_services;
|
| + service_registry_.Bind(GetProxy(&exposed_services));
|
| + application_setup->ExchangeInterfaceProviders(GetProxy(&services),
|
| + std::move(exposed_services));
|
| + service_registry_.BindRemoteServiceProvider(std::move(services));
|
| +}
|
| +
|
| void MojoApplication::OnActivate(
|
| const IPC::PlatformFileForTransit& file) {
|
| #if defined(OS_POSIX)
|
|
|