| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // Common message macro which dispatches into one of the 6 (sync x kind) | 588 // Common message macro which dispatches into one of the 6 (sync x kind) |
| 589 // routines. There is a way that these 6 cases can be lumped together, | 589 // routines. There is a way that these 6 cases can be lumped together, |
| 590 // but the macros get very complicated in that case. | 590 // but the macros get very complicated in that case. |
| 591 // Note: intended be redefined to generate other information. | 591 // Note: intended be redefined to generate other information. |
| 592 #define IPC_MESSAGE_DECL(sync, kind, msg_class, \ | 592 #define IPC_MESSAGE_DECL(sync, kind, msg_class, \ |
| 593 in_cnt, out_cnt, in_list, out_list) \ | 593 in_cnt, out_cnt, in_list, out_list) \ |
| 594 IPC_##sync##_##kind##_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 594 IPC_##sync##_##kind##_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
| 595 IPC_MESSAGE_EXTRA(sync, kind, msg_class, in_cnt, out_cnt, in_list, out_list) | 595 IPC_MESSAGE_EXTRA(sync, kind, msg_class, in_cnt, out_cnt, in_list, out_list) |
| 596 | 596 |
| 597 #define IPC_EMPTY_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 597 #define IPC_EMPTY_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
| 598 class msg_class : public IPC::Message { \ | 598 class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \ |
| 599 public: \ | 599 public: \ |
| 600 typedef IPC::Message Schema; \ | 600 typedef IPC::Message Schema; \ |
| 601 enum { ID = IPC_MESSAGE_ID() }; \ | 601 enum { ID = IPC_MESSAGE_ID() }; \ |
| 602 msg_class() : IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) {} \ | 602 msg_class() : IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) {} \ |
| 603 static void Log(std::string* name, const Message* msg, std::string* l); \ | 603 static void Log(std::string* name, const Message* msg, std::string* l); \ |
| 604 }; | 604 }; |
| 605 | 605 |
| 606 #define IPC_EMPTY_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 606 #define IPC_EMPTY_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
| 607 class msg_class : public IPC::Message { \ | 607 class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \ |
| 608 public: \ | 608 public: \ |
| 609 typedef IPC::Message Schema; \ | 609 typedef IPC::Message Schema; \ |
| 610 enum { ID = IPC_MESSAGE_ID() }; \ | 610 enum { ID = IPC_MESSAGE_ID() }; \ |
| 611 msg_class(int32 routing_id) \ | 611 msg_class(int32 routing_id) \ |
| 612 : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ | 612 : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ |
| 613 static void Log(std::string* name, const Message* msg, std::string* l); \ | 613 static void Log(std::string* name, const Message* msg, std::string* l); \ |
| 614 }; | 614 }; |
| 615 | 615 |
| 616 #define IPC_ASYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ | 616 #define IPC_ASYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ |
| 617 class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \ | 617 class IPC_MESSAGE_EXPORT msg_class : public IPC::Message { \ |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 // This corresponds to an enum value from IPCMessageStart. | 991 // This corresponds to an enum value from IPCMessageStart. |
| 992 #define IPC_MESSAGE_CLASS(message) \ | 992 #define IPC_MESSAGE_CLASS(message) \ |
| 993 IPC_MESSAGE_ID_CLASS(message.type()) | 993 IPC_MESSAGE_ID_CLASS(message.type()) |
| 994 | 994 |
| 995 #endif // IPC_IPC_MESSAGE_MACROS_H_ | 995 #endif // IPC_IPC_MESSAGE_MACROS_H_ |
| 996 | 996 |
| 997 // Clean up IPC_MESSAGE_START in this unguarded section so that the | 997 // Clean up IPC_MESSAGE_START in this unguarded section so that the |
| 998 // XXX_messages.h files need not do so themselves. This makes the | 998 // XXX_messages.h files need not do so themselves. This makes the |
| 999 // XXX_messages.h files easier to write. | 999 // XXX_messages.h files easier to write. |
| 1000 #undef IPC_MESSAGE_START | 1000 #undef IPC_MESSAGE_START |
| OLD | NEW |