Index: remoting/host/win/unprivileged_process_delegate.cc |
diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc |
index b7fb879393d380089958819485944b52ed2e9b97..97d6907e3d94a4ba6c5173cc8f99b8155d7521de 100644 |
--- a/remoting/host/win/unprivileged_process_delegate.cc |
+++ b/remoting/host/win/unprivileged_process_delegate.cc |
@@ -23,6 +23,7 @@ |
#include "base/synchronization/lock.h" |
#include "base/win/scoped_handle.h" |
#include "base/win/windows_version.h" |
+#include "ipc/attachment_broker.h" |
#include "ipc/ipc_channel.h" |
#include "ipc/ipc_channel_proxy.h" |
#include "ipc/ipc_message.h" |
@@ -336,6 +337,9 @@ void UnprivilegedProcessDelegate::LaunchProcess( |
} |
channel_ = std::move(server); |
+ IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
+ channel_.get()); |
+ |
ReportProcessLaunched(std::move(worker_process)); |
} |
@@ -352,13 +356,18 @@ void UnprivilegedProcessDelegate::Send(IPC::Message* message) { |
void UnprivilegedProcessDelegate::CloseChannel() { |
DCHECK(CalledOnValidThread()); |
+ if (!channel_) |
+ return; |
+ |
+ IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel( |
+ channel_.get()); |
channel_.reset(); |
} |
void UnprivilegedProcessDelegate::KillProcess() { |
DCHECK(CalledOnValidThread()); |
- channel_.reset(); |
+ CloseChannel(); |
event_handler_ = nullptr; |
if (worker_process_.IsValid()) { |