| Index: content/browser/mojo/mojo_application_host.cc
|
| diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc
|
| index 1f568efdb69eec5b4e6f7dccc3d79a1faf6ea61c..76bf521d207b6ac90eeb0d636f26e419dc6c6eec 100644
|
| --- a/content/browser/mojo/mojo_application_host.cc
|
| +++ b/content/browser/mojo/mojo_application_host.cc
|
| @@ -10,20 +10,11 @@
|
| #include "content/common/mojo/mojo_messages.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "ipc/ipc_sender.h"
|
| -#include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h"
|
| +#include "mojo/edk/embedder/platform_channel_pair.h"
|
|
|
| namespace content {
|
| namespace {
|
|
|
| -base::PlatformFile PlatformFileFromScopedPlatformHandle(
|
| - mojo::embedder::ScopedPlatformHandle handle) {
|
| -#if defined(OS_POSIX)
|
| - return handle.release().fd;
|
| -#elif defined(OS_WIN)
|
| - return handle.release().handle;
|
| -#endif
|
| -}
|
| -
|
| class ApplicationSetupImpl : public ApplicationSetup {
|
| public:
|
| ApplicationSetupImpl(ServiceRegistryImpl* service_registry,
|
| @@ -63,7 +54,7 @@ MojoApplicationHost::~MojoApplicationHost() {
|
| bool MojoApplicationHost::Init() {
|
| DCHECK(!client_handle_.is_valid()) << "Already initialized!";
|
|
|
| - mojo::embedder::PlatformChannelPair channel_pair;
|
| + mojo::edk::PlatformChannelPair channel_pair;
|
|
|
| scoped_refptr<base::TaskRunner> io_task_runner;
|
| if (io_task_runner_override_) {
|
| @@ -77,11 +68,10 @@ bool MojoApplicationHost::Init() {
|
| // Forward this to the client once we know its process handle.
|
| client_handle_ = channel_pair.PassClientHandle();
|
|
|
| - channel_init_.Init(
|
| - PlatformFileFromScopedPlatformHandle(channel_pair.PassServerHandle()),
|
| - io_task_runner,
|
| - base::Bind(&MojoApplicationHost::OnMessagePipeCreated,
|
| - weak_factory_.GetWeakPtr()));
|
| + channel_init_.Init(channel_pair.PassServerHandle().release().handle,
|
| + io_task_runner,
|
| + base::Bind(&MojoApplicationHost::OnMessagePipeCreated,
|
| + weak_factory_.GetWeakPtr()));
|
|
|
| return true;
|
| }
|
| @@ -91,16 +81,11 @@ void MojoApplicationHost::Activate(IPC::Sender* sender,
|
| DCHECK(!did_activate_);
|
| DCHECK(client_handle_.is_valid());
|
|
|
| - base::PlatformFile client_file =
|
| - PlatformFileFromScopedPlatformHandle(std::move(client_handle_));
|
| + base::PlatformFile client_file = client_handle_.release().handle;
|
| did_activate_ = sender->Send(new MojoMsg_Activate(
|
| IPC::GetFileHandleForProcess(client_file, process_handle, true)));
|
| }
|
|
|
| -void MojoApplicationHost::WillDestroySoon() {
|
| - channel_init_.WillDestroySoon();
|
| -}
|
| -
|
| void MojoApplicationHost::OverrideIOTaskRunnerForTest(
|
| scoped_refptr<base::TaskRunner> io_task_runner) {
|
| io_task_runner_override_ = io_task_runner;
|
|
|