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> |
| 11 |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
15 #include "remoting/host/win/worker_process_launcher.h" | 16 #include "remoting/host/win/worker_process_launcher.h" |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class CommandLine; | 19 class CommandLine; |
19 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
20 } // namespace base | 21 } // namespace base |
21 | 22 |
22 namespace IPC { | 23 namespace IPC { |
23 class Message; | 24 class Message; |
24 } // namespace base | 25 } // namespace base |
25 | 26 |
26 namespace remoting { | 27 namespace remoting { |
27 | 28 |
28 // 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 |
29 // session. | 30 // session. |
30 class WtsSessionProcessDelegate | 31 class WtsSessionProcessDelegate |
31 : public base::NonThreadSafe, | 32 : public base::NonThreadSafe, |
32 public WorkerProcessLauncher::Delegate { | 33 public WorkerProcessLauncher::Delegate { |
33 public: | 34 public: |
34 WtsSessionProcessDelegate( | 35 WtsSessionProcessDelegate( |
35 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 36 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
36 scoped_ptr<base::CommandLine> target, | 37 std::unique_ptr<base::CommandLine> target, |
37 bool launch_elevated, | 38 bool launch_elevated, |
38 const std::string& channel_security); | 39 const std::string& channel_security); |
39 ~WtsSessionProcessDelegate() override; | 40 ~WtsSessionProcessDelegate() override; |
40 | 41 |
41 // Initializes the object returning true on success. | 42 // Initializes the object returning true on success. |
42 bool Initialize(uint32_t session_id); | 43 bool Initialize(uint32_t session_id); |
43 | 44 |
44 // WorkerProcessLauncher::Delegate implementation. | 45 // WorkerProcessLauncher::Delegate implementation. |
45 void LaunchProcess(WorkerProcessLauncher* event_handler) override; | 46 void LaunchProcess(WorkerProcessLauncher* event_handler) override; |
46 void Send(IPC::Message* message) override; | 47 void Send(IPC::Message* message) override; |
47 void CloseChannel() override; | 48 void CloseChannel() override; |
48 void KillProcess() override; | 49 void KillProcess() override; |
49 | 50 |
50 private: | 51 private: |
51 // The actual implementation resides in WtsSessionProcessDelegate::Core class. | 52 // The actual implementation resides in WtsSessionProcessDelegate::Core class. |
52 class Core; | 53 class Core; |
53 scoped_refptr<Core> core_; | 54 scoped_refptr<Core> core_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); |
56 }; | 57 }; |
57 | 58 |
58 } // namespace remoting | 59 } // namespace remoting |
59 | 60 |
60 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ | 61 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ |
OLD | NEW |