| Index: remoting/host/desktop_session_agent.cc
|
| diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
|
| index 63daad84cc61369d988b3580b108c3b0b29bcedc..df5c1b218a2c1fbd277f4cf0f4870ab44cd10826 100644
|
| --- a/remoting/host/desktop_session_agent.cc
|
| +++ b/remoting/host/desktop_session_agent.cc
|
| @@ -13,7 +13,6 @@
|
| #include "base/memory/shared_memory.h"
|
| #include "base/process/process_handle.h"
|
| #include "build/build_config.h"
|
| -#include "ipc/attachment_broker.h"
|
| #include "ipc/ipc_channel_proxy.h"
|
| #include "ipc/ipc_message.h"
|
| #include "ipc/ipc_message_macros.h"
|
| @@ -207,20 +206,13 @@ void DesktopSessionAgent::OnChannelConnected(int32_t peer_pid) {
|
| DCHECK(caller_task_runner_->BelongsToCurrentThread());
|
|
|
| VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")";
|
| -
|
| - desktop_pipe_.Close();
|
| }
|
|
|
| void DesktopSessionAgent::OnChannelError() {
|
| DCHECK(caller_task_runner_->BelongsToCurrentThread());
|
|
|
| // Make sure the channel is closed.
|
| - if (IPC::AttachmentBroker::GetGlobal()) {
|
| - IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
|
| - network_channel_.get());
|
| - }
|
| network_channel_.reset();
|
| - desktop_pipe_.Close();
|
|
|
| // Notify the caller that the channel has been disconnected.
|
| if (delegate_.get())
|
| @@ -390,28 +382,17 @@ void DesktopSessionAgent::ProcessAudioPacket(
|
| serialized_packet));
|
| }
|
|
|
| -bool DesktopSessionAgent::Start(const base::WeakPtr<Delegate>& delegate,
|
| - IPC::PlatformFileForTransit* desktop_pipe_out) {
|
| +mojo::ScopedMessagePipeHandle DesktopSessionAgent::Start(
|
| + const base::WeakPtr<Delegate>& delegate) {
|
| DCHECK(caller_task_runner_->BelongsToCurrentThread());
|
| DCHECK(delegate_.get() == nullptr);
|
|
|
| delegate_ = delegate;
|
|
|
| - // Create an IPC channel to communicate with the network process.
|
| - bool result = CreateConnectedIpcChannel(io_task_runner_,
|
| - this,
|
| - &desktop_pipe_,
|
| - &network_channel_);
|
| - base::PlatformFile raw_desktop_pipe = desktop_pipe_.GetPlatformFile();
|
| -#if defined(OS_WIN)
|
| - *desktop_pipe_out =
|
| - IPC::PlatformFileForTransit(raw_desktop_pipe, base::GetCurrentProcId());
|
| -#elif defined(OS_POSIX)
|
| - *desktop_pipe_out = IPC::PlatformFileForTransit(raw_desktop_pipe, false);
|
| -#else
|
| -#error Unsupported platform.
|
| -#endif
|
| - return result;
|
| + mojo::MessagePipe pipe;
|
| + network_channel_ = IPC::ChannelProxy::Create(
|
| + pipe.handle0.release(), IPC::Channel::MODE_SERVER, this, io_task_runner_);
|
| + return std::move(pipe.handle1);
|
| }
|
|
|
| void DesktopSessionAgent::Stop() {
|
| @@ -420,10 +401,6 @@ void DesktopSessionAgent::Stop() {
|
| delegate_.reset();
|
|
|
| // Make sure the channel is closed.
|
| - if (IPC::AttachmentBroker::GetGlobal()) {
|
| - IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
|
| - network_channel_.get());
|
| - }
|
| network_channel_.reset();
|
|
|
| if (started_) {
|
|
|