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 // Defining IPC Messages | 5 // Defining IPC Messages |
6 // | 6 // |
7 // Your IPC messages will be defined by macros inside of an XXX_messages.h | 7 // Your IPC messages will be defined by macros inside of an XXX_messages.h |
8 // header file. Most of the time, the system can automatically generate all | 8 // header file. Most of the time, the system can automatically generate all |
9 // of messaging mechanism from these definitions, but sometimes some manual | 9 // of messaging mechanism from these definitions, but sometimes some manual |
10 // coding is required. In these cases, you will also have an XXX_messages.cc | 10 // coding is required. In these cases, you will also have an XXX_messages.cc |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 | 233 |
234 #define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ | 234 #define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ |
235 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 3, 0, (type1, type2, type3), ()) | 235 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 3, 0, (type1, type2, type3), ()) |
236 | 236 |
237 #define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ | 237 #define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ |
238 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 4, 0, (type1, type2, type3, type4) , ()) | 238 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 4, 0, (type1, type2, type3, type4) , ()) |
239 | 239 |
240 #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ | 240 #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ |
241 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) | 241 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) |
242 | 242 |
243 #define IPC_MESSAGE_CONTROL6(msg_class, type1, type2, type3, type4, type5, type6 ) \ | |
vabr (Chromium)
2014/01/13 14:46:29
What do you need this definition for?
riadh.chtara
2014/01/13 20:34:10
Done.
vabr (Chromium)
2014/01/14 14:11:02
I doubt "done" is really an answer for the questio
| |
244 IPC_MESSAGE_DECL(ASYNC, CONTROL, msg_class, 6, 0, (type1, type2, type3, type4, type5, type6), ()) | |
245 | |
243 #define IPC_MESSAGE_ROUTED0(msg_class) \ | 246 #define IPC_MESSAGE_ROUTED0(msg_class) \ |
244 IPC_MESSAGE_DECL(EMPTY, ROUTED, msg_class, 0, 0, (), ()) | 247 IPC_MESSAGE_DECL(EMPTY, ROUTED, msg_class, 0, 0, (), ()) |
245 | 248 |
246 #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ | 249 #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ |
247 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 1, 0, (type1), ()) | 250 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 1, 0, (type1), ()) |
248 | 251 |
249 #define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ | 252 #define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ |
250 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 2, 0, (type1, type2), ()) | 253 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 2, 0, (type1, type2), ()) |
251 | 254 |
252 #define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ | 255 #define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ |
253 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 3, 0, (type1, type2, type3), ()) | 256 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 3, 0, (type1, type2, type3), ()) |
254 | 257 |
255 #define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ | 258 #define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ |
256 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 4, 0, (type1, type2, type3, type4), ()) | 259 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 4, 0, (type1, type2, type3, type4), ()) |
257 | 260 |
258 #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ | 261 #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ |
259 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) | 262 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 5, 0, (type1, type2, type3, type4, type5), ()) |
260 | 263 |
264 #define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, type6) \ | |
265 IPC_MESSAGE_DECL(ASYNC, ROUTED, msg_class, 6, 0, (type1, type2, type3, type4, type5, type6), ()) | |
266 | |
261 #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ | 267 #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ |
262 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 0, (), ()) | 268 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 0, (), ()) |
263 | 269 |
264 #define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ | 270 #define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ |
265 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 1, (), (type1_out)) | 271 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 1, (), (type1_out)) |
266 | 272 |
267 #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ | 273 #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ |
268 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 2, (), (type1_out, type2_out)) | 274 IPC_MESSAGE_DECL(SYNC, CONTROL, msg_class, 0, 2, (), (type1_out, type2_out)) |
269 | 275 |
270 #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ | 276 #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 Schema::Param p; \ | 548 Schema::Param p; \ |
543 if (!Read(msg, &p)) \ | 549 if (!Read(msg, &p)) \ |
544 return false; \ | 550 return false; \ |
545 *a = p.a; \ | 551 *a = p.a; \ |
546 *b = p.b; \ | 552 *b = p.b; \ |
547 *c = p.c; \ | 553 *c = p.c; \ |
548 *d = p.d; \ | 554 *d = p.d; \ |
549 *e = p.e; \ | 555 *e = p.e; \ |
550 return true; \ | 556 return true; \ |
551 } | 557 } |
558 #define IPC_ASYNC_MESSAGE_METHODS_6 \ | |
559 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | |
560 template<class T, class S, typename TA, typename TB, typename TC, \ | |
561 typename TD, typename TE, typename TF> \ | |
562 static bool Dispatch(const Message* msg, T* obj, S* sender, \ | |
563 void (T::*func)(const Message&, TA, TB, TC, TD, TE, TF)) { \ | |
564 Schema::Param p; \ | |
565 if (Read(msg, &p)) { \ | |
566 (obj->*func)(*msg, p.a, p.b, p.c, p.d, p.e, p.f); \ | |
567 return true; \ | |
568 } \ | |
569 return false; \ | |
570 } \ | |
571 template<typename TA, typename TB, typename TC, typename TD, typename TE \ | |
vabr (Chromium)
2014/01/13 14:46:29
Are you missing a "," after TE?
riadh.chtara
2014/01/13 20:34:10
Done.
| |
572 typename TF> \ | |
573 static bool Read(const IPC::Message* msg, TA* a, TB* b, TC* c, TD* d, \ | |
574 TE* e, TF* f) { \ | |
575 Schema::Param p; \ | |
576 if (!Read(msg, &p)) \ | |
577 return false; \ | |
578 *a = p.a; \ | |
579 *b = p.b; \ | |
580 *c = p.c; \ | |
581 *d = p.d; \ | |
582 *e = p.e; \ | |
583 *f = p.f; \ | |
584 return true; \ | |
585 } | |
552 | 586 |
553 // The following macros define the common set of methods provided by SYNC | 587 // The following macros define the common set of methods provided by SYNC |
554 // message classes. | 588 // message classes. |
555 #define IPC_SYNC_MESSAGE_METHODS_GENERIC \ | 589 #define IPC_SYNC_MESSAGE_METHODS_GENERIC \ |
556 template<class T, class S, class Method> \ | 590 template<class T, class S, class Method> \ |
557 static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) { \ | 591 static bool Dispatch(const Message* msg, T* obj, S* sender, Method func) { \ |
558 Schema::SendParam send_params; \ | 592 Schema::SendParam send_params; \ |
559 bool ok = ReadSendParam(msg, &send_params); \ | 593 bool ok = ReadSendParam(msg, &send_params); \ |
560 return Schema::DispatchWithSendParams(ok, send_params, msg, obj, sender, \ | 594 return Schema::DispatchWithSendParams(ok, send_params, msg, obj, sender, \ |
561 func); \ | 595 func); \ |
(...skipping 30 matching lines...) Expand all Loading... | |
592 template<typename TA, typename TB, typename TC, typename TD> \ | 626 template<typename TA, typename TB, typename TC, typename TD> \ |
593 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) { \ | 627 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) { \ |
594 Schema::WriteReplyParams(reply, a, b, c, d); \ | 628 Schema::WriteReplyParams(reply, a, b, c, d); \ |
595 } | 629 } |
596 #define IPC_SYNC_MESSAGE_METHODS_5 \ | 630 #define IPC_SYNC_MESSAGE_METHODS_5 \ |
597 IPC_SYNC_MESSAGE_METHODS_GENERIC \ | 631 IPC_SYNC_MESSAGE_METHODS_GENERIC \ |
598 template<typename TA, typename TB, typename TC, typename TD, typename TE> \ | 632 template<typename TA, typename TB, typename TC, typename TD, typename TE> \ |
599 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { \ | 633 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { \ |
600 Schema::WriteReplyParams(reply, a, b, c, d, e); \ | 634 Schema::WriteReplyParams(reply, a, b, c, d, e); \ |
601 } | 635 } |
636 #define IPC_SYNC_MESSAGE_METHODS_6 \ | |
637 IPC_SYNC_MESSAGE_METHODS_GENERIC \ | |
638 template<typename TA, typename TB, typename TC, typename TD, typename TE, type name TF> \ | |
639 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e, TF f) { \ | |
640 Schema::WriteReplyParams(reply, a, b, c, d, e, f); \ | |
641 } | |
602 | 642 |
603 // Common message macro which dispatches into one of the 6 (sync x kind) | 643 // Common message macro which dispatches into one of the 6 (sync x kind) |
604 // routines. There is a way that these 6 cases can be lumped together, | 644 // routines. There is a way that these 6 cases can be lumped together, |
605 // but the macros get very complicated in that case. | 645 // but the macros get very complicated in that case. |
606 // Note: intended be redefined to generate other information. | 646 // Note: intended be redefined to generate other information. |
607 #define IPC_MESSAGE_DECL(sync, kind, msg_class, \ | 647 #define IPC_MESSAGE_DECL(sync, kind, msg_class, \ |
608 in_cnt, out_cnt, in_list, out_list) \ | 648 in_cnt, out_cnt, in_list, out_list) \ |
609 IPC_##sync##_##kind##_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 649 IPC_##sync##_##kind##_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
610 IPC_MESSAGE_EXTRA(sync, kind, msg_class, in_cnt, out_cnt, in_list, out_list) | 650 IPC_MESSAGE_EXTRA(sync, kind, msg_class, in_cnt, out_cnt, in_list, out_list) |
611 | 651 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
838 #endif // defined(IPC_MESSAGE_IMPL) | 878 #endif // defined(IPC_MESSAGE_IMPL) |
839 | 879 |
840 // Handle variable sized argument lists. These are usually invoked by token | 880 // Handle variable sized argument lists. These are usually invoked by token |
841 // pasting against the argument counts. | 881 // pasting against the argument counts. |
842 #define IPC_TYPE_IN_0() | 882 #define IPC_TYPE_IN_0() |
843 #define IPC_TYPE_IN_1(t1) const t1& arg1 | 883 #define IPC_TYPE_IN_1(t1) const t1& arg1 |
844 #define IPC_TYPE_IN_2(t1, t2) const t1& arg1, const t2& arg2 | 884 #define IPC_TYPE_IN_2(t1, t2) const t1& arg1, const t2& arg2 |
845 #define IPC_TYPE_IN_3(t1, t2, t3) const t1& arg1, const t2& arg2, cons t t3& arg3 | 885 #define IPC_TYPE_IN_3(t1, t2, t3) const t1& arg1, const t2& arg2, cons t t3& arg3 |
846 #define IPC_TYPE_IN_4(t1, t2, t3, t4) const t1& arg1, const t2& arg2, cons t t3& arg3, const t4& arg4 | 886 #define IPC_TYPE_IN_4(t1, t2, t3, t4) const t1& arg1, const t2& arg2, cons t t3& arg3, const t4& arg4 |
847 #define IPC_TYPE_IN_5(t1, t2, t3, t4, t5) const t1& arg1, const t2& arg2, cons t t3& arg3, const t4& arg4, const t5& arg5 | 887 #define IPC_TYPE_IN_5(t1, t2, t3, t4, t5) const t1& arg1, const t2& arg2, cons t t3& arg3, const t4& arg4, const t5& arg5 |
888 #define IPC_TYPE_IN_6(t1, t2, t3, t4, t5, t6) const t1& arg1, const t2& arg2, const t3& arg3, const t4& arg4, const t5& arg5, const t6& arg6 | |
889 | |
848 | 890 |
849 #define IPC_TYPE_OUT_0() | 891 #define IPC_TYPE_OUT_0() |
850 #define IPC_TYPE_OUT_1(t1) t1* arg6 | 892 #define IPC_TYPE_OUT_1(t1) t1* arg6 |
851 #define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7 | 893 #define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7 |
852 #define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8 | 894 #define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8 |
853 #define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* ar g9 | 895 #define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* ar g9 |
854 | 896 |
855 #define IPC_TUPLE_IN_0() Tuple0 | 897 #define IPC_TUPLE_IN_0() Tuple0 |
856 #define IPC_TUPLE_IN_1(t1) Tuple1<t1> | 898 #define IPC_TUPLE_IN_1(t1) Tuple1<t1> |
857 #define IPC_TUPLE_IN_2(t1, t2) Tuple2<t1, t2> | 899 #define IPC_TUPLE_IN_2(t1, t2) Tuple2<t1, t2> |
858 #define IPC_TUPLE_IN_3(t1, t2, t3) Tuple3<t1, t2, t3> | 900 #define IPC_TUPLE_IN_3(t1, t2, t3) Tuple3<t1, t2, t3> |
859 #define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple4<t1, t2, t3, t4> | 901 #define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple4<t1, t2, t3, t4> |
860 #define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple5<t1, t2, t3, t4, t5> | 902 #define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple5<t1, t2, t3, t4, t5> |
903 #define IPC_TUPLE_IN_6(t1, t2, t3, t4, t5, t6) Tuple6<t1, t2, t3, t4, t5, t6> | |
861 | 904 |
862 #define IPC_TUPLE_OUT_0() Tuple0 | 905 #define IPC_TUPLE_OUT_0() Tuple0 |
863 #define IPC_TUPLE_OUT_1(t1) Tuple1<t1&> | 906 #define IPC_TUPLE_OUT_1(t1) Tuple1<t1&> |
864 #define IPC_TUPLE_OUT_2(t1, t2) Tuple2<t1&, t2&> | 907 #define IPC_TUPLE_OUT_2(t1, t2) Tuple2<t1&, t2&> |
865 #define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple3<t1&, t2&, t3&> | 908 #define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple3<t1&, t2&, t3&> |
866 #define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple4<t1&, t2&, t3&, t4&> | 909 #define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple4<t1&, t2&, t3&, t4&> |
867 | 910 |
868 #define IPC_NAME_IN_0() MakeTuple() | 911 #define IPC_NAME_IN_0() MakeTuple() |
869 #define IPC_NAME_IN_1(t1) MakeRefTuple(arg1) | 912 #define IPC_NAME_IN_1(t1) MakeRefTuple(arg1) |
870 #define IPC_NAME_IN_2(t1, t2) MakeRefTuple(arg1, arg2) | 913 #define IPC_NAME_IN_2(t1, t2) MakeRefTuple(arg1, arg2) |
871 #define IPC_NAME_IN_3(t1, t2, t3) MakeRefTuple(arg1, arg2, arg3) | 914 #define IPC_NAME_IN_3(t1, t2, t3) MakeRefTuple(arg1, arg2, arg3) |
872 #define IPC_NAME_IN_4(t1, t2, t3, t4) MakeRefTuple(arg1, arg2, arg3, arg4) | 915 #define IPC_NAME_IN_4(t1, t2, t3, t4) MakeRefTuple(arg1, arg2, arg3, arg4) |
873 #define IPC_NAME_IN_5(t1, t2, t3, t4, t5) MakeRefTuple(arg1, arg2, arg3, arg4, arg5) | 916 #define IPC_NAME_IN_5(t1, t2, t3, t4, t5) MakeRefTuple(arg1, arg2, arg3, arg4, arg5) |
917 #define IPC_NAME_IN_6(t1, t2, t3, t4, t5, t6) MakeRefTuple(arg1, arg2, arg3, a rg4, arg5, arg6) | |
874 | 918 |
875 #define IPC_NAME_OUT_0() MakeTuple() | 919 #define IPC_NAME_OUT_0() MakeTuple() |
876 #define IPC_NAME_OUT_1(t1) MakeRefTuple(*arg6) | 920 #define IPC_NAME_OUT_1(t1) MakeRefTuple(*arg6) |
877 #define IPC_NAME_OUT_2(t1, t2) MakeRefTuple(*arg6, *arg7) | 921 #define IPC_NAME_OUT_2(t1, t2) MakeRefTuple(*arg6, *arg7) |
878 #define IPC_NAME_OUT_3(t1, t2, t3) MakeRefTuple(*arg6, *arg7, *arg8) | 922 #define IPC_NAME_OUT_3(t1, t2, t3) MakeRefTuple(*arg6, *arg7, *arg8) |
879 #define IPC_NAME_OUT_4(t1, t2, t3, t4) MakeRefTuple(*arg6, *arg7, *arg8, *a rg9) | 923 #define IPC_NAME_OUT_4(t1, t2, t3, t4) MakeRefTuple(*arg6, *arg7, *arg8, *a rg9) |
880 | 924 |
881 // There are places where the syntax requires a comma if there are input args, | 925 // There are places where the syntax requires a comma if there are input args, |
882 // if there are input args and output args, or if there are input args or | 926 // if there are input args and output args, or if there are input args or |
883 // output args. These macros allow generation of the comma as needed; invoke | 927 // output args. These macros allow generation of the comma as needed; invoke |
884 // by token pasting against the argument counts. | 928 // by token pasting against the argument counts. |
885 #define IPC_COMMA_0 | 929 #define IPC_COMMA_0 |
886 #define IPC_COMMA_1 , | 930 #define IPC_COMMA_1 , |
887 #define IPC_COMMA_2 , | 931 #define IPC_COMMA_2 , |
888 #define IPC_COMMA_3 , | 932 #define IPC_COMMA_3 , |
889 #define IPC_COMMA_4 , | 933 #define IPC_COMMA_4 , |
890 #define IPC_COMMA_5 , | 934 #define IPC_COMMA_5 , |
935 #define IPC_COMMA_6 , | |
891 | 936 |
892 #define IPC_COMMA_AND_0(x) | 937 #define IPC_COMMA_AND_0(x) |
893 #define IPC_COMMA_AND_1(x) x | 938 #define IPC_COMMA_AND_1(x) x |
894 #define IPC_COMMA_AND_2(x) x | 939 #define IPC_COMMA_AND_2(x) x |
895 #define IPC_COMMA_AND_3(x) x | 940 #define IPC_COMMA_AND_3(x) x |
896 #define IPC_COMMA_AND_4(x) x | 941 #define IPC_COMMA_AND_4(x) x |
897 #define IPC_COMMA_AND_5(x) x | 942 #define IPC_COMMA_AND_5(x) x |
943 #define IPC_COMMA_AND_6(x) x | |
898 | 944 |
899 #define IPC_COMMA_OR_0(x) x | 945 #define IPC_COMMA_OR_0(x) x |
900 #define IPC_COMMA_OR_1(x) , | 946 #define IPC_COMMA_OR_1(x) , |
901 #define IPC_COMMA_OR_2(x) , | 947 #define IPC_COMMA_OR_2(x) , |
902 #define IPC_COMMA_OR_3(x) , | 948 #define IPC_COMMA_OR_3(x) , |
903 #define IPC_COMMA_OR_4(x) , | 949 #define IPC_COMMA_OR_4(x) , |
904 #define IPC_COMMA_OR_5(x) , | 950 #define IPC_COMMA_OR_5(x) , |
951 #define IPC_COMMA_OR_6(x) , | |
905 | 952 |
906 // Message IDs | 953 // Message IDs |
907 // Note: we currently use __LINE__ to give unique IDs to messages within | 954 // Note: we currently use __LINE__ to give unique IDs to messages within |
908 // a file. They're globally unique since each file defines its own | 955 // a file. They're globally unique since each file defines its own |
909 // IPC_MESSAGE_START. | 956 // IPC_MESSAGE_START. |
910 #define IPC_MESSAGE_ID() ((IPC_MESSAGE_START << 16) + __LINE__) | 957 #define IPC_MESSAGE_ID() ((IPC_MESSAGE_START << 16) + __LINE__) |
911 #define IPC_MESSAGE_ID_CLASS(id) ((id) >> 16) | 958 #define IPC_MESSAGE_ID_CLASS(id) ((id) >> 16) |
912 #define IPC_MESSAGE_ID_LINE(id) ((id) & 0xffff) | 959 #define IPC_MESSAGE_ID_LINE(id) ((id) & 0xffff) |
913 | 960 |
914 // Message crackers and handlers. | 961 // Message crackers and handlers. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1014 // equivalent without the #ifdef, VS2013 contains a bug where it is | 1061 // equivalent without the #ifdef, VS2013 contains a bug where it is |
1015 // over-aggressive in optimizing out #includes. Putting the #ifdef is a | 1062 // over-aggressive in optimizing out #includes. Putting the #ifdef is a |
1016 // workaround for this bug. See http://goo.gl/eGt2Fb for more details. | 1063 // workaround for this bug. See http://goo.gl/eGt2Fb for more details. |
1017 // This can be removed once VS2013 is fixed. | 1064 // This can be removed once VS2013 is fixed. |
1018 #ifdef IPC_MESSAGE_START | 1065 #ifdef IPC_MESSAGE_START |
1019 // Clean up IPC_MESSAGE_START in this unguarded section so that the | 1066 // Clean up IPC_MESSAGE_START in this unguarded section so that the |
1020 // XXX_messages.h files need not do so themselves. This makes the | 1067 // XXX_messages.h files need not do so themselves. This makes the |
1021 // XXX_messages.h files easier to write. | 1068 // XXX_messages.h files easier to write. |
1022 #undef IPC_MESSAGE_START | 1069 #undef IPC_MESSAGE_START |
1023 #endif | 1070 #endif |
OLD | NEW |