| Index: ipc/param_traits_write_macros.h
|
| diff --git a/ipc/param_traits_write_macros.h b/ipc/param_traits_write_macros.h
|
| index dd977cde8d8ace40a3251025e541f678c4f20a53..81f915ffff8dedf95bb36766f779fc1bc05d93f3 100644
|
| --- a/ipc/param_traits_write_macros.h
|
| +++ b/ipc/param_traits_write_macros.h
|
| @@ -9,13 +9,11 @@
|
| #include "ipc/ipc_message_null_macros.h"
|
|
|
| // STRUCT declarations cause corresponding STRUCT_TRAITS declarations to occur.
|
| -#undef IPC_STRUCT_BEGIN
|
| #undef IPC_STRUCT_BEGIN_WITH_PARENT
|
| #undef IPC_STRUCT_MEMBER
|
| #undef IPC_STRUCT_END
|
| #define IPC_STRUCT_BEGIN_WITH_PARENT(struct_name, parent) \
|
| - IPC_STRUCT_BEGIN(struct_name)
|
| -#define IPC_STRUCT_BEGIN(struct_name) IPC_STRUCT_TRAITS_BEGIN(struct_name)
|
| + IPC_STRUCT_TRAITS_BEGIN(struct_name)
|
| #define IPC_STRUCT_MEMBER(type, name, ...) IPC_STRUCT_TRAITS_MEMBER(name)
|
| #define IPC_STRUCT_END() IPC_STRUCT_TRAITS_END()
|
|
|
| @@ -30,10 +28,11 @@
|
| #define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::Write(m, p);
|
| #define IPC_STRUCT_TRAITS_END() }
|
|
|
| -#undef IPC_ENUM_TRAITS
|
| -#define IPC_ENUM_TRAITS(enum_name) \
|
| - void ParamTraits<enum_name>::Write(Message* m, const param_type& p) { \
|
| - m->WriteInt(static_cast<int>(p)); \
|
| +#undef IPC_ENUM_TRAITS_VALIDATE
|
| +#define IPC_ENUM_TRAITS_VALIDATE(enum_name, validation_expression) \
|
| + void ParamTraits<enum_name>::Write(Message* m, const param_type& value) { \
|
| + DCHECK(validation_expression); \
|
| + m->WriteInt(static_cast<int>(value)); \
|
| }
|
|
|
| #endif // IPC_PARAM_TRAITS_WRITE_MACROS_H_
|
|
|