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_WORKER_PROCESS_LAUNCHER_H_ | 5 #ifndef REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
6 #define REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ | 6 #define REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Starts the worker process and passes |channel_name| to it. | 46 // Starts the worker process and passes |channel_name| to it. |
47 // |process_exit_event_out| receives a handle that becomes signalled once | 47 // |process_exit_event_out| receives a handle that becomes signalled once |
48 // the launched process has been terminated. | 48 // the launched process has been terminated. |
49 virtual bool DoLaunchProcess( | 49 virtual bool DoLaunchProcess( |
50 const std::string& channel_name, | 50 const std::string& channel_name, |
51 base::win::ScopedHandle* process_exit_event_out) = 0; | 51 base::win::ScopedHandle* process_exit_event_out) = 0; |
52 | 52 |
53 // Terminates the worker process with the given exit code. | 53 // Terminates the worker process with the given exit code. |
54 virtual void DoKillProcess(DWORD exit_code) = 0; | 54 virtual void DoKillProcess(DWORD exit_code) = 0; |
55 | 55 |
56 // Notifies that a client has been connected to the channel. |peer_pid| | 56 // Notifies that a client has been connected to the channel. |
57 // is the peer process's ID that the delegate can use to verify identity of | 57 virtual void OnChannelConnected() = 0; |
58 // the client. The verification code has to make sure that the client | |
59 // process's PID will not be assigned to another process (for instance by | |
60 // keeping an opened handle of the client process). | |
61 virtual void OnChannelConnected(DWORD peer_pid) = 0; | |
62 | 58 |
63 // Processes messages sent by the client. | 59 // Processes messages sent by the client. |
64 virtual bool OnMessageReceived(const IPC::Message& message) = 0; | 60 virtual bool OnMessageReceived(const IPC::Message& message) = 0; |
65 }; | 61 }; |
66 | 62 |
67 // Creates the launcher. | 63 // Creates the launcher. |
68 // |delegate| will be able to receive messages sent over the channel once | 64 // |delegate| will be able to receive messages sent over the channel once |
69 // the worker has been started and until it is stopped by Stop() or an error | 65 // the worker has been started and until it is stopped by Stop() or an error |
70 // occurs. | 66 // occurs. |
71 // | 67 // |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 124 |
129 // The server end of the pipe. | 125 // The server end of the pipe. |
130 base::win::ScopedHandle pipe_; | 126 base::win::ScopedHandle pipe_; |
131 | 127 |
132 DISALLOW_COPY_AND_ASSIGN(WorkerProcessLauncher); | 128 DISALLOW_COPY_AND_ASSIGN(WorkerProcessLauncher); |
133 }; | 129 }; |
134 | 130 |
135 } // namespace remoting | 131 } // namespace remoting |
136 | 132 |
137 #endif // REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ | 133 #endif // REMOTING_HOST_WIN_WORKER_PROCESS_LAUNCHER_H_ |
OLD | NEW |