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

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

Issue 15077010: [Chromoting] Refactored worker process launching code and speeded up the desktop process launch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 f256c6fbfb5bf83f93257a44a61cbf2959d417bb..230da6ebe36ad81a5e7b0212547938601813af4c 100644
--- a/remoting/host/win/unprivileged_process_delegate.h
+++ b/remoting/host/win/unprivileged_process_delegate.h
@@ -10,7 +10,9 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/threading/non_thread_safe.h"
#include "base/win/scoped_handle.h"
+#include "ipc/ipc_listener.h"
#include "remoting/host/win/worker_process_launcher.h"
class CommandLine;
@@ -21,7 +23,6 @@ class SingleThreadTaskRunner;
namespace IPC {
class ChannelProxy;
-class Listener;
class Message;
} // namespace IPC
@@ -29,29 +30,30 @@ namespace remoting {
// Implements logic for launching and monitoring a worker process under a less
// privileged user account.
-class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate {
+class UnprivilegedProcessDelegate
+ : public base::NonThreadSafe,
+ public IPC::Listener,
+ public WorkerProcessLauncher::Delegate {
public:
UnprivilegedProcessDelegate(
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_ptr<CommandLine> target_command);
virtual ~UnprivilegedProcessDelegate();
- // IPC::Sender implementation.
- virtual bool Send(IPC::Message* message) OVERRIDE;
-
// WorkerProcessLauncher::Delegate implementation.
+ virtual void LaunchProcess(WorkerProcessLauncher* event_handler) OVERRIDE;
+ virtual void Send(IPC::Message* message) OVERRIDE;
virtual void CloseChannel() OVERRIDE;
- virtual DWORD GetProcessId() const OVERRIDE;
- virtual bool IsPermanentError(int failure_count) const OVERRIDE;
- virtual void KillProcess(DWORD exit_code) OVERRIDE;
- virtual bool LaunchProcess(
- IPC::Listener* delegate,
- base::win::ScopedHandle* process_exit_event_out) OVERRIDE;
+ virtual void KillProcess() OVERRIDE;
private:
- // The task runner all public methods of this class should be called on.
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
+
+ void ReportFatalError();
+ void ReportProcessLaunched(base::win::ScopedHandle worker_process);
// The task runner serving job object notifications.
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
@@ -63,6 +65,8 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate {
// process.
scoped_ptr<IPC::ChannelProxy> channel_;
+ WorkerProcessLauncher* event_handler_;
+
// The handle of the worker process, if launched.
base::win::ScopedHandle worker_process_;

Powered by Google App Engine
This is Rietveld 408576698