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

Unified Diff: mojo/public/interfaces/bindings/tests/sample_service.mojom

Issue 268363003: Mojo: Add support for constants to the IDL compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JS export constants Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/interfaces/bindings/tests/sample_service.mojom
diff --git a/mojo/public/interfaces/bindings/tests/sample_service.mojom b/mojo/public/interfaces/bindings/tests/sample_service.mojom
index 03369986842e3fdc7b31a3c55d0ebe52dc2bc63d..dfba58f7638463581618567b5252943f01b87c4e 100644
--- a/mojo/public/interfaces/bindings/tests/sample_service.mojom
+++ b/mojo/public/interfaces/bindings/tests/sample_service.mojom
@@ -8,6 +8,8 @@ import "sample_import2.mojom"
[JavaPackage="org.chromium.mojo.bindings.test"]
module sample {
+const uint8 kThree = 3;
+
struct Bar {
enum Type {
TYPE_VERTICAL = 1 << 0,
@@ -23,7 +25,8 @@ struct Bar {
[RequiredFields=7]
struct Foo {
- string name = "Fooby" @8;
+ const string kFooby = "Fooby";
+ string name = kFooby @8;
int32 x @0;
int32 y @1;
bool a = true @2;
@@ -31,7 +34,7 @@ struct Foo {
bool c @4;
Bar bar @5;
Bar[] extra_bars @7;
- uint8[] data = [1,2,3] @6;
+ uint8[] data = [1,2,kThree] @6;
handle<message_pipe> source @9;
handle<data_pipe_consumer>[] input_streams @10;
handle<data_pipe_producer>[] output_streams @11;
@@ -59,6 +62,7 @@ interface Service {
BAZ_REGULAR = 0,
BAZ_EXTRA
};
+ const uint8 kFavoriteBaz = 1;
Frobinate@0(Foo foo @0, BazOptions baz @1, Port port @2);
};
« no previous file with comments | « no previous file | mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698