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

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

Issue 10855249: [Chromoting] The daemon process now starts the networking process and passes the host configuration… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback + rebased on top of https://chromiumcodereview.appspot.com/10829467/ (Patch Set 5) Created 8 years, 4 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/worker_process_launcher.h
diff --git a/remoting/host/win/worker_process_launcher.h b/remoting/host/win/worker_process_launcher.h
index f57ecd88e36493e041f254e353f3e4025d2d354d..690bf51eb8aa53e489f44ff5ee02e2f09fab4229 100644
--- a/remoting/host/win/worker_process_launcher.h
+++ b/remoting/host/win/worker_process_launcher.h
@@ -28,6 +28,8 @@ class Message;
namespace remoting {
+class WorkerProcessDelegate;
+
// Launches a worker process that is controlled via an IPC channel. All
// interaction with the spawned process is through the IPC::Listener and Send()
// method. In case of error the channel is closed and the worker process is
@@ -52,25 +54,18 @@ class WorkerProcessLauncher
// Terminates the worker process with the given exit code.
virtual void DoKillProcess(DWORD exit_code) = 0;
-
- // Notifies that a client has been connected to the channel.
- virtual void OnChannelConnected() = 0;
-
- // Processes messages sent by the client.
- virtual bool OnMessageReceived(const IPC::Message& message) = 0;
};
- // Creates the launcher.
- // |delegate| will be able to receive messages sent over the channel once
- // the worker has been started and until it is stopped by Stop() or an error
- // occurs.
+ // Creates the launcher that will use |launcher_delegate| to manage the worker
+ // process and |worker_delegate| to handle IPCs.
//
// |stopped_callback| and |main_task_runner| are passed to the underlying
// |Stoppable| implementation. The caller should call all the methods on this
// class on the |main_task_runner| thread. |ipc_task_runner| is used to
// perform background IPC I/O.
WorkerProcessLauncher(
- Delegate* delegate,
+ Delegate* launcher_delegate,
+ WorkerProcessDelegate* worker_delegate,
const base::Closure& stopped_callback,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner);
@@ -79,8 +74,9 @@ class WorkerProcessLauncher
// Starts the worker process.
void Start(const std::string& pipe_sddl);
- // Sends an IPC message to the worker process. This method can be called only
- // after successful Start() and until Stop() is called or an error occurred.
+ // Sends an IPC message to the worker process. The message will be silently
+ // dropped if Send() is called before Start() or after stutdown has been
+ // initiated.
void Send(IPC::Message* message);
// base::win::ObjectWatcher::Delegate implementation.
@@ -104,7 +100,8 @@ class WorkerProcessLauncher
// Generates random channel ID.
std::string GenerateRandomChannelId();
- Delegate* delegate_;
+ Delegate* launcher_delegate_;
+ WorkerProcessDelegate* worker_delegate_;
// The main service message loop.
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698