diff options
author | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-04 07:20:32 +0000 |
---|---|---|
committer | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-04 07:20:32 +0000 |
commit | dedd0a9e00390f585c41f065d1bff0731bd4a2d8 (patch) | |
tree | 114983c99c00a83ceaceb8ec128d29718dbb7bcd /ipc/param_traits_log_macros.h | |
parent | d966f777e418fbae4fef451a104bb1f7f326e434 (diff) | |
download | chromium_src-dedd0a9e00390f585c41f065d1bff0731bd4a2d8.zip chromium_src-dedd0a9e00390f585c41f065d1bff0731bd4a2d8.tar.gz chromium_src-dedd0a9e00390f585c41f065d1bff0731bd4a2d8.tar.bz2 |
Implement off-the-wire validation scheme for emum types.
This CL adds explicit IPC macros that can be used to ensure that the values being read off the wire are legitimate for
the enum type.
BUG=176110
R=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/15841011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/param_traits_log_macros.h')
-rw-r--r-- | ipc/param_traits_log_macros.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ipc/param_traits_log_macros.h b/ipc/param_traits_log_macros.h index 67863ac..fa50bac 100644 --- a/ipc/param_traits_log_macros.h +++ b/ipc/param_traits_log_macros.h @@ -11,13 +11,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() @@ -44,8 +42,8 @@ l->append(")"); \ } -#undef IPC_ENUM_TRAITS -#define IPC_ENUM_TRAITS(enum_name) \ +#undef IPC_ENUM_TRAITS_VALIDATE +#define IPC_ENUM_TRAITS_VALIDATE(enum_name, validation_expression) \ void ParamTraits<enum_name>::Log(const param_type& p, std::string* l) { \ LogParam(static_cast<int>(p), l); \ } |