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

Issue 9705065: Introducing the WorkerProcessLauncher class implementing the common logic for spawning a worker pro… (Closed)

Created:
8 years, 9 months ago by alexeypa (please no reviews)
Modified:
8 years, 8 months ago
Reviewers:
Lambros, Wez
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, simonmorris+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Visibility:
Public.

Description

Introducing the WorkerProcessLauncher class implementing the common logic for spawning a worker processes and establishing an IPC channel with the created worker.

Patch Set 1 #

Total comments: 39

Patch Set 2 : CR feedback #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+389 lines, -225 lines) Patch
M remoting/host/host_service_win.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
A remoting/host/worker_process_launcher.h View 1 1 chunk +118 lines, -0 lines 5 comments Download
A remoting/host/worker_process_launcher.cc View 1 1 chunk +122 lines, -0 lines 2 comments Download
M remoting/host/wts_session_process_launcher_win.h View 1 4 chunks +31 lines, -36 lines 2 comments Download
M remoting/host/wts_session_process_launcher_win.cc View 1 6 chunks +114 lines, -188 lines 0 comments Download
M remoting/remoting.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
alexeypa (please no reviews)
PTAL
8 years, 9 months ago (2012-03-15 17:01:12 UTC) #1
Lambros
https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_process_launcher_posix.cc File remoting/host/worker_process_launcher_posix.cc (right): https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_process_launcher_posix.cc#newcode6 remoting/host/worker_process_launcher_posix.cc:6: // running within user sessions. Drive-by: I don't think ...
8 years, 9 months ago (2012-03-15 22:24:14 UTC) #2
alexeypa (please no reviews)
FYI https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_process_launcher_posix.cc File remoting/host/worker_process_launcher_posix.cc (right): https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_process_launcher_posix.cc#newcode6 remoting/host/worker_process_launcher_posix.cc:6: // running within user sessions. On 2012/03/15 22:24:14, ...
8 years, 9 months ago (2012-03-15 22:27:12 UTC) #3
Wez
I'm not sure I see the value of the WorkerProcessLauncher vs WorkerProcessLauncherWin split - seems ...
8 years, 9 months ago (2012-03-15 23:24:31 UTC) #4
alexeypa (please no reviews)
Please take another look. Note, I didn't rename worker_process_launcher.* to worker_process_launcher_win.* just to make diffs ...
8 years, 9 months ago (2012-03-16 17:43:50 UTC) #5
Wez
8 years, 9 months ago (2012-03-27 16:45:44 UTC) #6
https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_pr...
File remoting/host/worker_process_launcher.h (right):

https://chromiumcodereview.appspot.com/9705065/diff/1/remoting/host/worker_pr...
remoting/host/worker_process_launcher.h:51: CreateChannelHandleCallback;
On 2012/03/16 17:43:50, alexeypa wrote:
> On 2012/03/15 23:24:31, Wez wrote:
> > Why implement these as callbacks rather than as methods on an interface?
> 
> I've tried to make them pure virtual methods. It didn't work out even after
> making WorkerProcessLauncher a Windows-specific class. For instance
> WtsSessionProcessLauncher cannot inherit from WorkerProcessLauncher because
the
> former will retry on failure and the latter is good for one try only (on
> purpose).
> 
> This means that WtsSessionProcessLauncher will use another private class, say
> XxxLauncher implementing CreateChannelHandle() and LaunchWorker(). But then
> XxxLauncher and WtsSessionProcessLauncher will need to share more state
> (ipc_pipe_, host_binary_) or XxxLauncher should call back to
> WtsSessionProcessLauncher. 
> 
> This all looks like too much of a hassle while callbacks are an easy way to
> borrow a couple methods from an unrelated class and be done with it.
> 
> should implement a separate copy of IPC::Channel::Listener and not 

What I meant was an interface, not pure-virtual inheritance;
WorkerProcessLauncher would define alongside it a Delegate interface for
WtsSessionProcessLauncher to implement the relevant functions.  It's no
different from what you're doing with Callbacks except that you have a Delegate
interface.

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
File remoting/host/worker_process_launcher.cc (right):

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.cc:114: base::GetCurrentProcId(), this,
Do we really want to include the in-memory address of this object in the channel
Id?

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.cc:118: base::Process&
WorkerProcessLauncherWin::get_process() {
nit: Prefer to keep methods defined in the order they appear in the header where
possible.

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
File remoting/host/worker_process_launcher.h (right):

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.h:38: // handle and creation of the
process.
nit: platform-specific -> application-specific?

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.h:43: // For the caller all interaction
with the spawned process is through
nit: ... is through the IPC::Listener ...

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.h:44: // IPC::Listener interface and
Send() method. In case of any error the channel
nit: In case of error ...

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.h:65: // |listener| can receive channel
events once the worked has been started and
typo: worked -> worker

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/worker...
remoting/host/worker_process_launcher.h:93: base::Process& get_process();
Does this still need to be protected, not private?

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/wts_se...
File remoting/host/wts_session_process_launcher_win.h (right):

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/wts_se...
remoting/host/wts_session_process_launcher_win.h:78: void LaunchProcess();
nit: Re-name this to LaunchWtsSessionProcess() to make its relevance over
LaunchWorker clearer. Replacing the two Callbacks with a single delegate
interface should also help with that.

https://chromiumcodereview.appspot.com/9705065/diff/6001/remoting/host/wts_se...
remoting/host/wts_session_process_launcher_win.h:90: // This is a place to store
pipe handle until the host process has been
nit: "Used to store the IPC pipe handle until the worked process has been
started."?

Powered by Google App Engine
This is Rietveld 408576698