Index: remoting/host/win/unprivileged_process_delegate.h |
diff --git a/remoting/host/win/unprivileged_process_delegate.h b/remoting/host/win/unprivileged_process_delegate.h |
index 0108371a8b8d8d45c085b694f3fd31641b8711d9..a8600ddb66c1ec2bf0b1b96b9027ed711ef3d774 100644 |
--- a/remoting/host/win/unprivileged_process_delegate.h |
+++ b/remoting/host/win/unprivileged_process_delegate.h |
@@ -9,12 +9,19 @@ |
#include "base/compiler_specific.h" |
#include "base/file_path.h" |
#include "base/memory/ref_counted.h" |
+#include "base/win/scoped_handle.h" |
#include "remoting/host/win/worker_process_launcher.h" |
namespace base { |
class SingleThreadTaskRunner; |
} // namespace base |
+namespace IPC { |
+class ChannelProxy; |
+class Listener; |
+class Message; |
+} // namespace IPC |
+ |
namespace remoting { |
// Implements logic for launching and monitoring a worker process under a less |
@@ -27,14 +34,27 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { |
const FilePath& binary_path); |
virtual ~UnprivilegedProcessDelegate(); |
+ // IPC::Sender implementation. |
+ virtual bool Send(IPC::Message* message) OVERRIDE; |
+ |
// WorkerProcessLauncher::Delegate implementation. |
virtual DWORD GetExitCode() OVERRIDE; |
virtual void KillProcess(DWORD exit_code) OVERRIDE; |
virtual bool LaunchProcess( |
- const std::string& channel_name, |
+ IPC::Listener* delegate, |
base::win::ScopedHandle* process_exit_event_out) OVERRIDE; |
private: |
+ // Creates an already connected IPC channel. The server end of the channel |
+ // is wrapped into a channel proxy that will invoke methods of |delegate| |
+ // on the |main_task_runner| thread while using |io_task_runner| to send and |
+ // receive messages in the background. The client end is returned as |
+ // an inheritable NT handle. |
+ bool CreateConnectedIpcChannel(const std::string& channel_name, |
+ IPC::Listener* delegate, |
+ base::win::ScopedHandle* client_out, |
+ scoped_ptr<IPC::ChannelProxy>* server_out); |
+ |
// The task runner all public methods of this class should be called on. |
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
@@ -44,6 +64,10 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { |
// Path to the worker process binary. |
FilePath binary_path_; |
+ // The server end of the IPC channel used to communicate to the worker |
+ // process. |
+ scoped_ptr<IPC::ChannelProxy> channel_; |
+ |
// The handle of the worker process, if launched. |
base::win::ScopedHandle worker_process_; |