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

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

Issue 11118005: Pass the client end handle of the network-to-daemon IPC channel via handle inheritance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
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..ee7aa1f7966df57b21e508444f4925529619de7b 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,
simonmorris 2012/10/12 16:31:13 string -> string& ?
alexeypa (please no reviews) 2012/10/12 18:44:39 Done.
+ 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 commonicate to the worker
simonmorris 2012/10/12 16:31:13 commonicate -> communicate
alexeypa (please no reviews) 2012/10/12 18:44:39 Done.
+ // process.
+ scoped_ptr<IPC::ChannelProxy> channel_;
+
// The handle of the worker process, if launched.
base::win::ScopedHandle worker_process_;

Powered by Google App Engine
This is Rietveld 408576698