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 SANDBOX_SRC_CROSSCALL_SERVER_H_ | 5 #ifndef SANDBOX_SRC_CROSSCALL_SERVER_H_ |
6 #define SANDBOX_SRC_CROSSCALL_SERVER_H_ | 6 #define SANDBOX_SRC_CROSSCALL_SERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Called from the IPC implementation when an IPC message is ready override | 200 // Called from the IPC implementation when an IPC message is ready override |
201 // on a derived class to handle a set of IPC messages. Return NULL if your | 201 // on a derived class to handle a set of IPC messages. Return NULL if your |
202 // subclass does not handle the message or return the pointer to the subclass | 202 // subclass does not handle the message or return the pointer to the subclass |
203 // that can handle it. | 203 // that can handle it. |
204 virtual Dispatcher* OnMessageReady(IPCParams* ipc, CallbackGeneric* callback); | 204 virtual Dispatcher* OnMessageReady(IPCParams* ipc, CallbackGeneric* callback); |
205 | 205 |
206 // Called when a target proces is created, to setup the interceptions related | 206 // Called when a target proces is created, to setup the interceptions related |
207 // with the given service (IPC). | 207 // with the given service (IPC). |
208 virtual bool SetupService(InterceptionManager* manager, int service) = 0; | 208 virtual bool SetupService(InterceptionManager* manager, int service) = 0; |
209 | 209 |
210 virtual ~Dispatcher() {} | 210 Dispatcher(); |
| 211 virtual ~Dispatcher(); |
211 | 212 |
212 protected: | 213 protected: |
213 // Structure that defines an IPC Call with all the parameters and the handler. | 214 // Structure that defines an IPC Call with all the parameters and the handler. |
214 struct IPCCall { | 215 struct IPCCall { |
215 IPCParams params; | 216 IPCParams params; |
216 CallbackGeneric callback; | 217 CallbackGeneric callback; |
217 }; | 218 }; |
218 | 219 |
219 // List of IPC Calls supported by the class. | 220 // List of IPC Calls supported by the class. |
220 std::vector<IPCCall> ipc_calls_; | 221 std::vector<IPCCall> ipc_calls_; |
221 }; | 222 }; |
222 | 223 |
223 } // namespace sandbox | 224 } // namespace sandbox |
224 | 225 |
225 #endif // SANDBOX_SRC_CROSSCALL_SERVER_H_ | 226 #endif // SANDBOX_SRC_CROSSCALL_SERVER_H_ |
OLD | NEW |