diff options
author | yzshen <yzshen@chromium.org> | 2016-01-27 17:30:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-28 02:04:50 +0000 |
commit | dca229ec9a69564985d182a16c9f2068db4d1989 (patch) | |
tree | 8a24a0dcb9fc23baabd739da253ac40ec436950a /components | |
parent | 95b810566de876251114b4b11827b093b8d05f11 (diff) | |
download | chromium_src-dca229ec9a69564985d182a16c9f2068db4d1989.zip chromium_src-dca229ec9a69564985d182a16c9f2068db4d1989.tar.gz chromium_src-dca229ec9a69564985d182a16c9f2068db4d1989.tar.bz2 |
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
Review URL: https://codereview.chromium.org/1618963006
Cr-Commit-Position: refs/heads/master@{#371954}
Diffstat (limited to 'components')
-rw-r--r-- | components/arc/common/ime.mojom | 1 | ||||
-rw-r--r-- | components/arc/common/net.mojom | 1 | ||||
-rw-r--r-- | components/arc/common/power.mojom | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/components/arc/common/ime.mojom b/components/arc/common/ime.mojom index 9722ddf..e1b314e 100644 --- a/components/arc/common/ime.mojom +++ b/components/arc/common/ime.mojom @@ -5,6 +5,7 @@ module arc; // Represents the type of text input field currently focused. +[Extensible=True] enum TextInputType { NONE, TEXT, diff --git a/components/arc/common/net.mojom b/components/arc/common/net.mojom index 0835c73..01de04e 100644 --- a/components/arc/common/net.mojom +++ b/components/arc/common/net.mojom @@ -4,6 +4,7 @@ module arc; +[Extensible=True] enum NetworkResult { SUCCESS = 0, FAILURE = 1, diff --git a/components/arc/common/power.mojom b/components/arc/common/power.mojom index b1cfbae..22792e2 100644 --- a/components/arc/common/power.mojom +++ b/components/arc/common/power.mojom @@ -6,6 +6,7 @@ module arc; // Enumerates the types of wake lock the ARC instance can request from the // host. +[Extensible=True] enum DisplayWakeLockType { // Does not allow the screen to dim, turn off, or lock; prevents // idle suspend. |