| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| 6 #define REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "remoting/host/win/worker_process_launcher.h" |
| 13 |
| 14 namespace base { |
| 15 class SingleThreadTaskRunner; |
| 16 } // namespace base |
| 17 |
| 18 namespace remoting { |
| 19 |
| 20 // Implements logic for launching and monitoring a worker process under a less |
| 21 // privileged user account. |
| 22 class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { |
| 23 public: |
| 24 UnprivilegedProcessDelegate( |
| 25 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 26 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 27 const FilePath& binary_path); |
| 28 virtual ~UnprivilegedProcessDelegate(); |
| 29 |
| 30 // WorkerProcessLauncher::Delegate implementation. |
| 31 virtual DWORD GetExitCode() OVERRIDE; |
| 32 virtual void KillProcess(DWORD exit_code) OVERRIDE; |
| 33 virtual bool LaunchProcess( |
| 34 const std::string& channel_name, |
| 35 base::win::ScopedHandle* process_exit_event_out) OVERRIDE; |
| 36 |
| 37 private: |
| 38 // The task runner all public methods of this class should be called on. |
| 39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 40 |
| 41 // The task runner serving job object notifications. |
| 42 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 43 |
| 44 // Path to the worker process binary. |
| 45 FilePath binary_path_; |
| 46 |
| 47 // The handle of the worker process, if launched. |
| 48 base::win::ScopedHandle worker_process_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(UnprivilegedProcessDelegate); |
| 51 }; |
| 52 |
| 53 } // namespace remoting |
| 54 |
| 55 #endif // REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| OLD | NEW |