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_WTS_SESSION_PROCESS_DELEGATE_H_ | 5 #ifndef REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ |
6 #define REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ | 6 #define REMOTING_HOST_WIN_WTS_SESSION_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/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/sequence_checker.h" |
16 #include "remoting/host/win/worker_process_launcher.h" | 16 #include "remoting/host/win/worker_process_launcher.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class CommandLine; | 19 class CommandLine; |
20 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
21 } // namespace base | 21 } // namespace base |
22 | 22 |
23 namespace IPC { | 23 namespace IPC { |
24 class Message; | 24 class Message; |
25 } // namespace base | 25 } // namespace base |
26 | 26 |
27 namespace remoting { | 27 namespace remoting { |
28 | 28 |
29 // Implements logic for launching and monitoring a worker process in a different | 29 // Implements logic for launching and monitoring a worker process in a different |
30 // session. | 30 // session. |
31 class WtsSessionProcessDelegate | 31 class WtsSessionProcessDelegate : public WorkerProcessLauncher::Delegate { |
32 : public base::NonThreadSafe, | |
33 public WorkerProcessLauncher::Delegate { | |
34 public: | 32 public: |
35 WtsSessionProcessDelegate( | 33 WtsSessionProcessDelegate( |
36 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 34 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
37 std::unique_ptr<base::CommandLine> target, | 35 std::unique_ptr<base::CommandLine> target, |
38 bool launch_elevated, | 36 bool launch_elevated, |
39 const std::string& channel_security); | 37 const std::string& channel_security); |
40 ~WtsSessionProcessDelegate() override; | 38 ~WtsSessionProcessDelegate() override; |
41 | 39 |
42 // Initializes the object returning true on success. | 40 // Initializes the object returning true on success. |
43 bool Initialize(uint32_t session_id); | 41 bool Initialize(uint32_t session_id); |
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; |
49 void KillProcess() override; | 47 void KillProcess() override; |
50 | 48 |
51 private: | 49 private: |
52 // The actual implementation resides in WtsSessionProcessDelegate::Core class. | 50 // The actual implementation resides in WtsSessionProcessDelegate::Core class. |
53 class Core; | 51 class Core; |
54 scoped_refptr<Core> core_; | 52 scoped_refptr<Core> core_; |
55 | 53 |
| 54 SEQUENCE_CHECKER(sequence_checker_); |
| 55 |
56 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace remoting | 59 } // namespace remoting |
60 | 60 |
61 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ | 61 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ |
OLD | NEW |