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 74659f7aa7642538eccc6b0d86a286240c094dce..434e5df1e3bfba3208a608d6fe8c1c527ed6c4a1 100644 |
--- a/remoting/host/win/wts_session_process_delegate.cc |
+++ b/remoting/host/win/wts_session_process_delegate.cc |
@@ -62,6 +62,7 @@ class WtsSessionProcessDelegate::Core |
virtual bool Send(IPC::Message* message) OVERRIDE; |
// WorkerProcessLauncher::Delegate implementation. |
+ virtual void CloseChannel() OVERRIDE; |
virtual DWORD GetProcessId() const OVERRIDE; |
virtual bool IsPermanentError(int failure_count) const OVERRIDE; |
virtual void KillProcess(DWORD exit_code) OVERRIDE; |
@@ -173,7 +174,7 @@ void WtsSessionProcessDelegate::Core::OnIOCompleted( |
bool WtsSessionProcessDelegate::Core::Send(IPC::Message* message) { |
DCHECK(main_task_runner_->BelongsToCurrentThread()); |
- if (channel_.get()) { |
+ if (channel_) { |
return channel_->Send(message); |
} else { |
delete message; |
@@ -181,6 +182,13 @@ bool WtsSessionProcessDelegate::Core::Send(IPC::Message* message) { |
} |
} |
+void WtsSessionProcessDelegate::Core::CloseChannel() { |
+ DCHECK(main_task_runner_->BelongsToCurrentThread()); |
+ |
+ channel_.reset(); |
+ pipe_.Close(); |
+} |
+ |
DWORD WtsSessionProcessDelegate::Core::GetProcessId() const { |
DWORD pid = 0; |
if (launch_elevated_ && pipe_.IsValid() && |
@@ -496,6 +504,11 @@ bool WtsSessionProcessDelegate::Send(IPC::Message* message) { |
return core_->Send(message); |
} |
+void WtsSessionProcessDelegate::CloseChannel() { |
+ if (core_) |
+ core_->CloseChannel(); |
+} |
+ |
DWORD WtsSessionProcessDelegate::GetProcessId() const { |
if (!core_) |
return 0; |