OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // The file ipc_messsage_macros.h defines the classes for individual | |
6 // messages. This file works similarly, except that it defines the | |
7 // implementations of the constructors and the logging methods. (These only | |
8 // have to be generated once). It is meant to be included in a XXX_messages.cc | |
9 // file. | |
10 | |
11 #ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_ | |
12 #define IPC_IPC_MESSAGE_IMPL_MACROS_H_ | |
13 | |
14 #include "ipc/ipc_message_utils.h" | |
15 #include "ipc/ipc_message_utils_impl.h" | |
16 | |
17 #ifndef MESSAGES_INTERNAL_IMPL_FILE | |
18 #error This file should only be included by X_messages.cc, which needs to define
MESSAGES_INTERNAL_IMPL_FILE first. | |
19 #endif | |
20 | |
21 // Trick scons and xcode into seeing the possible real dependencies since they | |
22 // don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 | |
23 #if 0 | |
24 #include "ipc/ipc_sync_message_unittest.h" | |
25 #include "chrome/common/plugin_messages_internal.h" | |
26 #include "chrome/common/render_messages_internal.h" | |
27 #include "chrome/common/devtools_messages_internal.h" | |
28 #include "chrome/test/automation/automation_messages_internal.h" | |
29 #include "chrome/common/worker_messages_internal.h" | |
30 #endif | |
31 | |
32 // These are probalby still defined because of ipc_message_macros.h should be | |
33 // included before us for the class/method declarations. | |
34 #undef IPC_BEGIN_MESSAGES | |
35 #undef IPC_END_MESSAGES | |
36 #undef IPC_MESSAGE_CONTROL0 | |
37 #undef IPC_MESSAGE_CONTROL1 | |
38 #undef IPC_MESSAGE_CONTROL2 | |
39 #undef IPC_MESSAGE_CONTROL3 | |
40 #undef IPC_MESSAGE_CONTROL4 | |
41 #undef IPC_MESSAGE_CONTROL5 | |
42 #undef IPC_MESSAGE_ROUTED0 | |
43 #undef IPC_MESSAGE_ROUTED1 | |
44 #undef IPC_MESSAGE_ROUTED2 | |
45 #undef IPC_MESSAGE_ROUTED3 | |
46 #undef IPC_MESSAGE_ROUTED4 | |
47 #undef IPC_MESSAGE_ROUTED5 | |
48 #undef IPC_SYNC_MESSAGE_CONTROL0_0 | |
49 #undef IPC_SYNC_MESSAGE_CONTROL0_1 | |
50 #undef IPC_SYNC_MESSAGE_CONTROL0_2 | |
51 #undef IPC_SYNC_MESSAGE_CONTROL0_3 | |
52 #undef IPC_SYNC_MESSAGE_CONTROL1_0 | |
53 #undef IPC_SYNC_MESSAGE_CONTROL1_1 | |
54 #undef IPC_SYNC_MESSAGE_CONTROL1_2 | |
55 #undef IPC_SYNC_MESSAGE_CONTROL1_3 | |
56 #undef IPC_SYNC_MESSAGE_CONTROL2_0 | |
57 #undef IPC_SYNC_MESSAGE_CONTROL2_1 | |
58 #undef IPC_SYNC_MESSAGE_CONTROL2_2 | |
59 #undef IPC_SYNC_MESSAGE_CONTROL2_3 | |
60 #undef IPC_SYNC_MESSAGE_CONTROL3_1 | |
61 #undef IPC_SYNC_MESSAGE_CONTROL3_2 | |
62 #undef IPC_SYNC_MESSAGE_CONTROL3_3 | |
63 #undef IPC_SYNC_MESSAGE_CONTROL4_1 | |
64 #undef IPC_SYNC_MESSAGE_CONTROL4_2 | |
65 #undef IPC_SYNC_MESSAGE_ROUTED0_0 | |
66 #undef IPC_SYNC_MESSAGE_ROUTED0_1 | |
67 #undef IPC_SYNC_MESSAGE_ROUTED0_2 | |
68 #undef IPC_SYNC_MESSAGE_ROUTED0_3 | |
69 #undef IPC_SYNC_MESSAGE_ROUTED1_0 | |
70 #undef IPC_SYNC_MESSAGE_ROUTED1_1 | |
71 #undef IPC_SYNC_MESSAGE_ROUTED1_2 | |
72 #undef IPC_SYNC_MESSAGE_ROUTED1_3 | |
73 #undef IPC_SYNC_MESSAGE_ROUTED1_4 | |
74 #undef IPC_SYNC_MESSAGE_ROUTED2_0 | |
75 #undef IPC_SYNC_MESSAGE_ROUTED2_1 | |
76 #undef IPC_SYNC_MESSAGE_ROUTED2_2 | |
77 #undef IPC_SYNC_MESSAGE_ROUTED2_3 | |
78 #undef IPC_SYNC_MESSAGE_ROUTED3_0 | |
79 #undef IPC_SYNC_MESSAGE_ROUTED3_1 | |
80 #undef IPC_SYNC_MESSAGE_ROUTED3_2 | |
81 #undef IPC_SYNC_MESSAGE_ROUTED3_3 | |
82 #undef IPC_SYNC_MESSAGE_ROUTED4_0 | |
83 #undef IPC_SYNC_MESSAGE_ROUTED4_1 | |
84 #undef IPC_SYNC_MESSAGE_ROUTED4_2 | |
85 #undef IPC_SYNC_MESSAGE_ROUTED4_3 | |
86 #undef IPC_SYNC_MESSAGE_ROUTED5_0 | |
87 #undef IPC_SYNC_MESSAGE_ROUTED5_1 | |
88 #undef IPC_SYNC_MESSAGE_ROUTED5_2 | |
89 #undef IPC_SYNC_MESSAGE_ROUTED5_3 | |
90 | |
91 // These don't do anything during this pass. | |
92 #define IPC_BEGIN_MESSAGES(label) | |
93 #define IPC_END_MESSAGES(label) | |
94 | |
95 // Every class must include a destructor and a log method that is keyed to the | |
96 // specific types. | |
97 #define IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ | |
98 msg_class::~msg_class() {} \ | |
99 \ | |
100 void msg_class::Log(const Message* msg, std::wstring* l) { \ | |
101 Param p; \ | |
102 if (Read(msg, &p)) \ | |
103 IPC::LogParam(p, l); \ | |
104 } | |
105 | |
106 // This derives from IPC::Message and thus doesn't need us to keep the | |
107 // implementations in this impl file. | |
108 #define IPC_MESSAGE_CONTROL0(msg_class) | |
109 | |
110 #define IPC_MESSAGE_CONTROL1(msg_class, type1) \ | |
111 msg_class::msg_class(const type1& arg1) \ | |
112 : IPC::MessageWithTuple< Tuple1<type1> >( \ | |
113 MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {} \ | |
114 \ | |
115 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
116 | |
117 #define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ | |
118 msg_class::msg_class(const type1& arg1, const type2& arg2) \ | |
119 : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ | |
120 MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {} \ | |
121 \ | |
122 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
123 | |
124 #define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ | |
125 msg_class::msg_class(const type1& arg1, const type2& arg2, \ | |
126 const type3& arg3) \ | |
127 : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ | |
128 MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ | |
129 \ | |
130 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
131 | |
132 #define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ | |
133 msg_class::msg_class(const type1& arg1, const type2& arg2, \ | |
134 const type3& arg3, const type4& arg4) \ | |
135 : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ | |
136 MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ | |
137 \ | |
138 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
139 | |
140 #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ | |
141 msg_class::msg_class(const type1& arg1, const type2& arg2, \ | |
142 const type3& arg3, const type4& arg4, \ | |
143 const type5& arg5) \ | |
144 : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ | |
145 MSG_ROUTING_CONTROL, ID, \ | |
146 MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ | |
147 \ | |
148 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
149 | |
150 // This derives from IPC::Message and thus doesn't need us to keep the | |
151 // implementations in this impl file. | |
152 #define IPC_MESSAGE_ROUTED0(msg_class) | |
153 | |
154 #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ | |
155 msg_class::msg_class(int32 routing_id, const type1& arg1) \ | |
156 : IPC::MessageWithTuple< Tuple1<type1> >( \ | |
157 routing_id, ID, MakeRefTuple(arg1)) {} \ | |
158 \ | |
159 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
160 | |
161 #define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ | |
162 msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \ | |
163 : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ | |
164 routing_id, ID, MakeRefTuple(arg1, arg2)) {} \ | |
165 \ | |
166 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
167 | |
168 | |
169 #define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ | |
170 msg_class::msg_class(int32 routing_id, const type1& arg1, \ | |
171 const type2& arg2, const type3& arg3) \ | |
172 : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ | |
173 routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ | |
174 \ | |
175 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
176 | |
177 #define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ | |
178 msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ | |
179 const type3& arg3, const type4& arg4) \ | |
180 : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ | |
181 routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ | |
182 \ | |
183 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
184 | |
185 #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ | |
186 msg_class::msg_class(int32 routing_id, const type1& arg1, \ | |
187 const type2& arg2, const type3& arg3, \ | |
188 const type4& arg4, const type5& arg5) \ | |
189 : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ | |
190 routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ | |
191 \ | |
192 IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
193 | |
194 // ----------------------------------------------------------------------------- | |
195 | |
196 // Every class must include a destructor and a log method that is keyed to the | |
197 // specific types. | |
198 #define IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ | |
199 msg_class::~msg_class() {} \ | |
200 \ | |
201 void msg_class::Log(const Message* msg, std::wstring* l) { \ | |
202 if (msg->is_sync()) { \ | |
203 TupleTypes<SendParam>::ValueTuple p; \ | |
204 if (ReadSendParam(msg, &p)) \ | |
205 IPC::LogParam(p, l); \ | |
206 \ | |
207 AddOutputParamsToLog(msg, l); \ | |
208 } else { \ | |
209 TupleTypes<ReplyParam>::ValueTuple p; \ | |
210 if (ReadReplyParam(msg, &p)) \ | |
211 IPC::LogParam(p, l); \ | |
212 } \ | |
213 } | |
214 | |
215 #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ | |
216 msg_class::msg_class() \ | |
217 : IPC::MessageWithReply<Tuple0, Tuple0 >( \ | |
218 MSG_ROUTING_CONTROL, ID, \ | |
219 MakeTuple(), MakeTuple()) {} \ | |
220 \ | |
221 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
222 | |
223 #define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ | |
224 msg_class::msg_class(type1_out* arg1) \ | |
225 : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ | |
226 MSG_ROUTING_CONTROL, ID, \ | |
227 MakeTuple(), MakeRefTuple(*arg1)) {} \ | |
228 \ | |
229 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
230 | |
231 #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ | |
232 msg_class::msg_class(type1_out* arg1, type2_out* arg2) \ | |
233 : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ | |
234 MSG_ROUTING_CONTROL, ID, \ | |
235 MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ | |
236 \ | |
237 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
238 | |
239 #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, \ | |
240 type3_out) \ | |
241 msg_class::msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \ | |
242 : IPC::MessageWithReply<Tuple0, Tuple3<type1_out&, type2_out&, \ | |
243 type3_out&> >( \ | |
244 MSG_ROUTING_CONTROL, ID, \ | |
245 MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ | |
246 \ | |
247 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
248 | |
249 | |
250 #define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ | |
251 msg_class::msg_class(const type1_in& arg1) \ | |
252 : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ | |
253 MSG_ROUTING_CONTROL, ID, \ | |
254 MakeRefTuple(arg1), MakeTuple()) {} \ | |
255 \ | |
256 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
257 | |
258 #define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ | |
259 msg_class::msg_class(const type1_in& arg1, type1_out* arg2) \ | |
260 : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ | |
261 MSG_ROUTING_CONTROL, ID, \ | |
262 MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ | |
263 \ | |
264 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
265 | |
266 #define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ | |
267 msg_class::msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ | |
268 : IPC::MessageWithReply<Tuple1<type1_in>, \ | |
269 Tuple2<type1_out&, type2_out&> >( \ | |
270 MSG_ROUTING_CONTROL, ID, \ | |
271 MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ | |
272 \ | |
273 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
274 | |
275 #define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, \ | |
276 type2_out, type3_out) \ | |
277 msg_class::msg_class(const type1_in& arg1, type1_out* arg2, \ | |
278 type2_out* arg3, type3_out* arg4) \ | |
279 : IPC::MessageWithReply<Tuple1<type1_in>, \ | |
280 Tuple3<type1_out&, type2_out&, type3_out&> >( \ | |
281 MSG_ROUTING_CONTROL, ID, \ | |
282 MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ | |
283 \ | |
284 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
285 | |
286 #define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ | |
287 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2) \ | |
288 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ | |
289 MSG_ROUTING_CONTROL, ID, \ | |
290 MakeRefTuple(arg1, arg2), MakeTuple()) {} \ | |
291 \ | |
292 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
293 | |
294 #define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ | |
295 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
296 type1_out* arg3) \ | |
297 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
298 Tuple1<type1_out&> >( \ | |
299 MSG_ROUTING_CONTROL, ID, \ | |
300 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ | |
301 \ | |
302 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
303 | |
304 | |
305 #define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, \ | |
306 type1_out, type2_out) \ | |
307 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
308 type1_out* arg3, type2_out* arg4) \ | |
309 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
310 Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ | |
311 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ | |
312 \ | |
313 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
314 | |
315 | |
316 #define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, \ | |
317 type1_out, type2_out, type3_out) \ | |
318 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
319 type1_out* arg3, type2_out* arg4, type3_out* arg5) \ | |
320 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
321 Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ | |
322 ID, \ | |
323 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ | |
324 \ | |
325 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
326 | |
327 | |
328 #define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, \ | |
329 type3_in, type1_out) \ | |
330 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
331 const type3_in& arg3, type1_out* arg4) \ | |
332 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
333 Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ | |
334 MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ | |
335 \ | |
336 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
337 | |
338 #define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, \ | |
339 type3_in, type1_out, type2_out) \ | |
340 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
341 const type3_in& arg3, type1_out* arg4, type2_out* arg5) \ | |
342 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
343 Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ | |
344 MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ | |
345 \ | |
346 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
347 | |
348 | |
349 #define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, \ | |
350 type3_in, type1_out, type2_out, \ | |
351 type3_out) \ | |
352 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
353 const type3_in& arg3, type1_out* arg4, \ | |
354 type2_out* arg5, type3_out* arg6) \ | |
355 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
356 Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ | |
357 ID, \ | |
358 MakeRefTuple(arg1, arg2, arg3), \ | |
359 MakeRefTuple(*arg4, *arg5, *arg6)) {} \ | |
360 \ | |
361 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
362 | |
363 #define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, \ | |
364 type3_in, type4_in, type1_out) \ | |
365 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
366 const type3_in& arg3, const type4_in& arg4, \ | |
367 type1_out* arg6) \ | |
368 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ | |
369 Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ | |
370 MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ | |
371 \ | |
372 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
373 | |
374 | |
375 #define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, \ | |
376 type3_in, type4_in, type1_out, \ | |
377 type2_out) \ | |
378 msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ | |
379 const type3_in& arg3, const type4_in& arg4, \ | |
380 type1_out* arg5, type2_out* arg6) \ | |
381 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \ | |
382 type4_in>, \ | |
383 Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ | |
384 MakeRefTuple(arg1, arg2, arg3, arg4), \ | |
385 MakeRefTuple(*arg5, *arg6)) {} \ | |
386 \ | |
387 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
388 | |
389 #define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ | |
390 msg_class::msg_class(int routing_id) \ | |
391 : IPC::MessageWithReply<Tuple0, Tuple0>( \ | |
392 routing_id, ID, \ | |
393 MakeTuple(), MakeTuple()) {} \ | |
394 \ | |
395 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
396 | |
397 #define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ | |
398 msg_class::msg_class(int routing_id, type1_out* arg1) \ | |
399 : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ | |
400 routing_id, ID, \ | |
401 MakeTuple(), MakeRefTuple(*arg1)) {} \ | |
402 \ | |
403 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
404 | |
405 #define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ | |
406 msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \ | |
407 : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ | |
408 routing_id, ID, \ | |
409 MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ | |
410 \ | |
411 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
412 | |
413 #define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, \ | |
414 type3_out) \ | |
415 msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2, \ | |
416 type3_out* arg3) \ | |
417 : IPC::MessageWithReply<Tuple0, \ | |
418 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
419 MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ | |
420 \ | |
421 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
422 | |
423 #define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ | |
424 msg_class::msg_class(int routing_id, const type1_in& arg1) \ | |
425 : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ | |
426 routing_id, ID, \ | |
427 MakeRefTuple(arg1), MakeTuple()) {} \ | |
428 \ | |
429 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
430 | |
431 #define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ | |
432 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
433 type1_out* arg2) \ | |
434 : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ | |
435 routing_id, ID, \ | |
436 MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ | |
437 \ | |
438 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
439 | |
440 #define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, \ | |
441 type2_out) \ | |
442 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
443 type1_out* arg2, type2_out* arg3) \ | |
444 : IPC::MessageWithReply<Tuple1<type1_in>, \ | |
445 Tuple2<type1_out&, type2_out&> >( \ | |
446 routing_id, ID, \ | |
447 MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ | |
448 \ | |
449 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
450 | |
451 #define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, \ | |
452 type2_out, type3_out) \ | |
453 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
454 type1_out* arg2, type2_out* arg3, type3_out* arg4) \ | |
455 : IPC::MessageWithReply<Tuple1<type1_in>, \ | |
456 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
457 MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ | |
458 \ | |
459 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
460 | |
461 #define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, \ | |
462 type2_out, type3_out, type4_out) \ | |
463 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
464 type1_out* arg2, type2_out* arg3, \ | |
465 type3_out* arg4, type4_out* arg5) \ | |
466 : IPC::MessageWithReply<Tuple1<type1_in>, \ | |
467 Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >( \ | |
468 routing_id, ID, MakeRefTuple(arg1), \ | |
469 MakeRefTuple(*arg2, *arg3, *arg4, *arg5)) {} \ | |
470 \ | |
471 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
472 | |
473 #define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ | |
474 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
475 const type2_in& arg2) \ | |
476 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ | |
477 routing_id, ID, MakeRefTuple(arg1, arg2), MakeTuple()) {} \ | |
478 \ | |
479 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
480 | |
481 #define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, \ | |
482 type1_out) \ | |
483 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
484 const type2_in& arg2, type1_out* arg3) \ | |
485 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
486 Tuple1<type1_out&> >(routing_id, ID, \ | |
487 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ | |
488 \ | |
489 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
490 | |
491 #define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, \ | |
492 type1_out, type2_out) \ | |
493 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
494 const type2_in& arg2, type1_out* arg3, \ | |
495 type2_out* arg4) \ | |
496 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
497 Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ | |
498 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ | |
499 \ | |
500 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
501 | |
502 #define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, \ | |
503 type1_out, type2_out, type3_out) \ | |
504 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
505 const type2_in& arg2, type1_out* arg3, \ | |
506 type2_out* arg4, type3_out* arg5) \ | |
507 : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ | |
508 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
509 MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ | |
510 \ | |
511 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
512 | |
513 #define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, \ | |
514 type3_in) \ | |
515 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
516 const type2_in& arg2, const type3_in& arg3) \ | |
517 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0>( \ | |
518 routing_id, ID, \ | |
519 MakeRefTuple(arg1, arg2, arg3), MakeTuple()) {} \ | |
520 \ | |
521 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
522 | |
523 #define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, \ | |
524 type3_in, type1_out) \ | |
525 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
526 const type2_in& arg2, const type3_in& arg3, \ | |
527 type1_out* arg4) \ | |
528 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
529 Tuple1<type1_out&> >(routing_id, ID, \ | |
530 MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ | |
531 \ | |
532 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
533 | |
534 #define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, \ | |
535 type3_in, type1_out, type2_out) \ | |
536 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
537 const type2_in& arg2, const type3_in& arg3, \ | |
538 type1_out* arg4, type2_out* arg5) \ | |
539 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
540 Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ | |
541 MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ | |
542 \ | |
543 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
544 | |
545 #define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, \ | |
546 type3_in, type1_out, type2_out, \ | |
547 type3_out) \ | |
548 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
549 const type2_in& arg2, const type3_in& arg3, \ | |
550 type1_out* arg4, type2_out* arg5, type3_out* arg6) \ | |
551 : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ | |
552 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
553 MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, \ | |
554 *arg6)) {} \ | |
555 \ | |
556 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
557 | |
558 #define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, \ | |
559 type3_in, type4_in) \ | |
560 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
561 const type2_in& arg2, const type3_in& arg3, \ | |
562 const type4_in& arg4) \ | |
563 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \ | |
564 type4_in>, Tuple0 >(routing_id, ID, \ | |
565 MakeRefTuple(arg1, arg2, arg3, arg4), MakeTuple()) {} \ | |
566 \ | |
567 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
568 | |
569 #define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, \ | |
570 type3_in, type4_in, type1_out) \ | |
571 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
572 const type2_in& arg2, const type3_in& arg3, \ | |
573 const type4_in& arg4, type1_out* arg6) \ | |
574 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>,
\ | |
575 Tuple1<type1_out&> >(routing_id, ID, \ | |
576 MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ | |
577 \ | |
578 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
579 | |
580 | |
581 #define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, \ | |
582 type3_in, type4_in, type1_out, \ | |
583 type2_out) \ | |
584 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
585 const type2_in& arg2, const type3_in& arg3, \ | |
586 const type4_in& arg4, type1_out* arg5, type2_out* arg6) \ | |
587 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ | |
588 Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ | |
589 MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \ | |
590 \ | |
591 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
592 | |
593 | |
594 #define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, \ | |
595 type3_in, type4_in, type1_out, \ | |
596 type2_out, type3_out) \ | |
597 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
598 const type2_in& arg2, const type3_in& arg3, \ | |
599 const type4_in& arg4, type1_out* arg5, \ | |
600 type2_out* arg6, type3_out* arg7) \ | |
601 : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ | |
602 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
603 MakeRefTuple(arg1, arg2, arg3, arg4), \ | |
604 MakeRefTuple(*arg5, *arg6, *arg7)) {} \ | |
605 \ | |
606 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
607 | |
608 #define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, \ | |
609 type3_in, type4_in, type5_in) \ | |
610 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
611 const type2_in& arg2, const type3_in& arg3, \ | |
612 const type4_in& arg4, const type5_in& arg5) \ | |
613 : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ | |
614 type4_in, type5_in>, Tuple0 >(routing_id, ID, \ | |
615 MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeTuple()) {} \ | |
616 \ | |
617 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
618 | |
619 #define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, \ | |
620 type3_in, type4_in, type5_in, type1_out) \ | |
621 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
622 const type2_in& arg2, const type3_in& arg3, \ | |
623 const type4_in& arg4, const type5_in& arg5, \ | |
624 type1_out* arg6) \ | |
625 : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ | |
626 type4_in, type5_in>, Tuple1<type1_out&> >(routing_id, ID, \ | |
627 MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ | |
628 MakeRefTuple(*arg6)) {} \ | |
629 \ | |
630 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
631 | |
632 #define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, \ | |
633 type3_in, type4_in, type5_in, \ | |
634 type1_out, type2_out) \ | |
635 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
636 const type2_in& arg2, const type3_in& arg3, \ | |
637 const type4_in& arg4, const type4_in& arg5, \ | |
638 type1_out* arg6, type2_out* arg7) \ | |
639 : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ | |
640 type4_in, type5_in>, Tuple2<type1_out&, type2_out&> >( \ | |
641 routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ | |
642 MakeRefTuple(*arg6, *arg7)) {} \ | |
643 \ | |
644 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
645 | |
646 #define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, \ | |
647 type3_in, type4_in, type5_in, \ | |
648 type1_out, type2_out, type3_out) \ | |
649 msg_class::msg_class(int routing_id, const type1_in& arg1, \ | |
650 const type2_in& arg2, const type3_in& arg3, \ | |
651 const type4_in& arg4, const type4_in& arg5, \ | |
652 type1_out* arg6, type2_out* arg7, \ | |
653 type3_out* arg8) \ | |
654 : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ | |
655 type4_in, type5_in>, \ | |
656 Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ | |
657 MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ | |
658 MakeRefTuple(*arg6, *arg7, *arg8)) {} \ | |
659 \ | |
660 IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) | |
661 | |
662 // Trigger the header guard define in ipc_message_macros.h so we don't get | |
663 // duplicate including when we include MESSAGES_INTERNAL_FILE again at the end | |
664 // of this file. | |
665 #define IPC_MESSAGE_MACROS_INCLUDE_BLOCK | |
666 | |
667 // Redefine MESSAGES_INTERNAL_FILE just for the header check in | |
668 // ipc_messages_macros.h that happens before it breaks on the header guard. | |
669 #define MESSAGES_INTERNAL_FILE MESSAGES_INTERNAL_IMPL_FILE | |
670 | |
671 // Include our INTERNAL file first to get the normal expansion. | |
672 #include MESSAGES_INTERNAL_IMPL_FILE | |
673 | |
674 #endif // IPC_IPC_MESSAGE_IMPL_MACROS_H_ | |
OLD | NEW |