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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 // The following macros are for for async IPCs which have a dispatcher with an | 451 // The following macros are for for async IPCs which have a dispatcher with an |
452 // extra parameter specified using IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. | 452 // extra parameter specified using IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. |
453 #define IPC_ASYNC_MESSAGE_METHODS_1 \ | 453 #define IPC_ASYNC_MESSAGE_METHODS_1 \ |
454 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 454 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
455 template<class T, class S, class P, typename TA> \ | 455 template<class T, class S, class P, typename TA> \ |
456 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 456 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
457 void (T::*func)(P*, TA)) { \ | 457 void (T::*func)(P*, TA)) { \ |
458 Schema::Param p; \ | 458 Schema::Param p; \ |
459 if (Read(msg, &p)) { \ | 459 if (Read(msg, &p)) { \ |
460 (obj->*func)(parameter, get<0>(p)); \ | 460 (obj->*func)(parameter, base::get<0>(p)); \ |
461 return true; \ | 461 return true; \ |
462 } \ | 462 } \ |
463 return false; \ | 463 return false; \ |
464 } | 464 } |
465 #define IPC_ASYNC_MESSAGE_METHODS_2 \ | 465 #define IPC_ASYNC_MESSAGE_METHODS_2 \ |
466 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 466 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
467 template<class T, class S, class P, typename TA, typename TB> \ | 467 template<class T, class S, class P, typename TA, typename TB> \ |
468 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 468 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
469 void (T::*func)(P*, TA, TB)) { \ | 469 void (T::*func)(P*, TA, TB)) { \ |
470 Schema::Param p; \ | 470 Schema::Param p; \ |
471 if (Read(msg, &p)) { \ | 471 if (Read(msg, &p)) { \ |
472 (obj->*func)(parameter, get<0>(p), get<1>(p)); \ | 472 (obj->*func)(parameter, base::get<0>(p), base::get<1>(p)); \ |
473 return true; \ | 473 return true; \ |
474 } \ | 474 } \ |
475 return false; \ | 475 return false; \ |
476 } | 476 } |
477 #define IPC_ASYNC_MESSAGE_METHODS_3 \ | 477 #define IPC_ASYNC_MESSAGE_METHODS_3 \ |
478 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 478 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
479 template<class T, class S, class P, typename TA, typename TB, typename TC> \ | 479 template<class T, class S, class P, typename TA, typename TB, typename TC> \ |
480 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 480 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
481 void (T::*func)(P*, TA, TB, TC)) { \ | 481 void (T::*func)(P*, TA, TB, TC)) { \ |
482 Schema::Param p; \ | 482 Schema::Param p; \ |
483 if (Read(msg, &p)) { \ | 483 if (Read(msg, &p)) { \ |
484 (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p)); \ | 484 (obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \ |
| 485 base::get<2>(p)); \ |
485 return true; \ | 486 return true; \ |
486 } \ | 487 } \ |
487 return false; \ | 488 return false; \ |
488 } | 489 } |
489 #define IPC_ASYNC_MESSAGE_METHODS_4 \ | 490 #define IPC_ASYNC_MESSAGE_METHODS_4 \ |
490 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 491 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
491 template<class T, class S, class P, typename TA, typename TB, typename TC, \ | 492 template<class T, class S, class P, typename TA, typename TB, typename TC, \ |
492 typename TD> \ | 493 typename TD> \ |
493 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 494 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
494 void (T::*func)(P*, TA, TB, TC, TD)) { \ | 495 void (T::*func)(P*, TA, TB, TC, TD)) { \ |
495 Schema::Param p; \ | 496 Schema::Param p; \ |
496 if (Read(msg, &p)) { \ | 497 if (Read(msg, &p)) { \ |
497 (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p)); \ | 498 (obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \ |
| 499 base::get<2>(p), base::get<3>(p)); \ |
498 return true; \ | 500 return true; \ |
499 } \ | 501 } \ |
500 return false; \ | 502 return false; \ |
501 } | 503 } |
502 #define IPC_ASYNC_MESSAGE_METHODS_5 \ | 504 #define IPC_ASYNC_MESSAGE_METHODS_5 \ |
503 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 505 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
504 template<class T, class S, class P, typename TA, typename TB, typename TC, \ | 506 template<class T, class S, class P, typename TA, typename TB, typename TC, \ |
505 typename TD, typename TE> \ | 507 typename TD, typename TE> \ |
506 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 508 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
507 void (T::*func)(P*, TA, TB, TC, TD, TE)) { \ | 509 void (T::*func)(P*, TA, TB, TC, TD, TE)) { \ |
508 Schema::Param p; \ | 510 Schema::Param p; \ |
509 if (Read(msg, &p)) { \ | 511 if (Read(msg, &p)) { \ |
510 (obj->*func)(parameter, get<0>(p), get<1>(p), get<2>(p), get<3>(p), \ | 512 (obj->*func)(parameter, base::get<0>(p), base::get<1>(p), \ |
511 get<4>(p)); \ | 513 base::get<2>(p), base::get<3>(p), base::get<4>(p)); \ |
512 return true; \ | 514 return true; \ |
513 } \ | 515 } \ |
514 return false; \ | 516 return false; \ |
515 } | 517 } |
516 | 518 |
517 // The following macros define the common set of methods provided by SYNC | 519 // The following macros define the common set of methods provided by SYNC |
518 // message classes. | 520 // message classes. |
519 #define IPC_SYNC_MESSAGE_METHODS_GENERIC \ | 521 #define IPC_SYNC_MESSAGE_METHODS_GENERIC \ |
520 template<class T, class S, class P, class Method> \ | 522 template<class T, class S, class P, class Method> \ |
521 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 523 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 typedef Schema::ReplyParam ReplyParam; \ | 631 typedef Schema::ReplyParam ReplyParam; \ |
630 typedef Schema::SendParam SendParam; \ | 632 typedef Schema::SendParam SendParam; \ |
631 enum { ID = IPC_MESSAGE_ID() }; \ | 633 enum { ID = IPC_MESSAGE_ID() }; \ |
632 msg_class(IPC_TYPE_IN_##in_cnt in_list \ | 634 msg_class(IPC_TYPE_IN_##in_cnt in_list \ |
633 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ | 635 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ |
634 IPC_TYPE_OUT_##out_cnt out_list); \ | 636 IPC_TYPE_OUT_##out_cnt out_list); \ |
635 ~msg_class() override; \ | 637 ~msg_class() override; \ |
636 static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \ | 638 static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \ |
637 static bool ReadReplyParam( \ | 639 static bool ReadReplyParam( \ |
638 const Message* msg, \ | 640 const Message* msg, \ |
639 TupleTypes<ReplyParam>::ValueTuple* p); \ | 641 base::TupleTypes<ReplyParam>::ValueTuple* p); \ |
640 static void Log(std::string* name, const Message* msg, std::string* l); \ | 642 static void Log(std::string* name, const Message* msg, std::string* l); \ |
641 IPC_SYNC_MESSAGE_METHODS_##out_cnt \ | 643 IPC_SYNC_MESSAGE_METHODS_##out_cnt \ |
642 }; | 644 }; |
643 | 645 |
644 #define IPC_SYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 646 #define IPC_SYNC_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
645 class IPC_MESSAGE_EXPORT msg_class : public IPC::SyncMessage { \ | 647 class IPC_MESSAGE_EXPORT msg_class : public IPC::SyncMessage { \ |
646 public: \ | 648 public: \ |
647 typedef IPC::SyncMessageSchema<IPC_TUPLE_IN_##in_cnt in_list, \ | 649 typedef IPC::SyncMessageSchema<IPC_TUPLE_IN_##in_cnt in_list, \ |
648 IPC_TUPLE_OUT_##out_cnt out_list> Schema; \ | 650 IPC_TUPLE_OUT_##out_cnt out_list> Schema; \ |
649 typedef Schema::ReplyParam ReplyParam; \ | 651 typedef Schema::ReplyParam ReplyParam; \ |
650 typedef Schema::SendParam SendParam; \ | 652 typedef Schema::SendParam SendParam; \ |
651 enum { ID = IPC_MESSAGE_ID() }; \ | 653 enum { ID = IPC_MESSAGE_ID() }; \ |
652 msg_class(int32 routing_id \ | 654 msg_class(int32 routing_id \ |
653 IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ | 655 IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ |
654 IPC_TYPE_IN_##in_cnt in_list \ | 656 IPC_TYPE_IN_##in_cnt in_list \ |
655 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ | 657 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ |
656 IPC_TYPE_OUT_##out_cnt out_list); \ | 658 IPC_TYPE_OUT_##out_cnt out_list); \ |
657 ~msg_class() override; \ | 659 ~msg_class() override; \ |
658 static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \ | 660 static bool ReadSendParam(const Message* msg, Schema::SendParam* p); \ |
659 static bool ReadReplyParam( \ | 661 static bool ReadReplyParam( \ |
660 const Message* msg, \ | 662 const Message* msg, \ |
661 TupleTypes<ReplyParam>::ValueTuple* p); \ | 663 base::TupleTypes<ReplyParam>::ValueTuple* p); \ |
662 static void Log(std::string* name, const Message* msg, std::string* l); \ | 664 static void Log(std::string* name, const Message* msg, std::string* l); \ |
663 IPC_SYNC_MESSAGE_METHODS_##out_cnt \ | 665 IPC_SYNC_MESSAGE_METHODS_##out_cnt \ |
664 }; | 666 }; |
665 | 667 |
666 #if defined(IPC_MESSAGE_IMPL) | 668 #if defined(IPC_MESSAGE_IMPL) |
667 | 669 |
668 // "Implementation" inclusion produces constructors, destructors, and | 670 // "Implementation" inclusion produces constructors, destructors, and |
669 // logging functions, except for the no-arg special cases, where the | 671 // logging functions, except for the no-arg special cases, where the |
670 // implementation occurs in the declaration, and there is no special | 672 // implementation occurs in the declaration, and there is no special |
671 // logging function. | 673 // logging function. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 IPC_TYPE_OUT_##out_cnt out_list) : \ | 706 IPC_TYPE_OUT_##out_cnt out_list) : \ |
705 IPC::SyncMessage(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL, \ | 707 IPC::SyncMessage(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL, \ |
706 new IPC::ParamDeserializer<Schema::ReplyParam>( \ | 708 new IPC::ParamDeserializer<Schema::ReplyParam>( \ |
707 IPC_NAME_OUT_##out_cnt out_list)) { \ | 709 IPC_NAME_OUT_##out_cnt out_list)) { \ |
708 Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \ | 710 Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \ |
709 } \ | 711 } \ |
710 msg_class::~msg_class() {} \ | 712 msg_class::~msg_class() {} \ |
711 bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \ | 713 bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \ |
712 return Schema::ReadSendParam(msg, p); \ | 714 return Schema::ReadSendParam(msg, p); \ |
713 } \ | 715 } \ |
714 bool msg_class::ReadReplyParam(const Message* msg, \ | 716 bool msg_class::ReadReplyParam( \ |
715 TupleTypes<ReplyParam>::ValueTuple* p) { \ | 717 const Message* msg, \ |
| 718 base::TupleTypes<ReplyParam>::ValueTuple* p) { \ |
716 return Schema::ReadReplyParam(msg, p); \ | 719 return Schema::ReadReplyParam(msg, p); \ |
717 } | 720 } |
718 | 721 |
719 #define IPC_SYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 722 #define IPC_SYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
720 msg_class::msg_class(int32 routing_id \ | 723 msg_class::msg_class(int32 routing_id \ |
721 IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ | 724 IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt) \ |
722 IPC_TYPE_IN_##in_cnt in_list \ | 725 IPC_TYPE_IN_##in_cnt in_list \ |
723 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ | 726 IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt) \ |
724 IPC_TYPE_OUT_##out_cnt out_list) : \ | 727 IPC_TYPE_OUT_##out_cnt out_list) : \ |
725 IPC::SyncMessage(routing_id, ID, PRIORITY_NORMAL, \ | 728 IPC::SyncMessage(routing_id, ID, PRIORITY_NORMAL, \ |
726 new IPC::ParamDeserializer<Schema::ReplyParam>( \ | 729 new IPC::ParamDeserializer<Schema::ReplyParam>( \ |
727 IPC_NAME_OUT_##out_cnt out_list)) { \ | 730 IPC_NAME_OUT_##out_cnt out_list)) { \ |
728 Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \ | 731 Schema::Write(this, IPC_NAME_IN_##in_cnt in_list); \ |
729 } \ | 732 } \ |
730 msg_class::~msg_class() {} \ | 733 msg_class::~msg_class() {} \ |
731 bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \ | 734 bool msg_class::ReadSendParam(const Message* msg, Schema::SendParam* p) { \ |
732 return Schema::ReadSendParam(msg, p); \ | 735 return Schema::ReadSendParam(msg, p); \ |
733 } \ | 736 } \ |
734 bool msg_class::ReadReplyParam(const Message* msg, \ | 737 bool msg_class::ReadReplyParam( \ |
735 TupleTypes<ReplyParam>::ValueTuple* p) { \ | 738 const Message* msg, \ |
| 739 base::TupleTypes<ReplyParam>::ValueTuple* p) { \ |
736 return Schema::ReadReplyParam(msg, p); \ | 740 return Schema::ReadReplyParam(msg, p); \ |
737 } | 741 } |
738 | 742 |
739 #define IPC_EMPTY_MESSAGE_LOG(msg_class) \ | 743 #define IPC_EMPTY_MESSAGE_LOG(msg_class) \ |
740 void msg_class::Log(std::string* name, \ | 744 void msg_class::Log(std::string* name, \ |
741 const Message* msg, \ | 745 const Message* msg, \ |
742 std::string* l) { \ | 746 std::string* l) { \ |
743 if (name) \ | 747 if (name) \ |
744 *name = #msg_class; \ | 748 *name = #msg_class; \ |
745 } | 749 } |
(...skipping 13 matching lines...) Expand all Loading... |
759 | 763 |
760 #define IPC_SYNC_MESSAGE_LOG(msg_class) \ | 764 #define IPC_SYNC_MESSAGE_LOG(msg_class) \ |
761 void msg_class::Log(std::string* name, \ | 765 void msg_class::Log(std::string* name, \ |
762 const Message* msg, \ | 766 const Message* msg, \ |
763 std::string* l) { \ | 767 std::string* l) { \ |
764 if (name) \ | 768 if (name) \ |
765 *name = #msg_class; \ | 769 *name = #msg_class; \ |
766 if (!msg || !l) \ | 770 if (!msg || !l) \ |
767 return; \ | 771 return; \ |
768 if (msg->is_sync()) { \ | 772 if (msg->is_sync()) { \ |
769 TupleTypes<Schema::SendParam>::ValueTuple p; \ | 773 base::TupleTypes<Schema::SendParam>::ValueTuple p; \ |
770 if (Schema::ReadSendParam(msg, &p)) \ | 774 if (Schema::ReadSendParam(msg, &p)) \ |
771 IPC::LogParam(p, l); \ | 775 IPC::LogParam(p, l); \ |
772 AddOutputParamsToLog(msg, l); \ | 776 AddOutputParamsToLog(msg, l); \ |
773 } else { \ | 777 } else { \ |
774 TupleTypes<Schema::ReplyParam>::ValueTuple p; \ | 778 base::TupleTypes<Schema::ReplyParam>::ValueTuple p; \ |
775 if (Schema::ReadReplyParam(msg, &p)) \ | 779 if (Schema::ReadReplyParam(msg, &p)) \ |
776 IPC::LogParam(p, l); \ | 780 IPC::LogParam(p, l); \ |
777 } \ | 781 } \ |
778 } | 782 } |
779 | 783 |
780 #elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED) | 784 #elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED) |
781 | 785 |
782 #ifndef IPC_LOG_TABLE_ADD_ENTRY | 786 #ifndef IPC_LOG_TABLE_ADD_ENTRY |
783 #error You need to define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) | 787 #error You need to define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) |
784 #endif | 788 #endif |
(...skipping 24 matching lines...) Expand all Loading... |
809 #define IPC_TYPE_IN_1(t1) const t1& arg1 | 813 #define IPC_TYPE_IN_1(t1) const t1& arg1 |
810 #define IPC_TYPE_IN_2(t1, t2) const t1& arg1, const t2& arg2 | 814 #define IPC_TYPE_IN_2(t1, t2) const t1& arg1, const t2& arg2 |
811 #define IPC_TYPE_IN_3(t1, t2, t3) const t1& arg1, const t2& arg2, cons
t t3& arg3 | 815 #define IPC_TYPE_IN_3(t1, t2, t3) const t1& arg1, const t2& arg2, cons
t t3& arg3 |
812 #define IPC_TYPE_IN_4(t1, t2, t3, t4) const t1& arg1, const t2& arg2, cons
t t3& arg3, const t4& arg4 | 816 #define IPC_TYPE_IN_4(t1, t2, t3, t4) const t1& arg1, const t2& arg2, cons
t t3& arg3, const t4& arg4 |
813 #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 | 817 #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 |
814 | 818 |
815 #define IPC_TYPE_OUT_0() | 819 #define IPC_TYPE_OUT_0() |
816 #define IPC_TYPE_OUT_1(t1) t1* arg6 | 820 #define IPC_TYPE_OUT_1(t1) t1* arg6 |
817 #define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7 | 821 #define IPC_TYPE_OUT_2(t1, t2) t1* arg6, t2* arg7 |
818 #define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8 | 822 #define IPC_TYPE_OUT_3(t1, t2, t3) t1* arg6, t2* arg7, t3* arg8 |
819 #define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, t4* ar
g9 | 823 #define IPC_TYPE_OUT_4(t1, t2, t3, t4) t1* arg6, t2* arg7, t3* arg8, \ |
| 824 t4* arg9 |
820 | 825 |
821 #define IPC_TUPLE_IN_0() Tuple<> | 826 #define IPC_TUPLE_IN_0() base::Tuple<> |
822 #define IPC_TUPLE_IN_1(t1) Tuple<t1> | 827 #define IPC_TUPLE_IN_1(t1) base::Tuple<t1> |
823 #define IPC_TUPLE_IN_2(t1, t2) Tuple<t1, t2> | 828 #define IPC_TUPLE_IN_2(t1, t2) base::Tuple<t1, t2> |
824 #define IPC_TUPLE_IN_3(t1, t2, t3) Tuple<t1, t2, t3> | 829 #define IPC_TUPLE_IN_3(t1, t2, t3) base::Tuple<t1, t2, t3> |
825 #define IPC_TUPLE_IN_4(t1, t2, t3, t4) Tuple<t1, t2, t3, t4> | 830 #define IPC_TUPLE_IN_4(t1, t2, t3, t4) base::Tuple<t1, t2, t3, t4> |
826 #define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) Tuple<t1, t2, t3, t4, t5> | 831 #define IPC_TUPLE_IN_5(t1, t2, t3, t4, t5) base::Tuple<t1, t2, t3, t4, t5> |
827 | 832 |
828 #define IPC_TUPLE_OUT_0() Tuple<> | 833 #define IPC_TUPLE_OUT_0() base::Tuple<> |
829 #define IPC_TUPLE_OUT_1(t1) Tuple<t1&> | 834 #define IPC_TUPLE_OUT_1(t1) base::Tuple<t1&> |
830 #define IPC_TUPLE_OUT_2(t1, t2) Tuple<t1&, t2&> | 835 #define IPC_TUPLE_OUT_2(t1, t2) base::Tuple<t1&, t2&> |
831 #define IPC_TUPLE_OUT_3(t1, t2, t3) Tuple<t1&, t2&, t3&> | 836 #define IPC_TUPLE_OUT_3(t1, t2, t3) base::Tuple<t1&, t2&, t3&> |
832 #define IPC_TUPLE_OUT_4(t1, t2, t3, t4) Tuple<t1&, t2&, t3&, t4&> | 837 #define IPC_TUPLE_OUT_4(t1, t2, t3, t4) base::Tuple<t1&, t2&, t3&, t4&> |
833 | 838 |
834 #define IPC_NAME_IN_0() MakeTuple() | 839 #define IPC_NAME_IN_0() base::MakeTuple() |
835 #define IPC_NAME_IN_1(t1) MakeRefTuple(arg1) | 840 #define IPC_NAME_IN_1(t1) base::MakeRefTuple(arg1) |
836 #define IPC_NAME_IN_2(t1, t2) MakeRefTuple(arg1, arg2) | 841 #define IPC_NAME_IN_2(t1, t2) base::MakeRefTuple(arg1, arg2) |
837 #define IPC_NAME_IN_3(t1, t2, t3) MakeRefTuple(arg1, arg2, arg3) | 842 #define IPC_NAME_IN_3(t1, t2, t3) base::MakeRefTuple(arg1, arg2, arg3) |
838 #define IPC_NAME_IN_4(t1, t2, t3, t4) MakeRefTuple(arg1, arg2, arg3, arg4) | 843 #define IPC_NAME_IN_4(t1, t2, t3, t4) base::MakeRefTuple(arg1, arg2, \ |
839 #define IPC_NAME_IN_5(t1, t2, t3, t4, t5) MakeRefTuple(arg1, arg2, arg3, arg4,
arg5) | 844 arg3, arg4) |
| 845 #define IPC_NAME_IN_5(t1, t2, t3, t4, t5) base::MakeRefTuple(arg1, arg2, \ |
| 846 arg3, arg4, arg5) |
840 | 847 |
841 #define IPC_NAME_OUT_0() MakeTuple() | 848 #define IPC_NAME_OUT_0() base::MakeTuple() |
842 #define IPC_NAME_OUT_1(t1) MakeRefTuple(*arg6) | 849 #define IPC_NAME_OUT_1(t1) base::MakeRefTuple(*arg6) |
843 #define IPC_NAME_OUT_2(t1, t2) MakeRefTuple(*arg6, *arg7) | 850 #define IPC_NAME_OUT_2(t1, t2) base::MakeRefTuple(*arg6, *arg7) |
844 #define IPC_NAME_OUT_3(t1, t2, t3) MakeRefTuple(*arg6, *arg7, *arg8) | 851 #define IPC_NAME_OUT_3(t1, t2, t3) base::MakeRefTuple(*arg6, *arg7, \ |
845 #define IPC_NAME_OUT_4(t1, t2, t3, t4) MakeRefTuple(*arg6, *arg7, *arg8, *a
rg9) | 852 *arg8) |
| 853 #define IPC_NAME_OUT_4(t1, t2, t3, t4) base::MakeRefTuple(*arg6, *arg7, \ |
| 854 *arg8, *arg9) |
846 | 855 |
847 // There are places where the syntax requires a comma if there are input args, | 856 // There are places where the syntax requires a comma if there are input args, |
848 // if there are input args and output args, or if there are input args or | 857 // if there are input args and output args, or if there are input args or |
849 // output args. These macros allow generation of the comma as needed; invoke | 858 // output args. These macros allow generation of the comma as needed; invoke |
850 // by token pasting against the argument counts. | 859 // by token pasting against the argument counts. |
851 #define IPC_COMMA_0 | 860 #define IPC_COMMA_0 |
852 #define IPC_COMMA_1 , | 861 #define IPC_COMMA_1 , |
853 #define IPC_COMMA_2 , | 862 #define IPC_COMMA_2 , |
854 #define IPC_COMMA_3 , | 863 #define IPC_COMMA_3 , |
855 #define IPC_COMMA_4 , | 864 #define IPC_COMMA_4 , |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 // This corresponds to an enum value from IPCMessageStart. | 973 // This corresponds to an enum value from IPCMessageStart. |
965 #define IPC_MESSAGE_CLASS(message) \ | 974 #define IPC_MESSAGE_CLASS(message) \ |
966 IPC_MESSAGE_ID_CLASS(message.type()) | 975 IPC_MESSAGE_ID_CLASS(message.type()) |
967 | 976 |
968 #endif // IPC_IPC_MESSAGE_MACROS_H_ | 977 #endif // IPC_IPC_MESSAGE_MACROS_H_ |
969 | 978 |
970 // Clean up IPC_MESSAGE_START in this unguarded section so that the | 979 // Clean up IPC_MESSAGE_START in this unguarded section so that the |
971 // XXX_messages.h files need not do so themselves. This makes the | 980 // XXX_messages.h files need not do so themselves. This makes the |
972 // XXX_messages.h files easier to write. | 981 // XXX_messages.h files easier to write. |
973 #undef IPC_MESSAGE_START | 982 #undef IPC_MESSAGE_START |
OLD | NEW |