| Index: content/browser/mojo/mojo_shell_client_host.cc
|
| diff --git a/content/browser/mojo/mojo_shell_client_host.cc b/content/browser/mojo/mojo_shell_client_host.cc
|
| index e9b6896cbc1f34d9ae2f256499a8549d51e6197e..56143e287f6d0cedfe37cc9cf608c4febda24e54 100644
|
| --- a/content/browser/mojo/mojo_shell_client_host.cc
|
| +++ b/content/browser/mojo/mojo_shell_client_host.cc
|
| @@ -18,11 +18,12 @@
|
| #include "content/public/common/mojo_shell_connection.h"
|
| #include "ipc/ipc_sender.h"
|
| #include "mojo/converters/network/network_type_converters.h"
|
| +#include "mojo/edk/embedder/embedder.h"
|
| +#include "mojo/edk/embedder/platform_channel_pair.h"
|
| +#include "mojo/edk/embedder/scoped_platform_handle.h"
|
| +#include "mojo/public/cpp/system/message_pipe.h"
|
| #include "mojo/shell/public/cpp/application_impl.h"
|
| #include "mojo/shell/public/interfaces/application_manager.mojom.h"
|
| -#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
|
| -#include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h"
|
| -#include "third_party/mojo/src/mojo/edk/embedder/scoped_platform_handle.h"
|
|
|
| namespace content {
|
| namespace {
|
| @@ -30,17 +31,6 @@ namespace {
|
| const char kMojoShellInstanceURL[] = "mojo_shell_instance_url";
|
| const char kMojoPlatformFile[] = "mojo_platform_file";
|
|
|
| -void DidCreateChannel(mojo::embedder::ChannelInfo* info) {}
|
| -
|
| -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 InstanceURL : public base::SupportsUserData::Data {
|
| public:
|
| InstanceURL(const std::string& instance_url) : instance_url_(instance_url) {}
|
| @@ -127,15 +117,14 @@ void RegisterChildWithExternalShell(int child_process_id,
|
| return;
|
|
|
| // Create the channel to be shared with the target process.
|
| - mojo::embedder::HandlePassingInformation handle_passing_info;
|
| - mojo::embedder::PlatformChannelPair platform_channel_pair;
|
| + mojo::edk::HandlePassingInformation handle_passing_info;
|
| + mojo::edk::PlatformChannelPair platform_channel_pair;
|
|
|
| // Give one end to the shell so that it can create an instance.
|
| - mojo::embedder::ScopedPlatformHandle platform_channel =
|
| + mojo::edk::ScopedPlatformHandle platform_channel =
|
| platform_channel_pair.PassServerHandle();
|
| - mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel(
|
| - std::move(platform_channel), base::Bind(&DidCreateChannel),
|
| - base::ThreadTaskRunnerHandle::Get()));
|
| + mojo::ScopedMessagePipeHandle handle(mojo::edk::CreateMessagePipe(
|
| + std::move(platform_channel)));
|
| mojo::shell::mojom::ApplicationManagerPtr application_manager;
|
| MojoShellConnection::Get()->GetApplication()->ConnectToService(
|
| "mojo:shell", &application_manager);
|
| @@ -161,8 +150,8 @@ void RegisterChildWithExternalShell(int child_process_id,
|
| std::move(request));
|
|
|
| // Send the other end to the child via Chrome IPC.
|
| - base::PlatformFile client_file = PlatformFileFromScopedPlatformHandle(
|
| - platform_channel_pair.PassClientHandle());
|
| + base::PlatformFile client_file =
|
| + platform_channel_pair.PassClientHandle().release().handle;
|
| SetMojoPlatformFile(render_process_host, client_file);
|
|
|
| // Store the URL on the RPH so client code can access it later via
|
| @@ -188,12 +177,12 @@ void SendExternalMojoShellHandleToChild(
|
| IPC::GetFileHandleForProcess(client_file->get(), process_handle, true)));
|
| }
|
|
|
| -mojo::embedder::ScopedPlatformHandle RegisterProcessWithBroker(
|
| +mojo::edk::ScopedPlatformHandle RegisterProcessWithBroker(
|
| base::ProcessId pid) {
|
| - mojo::embedder::PlatformChannelPair platform_channel_pair;
|
| + mojo::edk::PlatformChannelPair platform_channel_pair;
|
|
|
| MojoHandle platform_handle_wrapper;
|
| - MojoResult rv = mojo::embedder::CreatePlatformHandleWrapper(
|
| + MojoResult rv = mojo::edk::CreatePlatformHandleWrapper(
|
| platform_channel_pair.PassServerHandle(), &platform_handle_wrapper);
|
| CHECK_EQ(rv, MOJO_RESULT_OK);
|
|
|
|
|