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 #ifndef IPC_PARAM_TRAITS_LOG_MACROS_H_ | 5 #ifndef IPC_PARAM_TRAITS_LOG_MACROS_H_ |
6 #define IPC_PARAM_TRAITS_LOG_MACROS_H_ | 6 #define IPC_PARAM_TRAITS_LOG_MACROS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 // Null out all the macros that need nulling. | 11 // Null out all the macros that need nulling. |
12 #include "ipc/ipc_message_null_macros.h" | 12 #include "ipc/ipc_message_null_macros.h" |
13 | 13 |
14 // STRUCT declarations cause corresponding STRUCT_TRAITS declarations to occur. | 14 // STRUCT declarations cause corresponding STRUCT_TRAITS declarations to occur. |
15 #undef IPC_STRUCT_BEGIN | 15 #undef IPC_STRUCT_BEGIN |
16 #undef IPC_STRUCT_BEGIN_WITH_PARENT | 16 #undef IPC_STRUCT_BEGIN_WITH_PARENT |
17 #undef IPC_STRUCT_MEMBER | 17 #undef IPC_STRUCT_MEMBER |
18 #undef IPC_STRUCT_END | 18 #undef IPC_STRUCT_END |
19 #define IPC_STRUCT_BEGIN_WITH_PARENT(struct_name, parent) \ | 19 #define IPC_STRUCT_BEGIN_WITH_PARENT(struct_name, parent) \ |
20 IPC_STRUCT_BEGIN(struct_name) | 20 IPC_STRUCT_BEGIN(struct_name) |
21 #define IPC_STRUCT_BEGIN(struct_name) IPC_STRUCT_TRAITS_BEGIN(struct_name) | 21 #define IPC_STRUCT_BEGIN(struct_name) IPC_STRUCT_TRAITS_BEGIN(struct_name) |
22 #define IPC_STRUCT_MEMBER(type, name) IPC_STRUCT_TRAITS_MEMBER(name) | 22 #define IPC_STRUCT_MEMBER(type, name, ...) IPC_STRUCT_TRAITS_MEMBER(name) |
23 #define IPC_STRUCT_END() IPC_STRUCT_TRAITS_END() | 23 #define IPC_STRUCT_END() IPC_STRUCT_TRAITS_END() |
24 | 24 |
25 // Set up so next include will generate log methods. | 25 // Set up so next include will generate log methods. |
26 #undef IPC_STRUCT_TRAITS_BEGIN | 26 #undef IPC_STRUCT_TRAITS_BEGIN |
27 #undef IPC_STRUCT_TRAITS_MEMBER | 27 #undef IPC_STRUCT_TRAITS_MEMBER |
28 #undef IPC_STRUCT_TRAITS_PARENT | 28 #undef IPC_STRUCT_TRAITS_PARENT |
29 #undef IPC_STRUCT_TRAITS_END | 29 #undef IPC_STRUCT_TRAITS_END |
30 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \ | 30 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \ |
31 void ParamTraits<struct_name>::Log(const param_type& p, std::string* l) { \ | 31 void ParamTraits<struct_name>::Log(const param_type& p, std::string* l) { \ |
32 bool needs_comma = false; \ | 32 bool needs_comma = false; \ |
(...skipping 13 matching lines...) Expand all Loading... |
46 } | 46 } |
47 | 47 |
48 #undef IPC_ENUM_TRAITS | 48 #undef IPC_ENUM_TRAITS |
49 #define IPC_ENUM_TRAITS(enum_name) \ | 49 #define IPC_ENUM_TRAITS(enum_name) \ |
50 void ParamTraits<enum_name>::Log(const param_type& p, std::string* l) { \ | 50 void ParamTraits<enum_name>::Log(const param_type& p, std::string* l) { \ |
51 LogParam(static_cast<int>(p), l); \ | 51 LogParam(static_cast<int>(p), l); \ |
52 } | 52 } |
53 | 53 |
54 #endif // IPC_PARAM_TRAITS_LOG_MACROS_H_ | 54 #endif // IPC_PARAM_TRAITS_LOG_MACROS_H_ |
55 | 55 |
OLD | NEW |