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

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

Issue 1634933007: remoting: Add AttachmentBroker for daemon and desktop processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/desktop_process.cc ('k') | remoting/host/win/wts_session_process_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..67a6b212a200eee060e6cd84e6a8647141302ff0 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()) {
@@ -398,7 +407,7 @@ void UnprivilegedProcessDelegate::OnChannelError() {
void UnprivilegedProcessDelegate::ReportFatalError() {
DCHECK(CalledOnValidThread());
- channel_.reset();
+ CloseChannel();
WorkerProcessLauncher* event_handler = event_handler_;
event_handler_ = nullptr;
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/win/wts_session_process_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698