Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Issue 1618963006: Mojo C++ bindings: support enum validation. (Closed)

Created:
4 years, 11 months ago by yzshen1
Modified:
4 years, 11 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), feature-media-reviews_chromium.org, mcasas+watch_chromium.org, media-router+watch_chromium.org, Matt Giuca, posciak+watch_chromium.org, qsr+mojo_chromium.org, tapted, tfarina, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mojo C++ bindings: support enum validation. By default, enums are not extensible, which means any unknown value will fail validation. If an enum may grow in the future, it needs to have [Extensible=True] attribute specified. In that case, the user code is responsible for handling unknown values properly. This CL doesn't add corresponding validation for JS or Java. BUG=404186 Committed: https://crrev.com/dca229ec9a69564985d182a16c9f2068db4d1989 Cr-Commit-Position: refs/heads/master@{#371954}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+392 lines, -152 lines) Patch
M chrome/browser/media/router/media_router_mojo_impl.cc View 1 2 3 4 2 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M components/arc/common/ime.mojom View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/arc/common/net.mojom View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/arc/common/power.mojom View 1 1 chunk +1 line, -0 lines 0 comments Download
M mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/array_internal.h View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/bindings_internal.h View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/template_util.h View 1 2 1 chunk +11 lines, -5 lines 0 comments Download
M mojo/public/cpp/bindings/lib/validation_errors.h View 1 chunk +3 lines, -1 line 0 comments Download
M mojo/public/cpp/bindings/lib/validation_errors.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/validation_util.h View 1 1 chunk +15 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/union_unittest.cc View 1 1 chunk +38 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/validation_unittest.cc View 1 3 chunks +26 lines, -29 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_good_known_enum_values.data View 1 1 chunk +5 lines, -4 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_good_known_enum_values.expected View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_good_uknown_extensible_enum_value.data View 1 1 chunk +4 lines, -10 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_good_uknown_extensible_enum_value.expected View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_uknown_non_extensible_enum_value.data View 1 1 chunk +14 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd14_uknown_non_extensible_enum_value.expected View 1 1 chunk +1 line, -2 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_good_known_enum_array_values.data View 1 1 chunk +27 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_good_known_enum_array_values.expected View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_good_uknown_extensible_enum_array_value.data View 1 1 chunk +20 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_good_uknown_extensible_enum_array_value.expected View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_uknown_non_extensible_enum_array_value.data View 1 1 chunk +21 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd15_uknown_non_extensible_enum_array_value.expected View 1 1 chunk +1 line, -2 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/test_unions.mojom View 1 2 chunks +6 lines, -0 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom View 1 2 chunks +14 lines, -0 lines 0 comments Download
M mojo/public/js/validation_unittests.js View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl View 1 3 chunks +30 lines, -27 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl View 2 chunks +0 lines, -6 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module-internal.h.tmpl View 1 2 chunks +20 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl View 1 chunk +0 lines, -6 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl View 1 2 chunks +9 lines, -5 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl View 1 1 chunk +6 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_definition.tmpl View 1 3 chunks +14 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl View 1 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl View 1 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/union_definition.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/union_serialization_definition.tmpl View 1 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/validation_macros.tmpl View 1 2 chunks +9 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl View 1 chunk +0 lines, -7 lines 0 comments Download
M mojo/public/tools/bindings/generators/mojom_cpp_generator.py View 1 7 chunks +31 lines, -25 lines 0 comments Download
M mojo/public/tools/bindings/pylib/mojom/generate/module.py View 1 2 chunks +6 lines, -0 lines 0 comments Download
M ui/arc/notification/arc_notification_item.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (9 generated)
yzshen1
Hi, reviewers. Would you please take a look? Thanks! Ken: Everything John: OWNER and high-level ...
4 years, 11 months ago (2016-01-26 00:59:48 UTC) #3
Ken Rockot(use gerrit already)
awesome. everything lgtm https://codereview.chromium.org/1618963006/diff/20001/mojo/public/cpp/bindings/lib/bindings_internal.h File mojo/public/cpp/bindings/lib/bindings_internal.h (right): https://codereview.chromium.org/1618963006/diff/20001/mojo/public/cpp/bindings/lib/bindings_internal.h#newcode97 mojo/public/cpp/bindings/lib/bindings_internal.h:97: typedef char (*EnsureTypeIsComplete)[sizeof(T)]; nit: any reason ...
4 years, 11 months ago (2016-01-26 15:39:20 UTC) #4
Luis Héctor Chávez
On 2016/01/26 15:39:20, Ken Rockot wrote: > awesome. everything lgtm > > https://codereview.chromium.org/1618963006/diff/20001/mojo/public/cpp/bindings/lib/bindings_internal.h > File ...
4 years, 11 months ago (2016-01-26 16:41:20 UTC) #5
yzshen1
> the following file got added yesterday night and also > needs to be extensible: ...
4 years, 11 months ago (2016-01-26 18:16:04 UTC) #6
jam
looking at the consumers, they have to call IsKnownEnumValue to do the verification? i.e. this ...
4 years, 11 months ago (2016-01-27 03:33:26 UTC) #7
yzshen1
On 2016/01/27 03:33:26, jam wrote: > looking at the consumers, they have to call IsKnownEnumValue ...
4 years, 11 months ago (2016-01-27 06:55:06 UTC) #8
jam
On 2016/01/27 06:55:06, yzshen1 wrote: > On 2016/01/27 03:33:26, jam wrote: > > looking at ...
4 years, 11 months ago (2016-01-27 16:11:33 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1618963006/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1618963006/80001
4 years, 11 months ago (2016-01-27 19:12:09 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/139664)
4 years, 11 months ago (2016-01-27 19:29:34 UTC) #14
yzshen1
Hi, Tom. Would you please review components/arc/common/*.mojom? This CL doesn't make any semantic changes to ...
4 years, 11 months ago (2016-01-27 21:32:49 UTC) #16
Tom Sepez
On 2016/01/27 21:32:49, yzshen1 wrote: > Hi, Tom. > > Would you please review components/arc/common/*.mojom? ...
4 years, 11 months ago (2016-01-27 23:56:54 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1618963006/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1618963006/80001
4 years, 11 months ago (2016-01-28 01:20:23 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 11 months ago (2016-01-28 01:30:22 UTC) #21
commit-bot: I haz the power
4 years, 11 months ago (2016-01-28 02:05:06 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/dca229ec9a69564985d182a16c9f2068db4d1989
Cr-Commit-Position: refs/heads/master@{#371954}

Powered by Google App Engine
This is Rietveld 408576698