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

Unified Diff: remoting/host/win/wts_session_process_delegate.cc

Issue 1903663004: IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (scoped_ptr->std::unique_ptr) Created 4 years, 8 months 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 | « remoting/host/win/unprivileged_process_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/wts_session_process_delegate.cc
diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc
index be23baf35113004547e62738ad398810627a968f..779cc6274b36f13d8af5160929c06f697ae6f5fe 100644
--- a/remoting/host/win/wts_session_process_delegate.cc
+++ b/remoting/host/win/wts_session_process_delegate.cc
@@ -382,9 +382,12 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() {
}
// Wrap the pipe into an IPC channel.
- std::unique_ptr<IPC::ChannelProxy> channel(IPC::ChannelProxy::Create(
- IPC::ChannelHandle(pipe.Get()), IPC::Channel::MODE_SERVER, this,
- io_task_runner_));
+ std::unique_ptr<IPC::ChannelProxy> channel(
+ new IPC::ChannelProxy(this, io_task_runner_));
+ IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
+ channel.get(), io_task_runner_);
+ channel->Init(IPC::ChannelHandle(pipe.Get()), IPC::Channel::MODE_SERVER,
+ true);
// Pass the name of the IPC channel to use.
command_line.AppendSwitchNative(kDaemonPipeSwitchName,
@@ -424,9 +427,6 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() {
channel_ = std::move(channel);
pipe_ = std::move(pipe);
- IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
- channel_.get(), io_task_runner_);
-
// Report success if the worker process is lauched directly. Otherwise, PID of
// the client connected to the pipe will be used later. See
// OnChannelConnected().
« no previous file with comments | « remoting/host/win/unprivileged_process_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698