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

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

Issue 2694843003: Add field-initializing factory static methods to generated mojo unions. (Closed)
Patch Set: Created 3 years, 9 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
Index: mojo/public/interfaces/bindings/tests/test_unions.mojom
diff --git a/mojo/public/interfaces/bindings/tests/test_unions.mojom b/mojo/public/interfaces/bindings/tests/test_unions.mojom
index 41e1ed6ace0fccc12dc8239cef99f9fec5d910c1..b320e2b6b3e623f1b8073790e0cc907da1c82741 100644
--- a/mojo/public/interfaces/bindings/tests/test_unions.mojom
+++ b/mojo/public/interfaces/bindings/tests/test_unions.mojom
@@ -30,6 +30,35 @@ union PodUnion {
AnExtensibleEnum f_extensible_enum;
};
+union PodUnionWithDuplicates {
+ int8 f_int8;
+ int8 f_int8_other;
+ uint8 f_uint8;
+ uint8 f_uint8_other;
+ int16 f_int16;
+ int16 f_int16_other;
+ uint16 f_uint16;
+ uint16 f_uint16_other;
+ int32 f_int32;
+ int32 f_int32_other;
+ uint32 f_uint32;
+ uint32 f_uint32_other;
+ int64 f_int64;
+ int64 f_int64_other;
+ uint64 f_uint64;
+ uint64 f_uint64_other;
+ float f_float;
+ float f_float_other;
+ double f_double;
+ double f_double_other;
+ bool f_bool;
+ bool f_bool_other;
+ AnEnum f_enum;
+ AnEnum f_enum_other;
+ AnExtensibleEnum f_extensible_enum;
+ AnExtensibleEnum f_extensible_enum_other;
+};
+
union ObjectUnion {
int8 f_int8;
string f_string;
@@ -42,6 +71,24 @@ union ObjectUnion {
array<SmallStruct> f_small_structs;
};
+union ObjectUnionWithDuplicates {
+ string f_string;
+ string f_string_other;
+ DummyStruct f_dummy;
+ DummyStruct f_dummy_other;
+ DummyStruct? f_nullable;
+ DummyStruct? f_nullable_other;
+ array<int8> f_array_int8;
+ array<int8> f_array_int8_other;
+ map<string, int8> f_map_int8;
+ map<string, int8> f_map_int8_other;
+ PodUnion f_pod_union;
+ PodUnion f_pod_union_other;
+ // Test that Clone() is defined after SmallStruct is declared.
+ array<SmallStruct> f_small_structs;
+ array<SmallStruct> f_small_structs_other;
+};
+
union HandleUnion {
handle f_handle;
handle<message_pipe> f_message_pipe;
@@ -52,6 +99,23 @@ union HandleUnion {
SmallCache& f_small_cache_request;
};
+union HandleUnionWithDuplicates {
+ handle f_handle;
+ handle f_handle_other;
+ handle<message_pipe> f_message_pipe;
+ handle<message_pipe> f_message_pipe_other;
+ handle<data_pipe_consumer> f_data_pipe_consumer;
+ handle<data_pipe_consumer> f_data_pipe_consumer_other;
+ handle<data_pipe_producer> f_data_pipe_producer;
+ handle<data_pipe_producer> f_data_pipe_producer_other;
+ handle<shared_buffer> f_shared_buffer;
+ handle<shared_buffer> f_shared_buffer_other;
+ SmallCache f_small_cache;
+ SmallCache f_small_cache_other;
+ SmallCache& f_small_cache_request;
+ SmallCache& f_small_cache_request_other;
+};
+
struct WrapperStruct {
ObjectUnion? object_union;
PodUnion? pod_union;

Powered by Google App Engine
This is Rietveld 408576698