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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // The following macros define the common set of methods provided by ASYNC | 437 // The following macros define the common set of methods provided by ASYNC |
438 // message classes. | 438 // message classes. |
439 // This macro is for all the async IPCs that don't pass an extra parameter using | 439 // This macro is for all the async IPCs that don't pass an extra parameter using |
440 // IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. | 440 // IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. |
441 #define IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 441 #define IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
442 template<class T, class S, class P, class Method> \ | 442 template<class T, class S, class P, class Method> \ |
443 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ | 443 static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter, \ |
444 Method func) { \ | 444 Method func) { \ |
445 Schema::Param p; \ | 445 Schema::Param p; \ |
446 if (Read(msg, &p)) { \ | 446 if (Read(msg, &p)) { \ |
447 DispatchToMethod(obj, func, p); \ | 447 base::DispatchToMethod(obj, func, p); \ |
448 return true; \ | 448 return true; \ |
449 } \ | 449 } \ |
450 return false; \ | 450 return false; \ |
451 } | 451 } |
452 | 452 |
453 // The following macros are for for async IPCs which have a dispatcher with an | 453 // The following macros are for for async IPCs which have a dispatcher with an |
454 // extra parameter specified using IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. | 454 // extra parameter specified using IPC_BEGIN_MESSAGE_MAP_WITH_PARAM. |
455 #define IPC_ASYNC_MESSAGE_METHODS_1 \ | 455 #define IPC_ASYNC_MESSAGE_METHODS_1 \ |
456 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ | 456 IPC_ASYNC_MESSAGE_METHODS_GENERIC \ |
457 template<class T, class S, class P, typename TA> \ | 457 template<class T, class S, class P, typename TA> \ |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 // This corresponds to an enum value from IPCMessageStart. | 975 // This corresponds to an enum value from IPCMessageStart. |
976 #define IPC_MESSAGE_CLASS(message) \ | 976 #define IPC_MESSAGE_CLASS(message) \ |
977 IPC_MESSAGE_ID_CLASS(message.type()) | 977 IPC_MESSAGE_ID_CLASS(message.type()) |
978 | 978 |
979 #endif // IPC_IPC_MESSAGE_MACROS_H_ | 979 #endif // IPC_IPC_MESSAGE_MACROS_H_ |
980 | 980 |
981 // Clean up IPC_MESSAGE_START in this unguarded section so that the | 981 // Clean up IPC_MESSAGE_START in this unguarded section so that the |
982 // XXX_messages.h files need not do so themselves. This makes the | 982 // XXX_messages.h files need not do so themselves. This makes the |
983 // XXX_messages.h files easier to write. | 983 // XXX_messages.h files easier to write. |
984 #undef IPC_MESSAGE_START | 984 #undef IPC_MESSAGE_START |
OLD | NEW |