From d32de8702e109980100b73228c9d4ba94f26b94e Mon Sep 17 00:00:00 2001 From: "tsepez@chromium.org" Date: Wed, 29 Jan 2014 01:33:04 +0000 Subject: Apply automatic range checks to CC enum types across IPC. This is part of a long-running background task to remove the remaining uses of the unchecked IPC_ENUM_TRAITS() macro. BUG=246708 Review URL: https://codereview.chromium.org/149033003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247569 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/output/filter_operation.h | 1 + cc/quads/draw_quad.h | 1 + cc/quads/io_surface_draw_quad.h | 3 ++- content/common/cc_messages.h | 8 +++++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cc/output/filter_operation.h b/cc/output/filter_operation.h index f5c6a82..7b48242 100644 --- a/cc/output/filter_operation.h +++ b/cc/output/filter_operation.h @@ -37,6 +37,7 @@ class CC_EXPORT FilterOperation { ZOOM, REFERENCE, SATURATING_BRIGHTNESS, // Not used in CSS/SVG. + FILTER_TYPE_LAST = SATURATING_BRIGHTNESS }; FilterOperation(const FilterOperation& other); diff --git a/cc/quads/draw_quad.h b/cc/quads/draw_quad.h index 236e074..1803eb3 100644 --- a/cc/quads/draw_quad.h +++ b/cc/quads/draw_quad.h @@ -43,6 +43,7 @@ class CC_EXPORT DrawQuad { TEXTURE_CONTENT, TILED_CONTENT, YUV_VIDEO_CONTENT, + MATERIAL_LAST = YUV_VIDEO_CONTENT }; virtual ~DrawQuad(); diff --git a/cc/quads/io_surface_draw_quad.h b/cc/quads/io_surface_draw_quad.h index c2307ce..9a9fa09 100644 --- a/cc/quads/io_surface_draw_quad.h +++ b/cc/quads/io_surface_draw_quad.h @@ -16,7 +16,8 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { public: enum Orientation { FLIPPED, - UNFLIPPED + UNFLIPPED, + ORIENTATION_LAST = UNFLIPPED }; static scoped_ptr Create(); diff --git a/content/common/cc_messages.h b/content/common/cc_messages.h index d1a9129..790e768 100644 --- a/content/common/cc_messages.h +++ b/content/common/cc_messages.h @@ -116,9 +116,11 @@ struct CONTENT_EXPORT ParamTraits { #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT -IPC_ENUM_TRAITS(cc::DrawQuad::Material) -IPC_ENUM_TRAITS(cc::IOSurfaceDrawQuad::Orientation) -IPC_ENUM_TRAITS(cc::FilterOperation::FilterType) +IPC_ENUM_TRAITS_MAX_VALUE(cc::DrawQuad::Material, cc::DrawQuad::MATERIAL_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(cc::IOSurfaceDrawQuad::Orientation, + cc::IOSurfaceDrawQuad::ORIENTATION_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(cc::FilterOperation::FilterType, + cc::FilterOperation::FILTER_TYPE_LAST ) IPC_ENUM_TRAITS_MAX_VALUE(cc::ResourceFormat, cc::RESOURCE_FORMAT_MAX) IPC_ENUM_TRAITS_MAX_VALUE(SkXfermode::Mode, SkXfermode::kLastMode) -- cgit v1.1