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

Unified Diff: remoting/host/ipc_util_win.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/ipc_util_posix.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/ipc_util_win.cc
diff --git a/remoting/host/ipc_util_win.cc b/remoting/host/ipc_util_win.cc
index a7187a81805d8f2001d6278b67b78e32cc628a16..5da5f8264fe1fe7ecf00894b889a766e376a1f59 100644
--- a/remoting/host/ipc_util_win.cc
+++ b/remoting/host/ipc_util_win.cc
@@ -13,6 +13,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_handle.h"
#include "base/win/win_util.h"
+#include "ipc/attachment_broker.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_proxy.h"
#include "remoting/host/win/security_descriptor.h"
@@ -56,9 +57,12 @@ bool CreateConnectedIpcChannel(
}
// Wrap the pipe into an IPC channel.
- std::unique_ptr<IPC::ChannelProxy> server = IPC::ChannelProxy::Create(
- IPC::ChannelHandle(pipe.Get()), IPC::Channel::MODE_SERVER, listener,
- io_task_runner);
+ std::unique_ptr<IPC::ChannelProxy> server(
+ new IPC::ChannelProxy(listener, io_task_runner));
+ IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
+ server.get(), io_task_runner);
+ server->Init(IPC::ChannelHandle(pipe.Get()), IPC::Channel::MODE_SERVER,
+ true);
// Convert the channel name to the pipe name.
std::string pipe_name(kChromePipeNamePrefix);
« no previous file with comments | « remoting/host/ipc_util_posix.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698