| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ | 5 #ifndef REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| 6 #define REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ | 6 #define REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/sequence_checker.h" |
| 17 #include "base/win/scoped_handle.h" | 17 #include "base/win/scoped_handle.h" |
| 18 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 19 #include "remoting/host/win/worker_process_launcher.h" | 19 #include "remoting/host/win/worker_process_launcher.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class CommandLine; | 22 class CommandLine; |
| 23 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
| 24 } // namespace base | 24 } // namespace base |
| 25 | 25 |
| 26 namespace IPC { | 26 namespace IPC { |
| 27 class ChannelProxy; | 27 class ChannelProxy; |
| 28 class Message; | 28 class Message; |
| 29 } // namespace IPC | 29 } // namespace IPC |
| 30 | 30 |
| 31 namespace remoting { | 31 namespace remoting { |
| 32 | 32 |
| 33 // Implements logic for launching and monitoring a worker process under a less | 33 // Implements logic for launching and monitoring a worker process under a less |
| 34 // privileged user account. | 34 // privileged user account. |
| 35 class UnprivilegedProcessDelegate | 35 class UnprivilegedProcessDelegate : public IPC::Listener, |
| 36 : public base::NonThreadSafe, | 36 public WorkerProcessLauncher::Delegate { |
| 37 public IPC::Listener, | |
| 38 public WorkerProcessLauncher::Delegate { | |
| 39 public: | 37 public: |
| 40 UnprivilegedProcessDelegate( | 38 UnprivilegedProcessDelegate( |
| 41 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 39 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 42 std::unique_ptr<base::CommandLine> target_command); | 40 std::unique_ptr<base::CommandLine> target_command); |
| 43 ~UnprivilegedProcessDelegate() override; | 41 ~UnprivilegedProcessDelegate() override; |
| 44 | 42 |
| 45 // WorkerProcessLauncher::Delegate implementation. | 43 // WorkerProcessLauncher::Delegate implementation. |
| 46 void LaunchProcess(WorkerProcessLauncher* event_handler) override; | 44 void LaunchProcess(WorkerProcessLauncher* event_handler) override; |
| 47 void Send(IPC::Message* message) override; | 45 void Send(IPC::Message* message) override; |
| 48 void CloseChannel() override; | 46 void CloseChannel() override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 65 | 63 |
| 66 // The server end of the IPC channel used to communicate to the worker | 64 // The server end of the IPC channel used to communicate to the worker |
| 67 // process. | 65 // process. |
| 68 std::unique_ptr<IPC::ChannelProxy> channel_; | 66 std::unique_ptr<IPC::ChannelProxy> channel_; |
| 69 | 67 |
| 70 WorkerProcessLauncher* event_handler_; | 68 WorkerProcessLauncher* event_handler_; |
| 71 | 69 |
| 72 // The handle of the worker process, if launched. | 70 // The handle of the worker process, if launched. |
| 73 base::win::ScopedHandle worker_process_; | 71 base::win::ScopedHandle worker_process_; |
| 74 | 72 |
| 73 SEQUENCE_CHECKER(sequence_checker_); |
| 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(UnprivilegedProcessDelegate); | 75 DISALLOW_COPY_AND_ASSIGN(UnprivilegedProcessDelegate); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace remoting | 78 } // namespace remoting |
| 79 | 79 |
| 80 #endif // REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ | 80 #endif // REMOTING_HOST_WIN_UNPRIVILEGED_PROCESS_DELEGATE_H_ |
| OLD | NEW |