| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/threading/non_thread_safe.h" |
| 12 #include "remoting/host/win/worker_process_launcher.h" | 13 #include "remoting/host/win/worker_process_launcher.h" |
| 13 | 14 |
| 14 class CommandLine; | 15 class CommandLine; |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class FilePath; | |
| 18 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
| 19 } // namespace base | 19 } // namespace base |
| 20 | 20 |
| 21 namespace IPC { | 21 namespace IPC { |
| 22 class Listener; | |
| 23 class Message; | 22 class Message; |
| 24 } // namespace base | 23 } // namespace base |
| 25 | 24 |
| 26 namespace remoting { | 25 namespace remoting { |
| 27 | 26 |
| 28 // Implements logic for launching and monitoring a worker process in a different | 27 // Implements logic for launching and monitoring a worker process in a different |
| 29 // session. | 28 // session. |
| 30 class WtsSessionProcessDelegate | 29 class WtsSessionProcessDelegate |
| 31 : public WorkerProcessLauncher::Delegate { | 30 : public base::NonThreadSafe, |
| 31 public WorkerProcessLauncher::Delegate { |
| 32 public: | 32 public: |
| 33 WtsSessionProcessDelegate( | 33 WtsSessionProcessDelegate( |
| 34 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | |
| 35 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 34 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 36 scoped_ptr<CommandLine> target, | 35 scoped_ptr<CommandLine> target, |
| 37 uint32 session_id, | |
| 38 bool launch_elevated, | 36 bool launch_elevated, |
| 39 const std::string& channel_security); | 37 const std::string& channel_security); |
| 40 ~WtsSessionProcessDelegate(); | 38 ~WtsSessionProcessDelegate(); |
| 41 | 39 |
| 42 // IPC::Sender implementation. | 40 // Initializes the object returning true on success. |
| 43 virtual bool Send(IPC::Message* message) OVERRIDE; | 41 bool Initialize(uint32 session_id); |
| 44 | 42 |
| 45 // WorkerProcessLauncher::Delegate implementation. | 43 // WorkerProcessLauncher::Delegate implementation. |
| 44 virtual void LaunchProcess(WorkerProcessLauncher* event_handler) OVERRIDE; |
| 45 virtual void Send(IPC::Message* message) OVERRIDE; |
| 46 virtual void CloseChannel() OVERRIDE; | 46 virtual void CloseChannel() OVERRIDE; |
| 47 virtual DWORD GetProcessId() const OVERRIDE; | 47 virtual void KillProcess() OVERRIDE; |
| 48 virtual bool IsPermanentError(int failure_count) const OVERRIDE; | |
| 49 virtual void KillProcess(DWORD exit_code) OVERRIDE; | |
| 50 virtual bool LaunchProcess( | |
| 51 IPC::Listener* delegate, | |
| 52 base::win::ScopedHandle* process_exit_event_out) OVERRIDE; | |
| 53 | 48 |
| 54 private: | 49 private: |
| 55 // The actual implementation resides in WtsSessionProcessDelegate::Core class. | 50 // The actual implementation resides in WtsSessionProcessDelegate::Core class. |
| 56 class Core; | 51 class Core; |
| 57 scoped_refptr<Core> core_; | 52 scoped_refptr<Core> core_; |
| 58 | 53 |
| 59 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(WtsSessionProcessDelegate); |
| 60 }; | 55 }; |
| 61 | 56 |
| 62 } // namespace remoting | 57 } // namespace remoting |
| 63 | 58 |
| 64 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ | 59 #endif // REMOTING_HOST_WIN_WTS_SESSION_PROCESS_DELEGATE_H_ |
| OLD | NEW |