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

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

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: Restore sighup_listener.h/.cc since they are going to be reused by Jamie's CL and ignore SIGHUP for… 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.cc
diff --git a/remoting/host/win/worker_process_launcher.cc b/remoting/host/win/worker_process_launcher.cc
index 79f196e9a7f5a5c9bf8137a59be85bd65e09b467..2e82d98ffa7ebe219fceea5db31808b924919a8a 100644
--- a/remoting/host/win/worker_process_launcher.cc
+++ b/remoting/host/win/worker_process_launcher.cc
@@ -20,6 +20,7 @@
#include "base/win/scoped_handle.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h"
+#include "remoting/host/worker_process_ipc_delegate.h"
using base::win::ScopedHandle;
@@ -37,12 +38,14 @@ WorkerProcessLauncher::Delegate::~Delegate() {
}
WorkerProcessLauncher::WorkerProcessLauncher(
- Delegate* delegate,
+ Delegate* launcher_delegate,
+ WorkerProcessIpcDelegate* worker_delegate,
const base::Closure& stopped_callback,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner)
: Stoppable(main_task_runner, stopped_callback),
- delegate_(delegate),
+ launcher_delegate_(launcher_delegate),
+ worker_delegate_(worker_delegate),
main_task_runner_(main_task_runner),
ipc_task_runner_(ipc_task_runner) {
}
@@ -69,12 +72,13 @@ void WorkerProcessLauncher::Start(const std::string& pipe_sddl) {
// Launch the process and attach an object watcher to the returned process
// handle so that we get notified if the process terminates.
- if (delegate_->DoLaunchProcess(channel_name, &process_exit_event_)) {
+ if (launcher_delegate_->DoLaunchProcess(channel_name,
+ &process_exit_event_)) {
if (process_watcher_.StartWatching(process_exit_event_, this)) {
return;
}
- delegate_->DoKillProcess(CONTROL_C_EXIT);
+ launcher_delegate_->DoKillProcess(CONTROL_C_EXIT);
}
}
@@ -84,7 +88,11 @@ void WorkerProcessLauncher::Start(const std::string& pipe_sddl) {
void WorkerProcessLauncher::Send(IPC::Message* message) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
- ipc_channel_->Send(message);
+ if (ipc_channel_.get()) {
+ ipc_channel_->Send(message);
+ } else {
+ delete message;
+ }
}
void WorkerProcessLauncher::OnObjectSignaled(HANDLE object) {
@@ -100,7 +108,7 @@ bool WorkerProcessLauncher::OnMessageReceived(const IPC::Message& message) {
DCHECK(pipe_.IsValid());
DCHECK(process_exit_event_.IsValid());
- return delegate_->OnMessageReceived(message);
+ return worker_delegate_->OnMessageReceived(message);
}
void WorkerProcessLauncher::OnChannelConnected(int32 peer_pid) {
@@ -117,7 +125,7 @@ void WorkerProcessLauncher::OnChannelConnected(int32 peer_pid) {
// If we'd like to be able to launch low-privileged workers and let them
// connect back, the pipe handle should be passed to the worker instead of
// the pipe name.
- delegate_->OnChannelConnected();
+ worker_delegate_->OnChannelConnected();
}
void WorkerProcessLauncher::OnChannelError() {
@@ -137,7 +145,7 @@ void WorkerProcessLauncher::DoStop() {
// Kill the process if it has been started already.
if (process_watcher_.GetWatchedObject() != NULL) {
- delegate_->DoKillProcess(CONTROL_C_EXIT);
+ launcher_delegate_->DoKillProcess(CONTROL_C_EXIT);
return;
}

Powered by Google App Engine
This is Rietveld 408576698