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

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: CR feedback. 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
« no previous file with comments | « remoting/host/win/launch_process_with_token.cc ('k') | remoting/host/win/unprivileged_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.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_;
« no previous file with comments | « remoting/host/win/launch_process_with_token.cc ('k') | remoting/host/win/unprivileged_process_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698