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

Unified Diff: remoting/host/win/wts_session_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/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 c2ba5d67eb91d52b33997a585fc95dc65bac426f..efdb8b85fbbde8a78ec4820af56543e78e08d88b 100644
--- a/remoting/host/win/wts_session_process_delegate.cc
+++ b/remoting/host/win/wts_session_process_delegate.cc
@@ -20,6 +20,7 @@
#include "base/thread_task_runner_handle.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_listener.h"
@@ -244,6 +245,11 @@ void WtsSessionProcessDelegate::Core::Send(IPC::Message* message) {
void WtsSessionProcessDelegate::Core::CloseChannel() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
+ if (!channel_)
+ return;
+
+ IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
+ channel_.get());
channel_.reset();
pipe_.Close();
}
@@ -251,10 +257,10 @@ void WtsSessionProcessDelegate::Core::CloseChannel() {
void WtsSessionProcessDelegate::Core::KillProcess() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- channel_.reset();
+ CloseChannel();
+
event_handler_ = nullptr;
launch_pending_ = false;
- pipe_.Close();
if (launch_elevated_) {
if (job_.IsValid())
@@ -420,6 +426,9 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() {
channel_ = std::move(channel);
pipe_ = std::move(pipe);
+ IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
+ channel_.get());
+
// Report success if the worker process is lauched directly. Otherwise, PID of
// the client connected to the pipe will be used later. See
// OnChannelConnected().
@@ -487,8 +496,7 @@ void WtsSessionProcessDelegate::Core::OnActiveProcessZero() {
void WtsSessionProcessDelegate::Core::ReportFatalError() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- channel_.reset();
- pipe_.Close();
+ CloseChannel();
WorkerProcessLauncher* event_handler = event_handler_;
event_handler_ = nullptr;
« 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