OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library test_unions_mojom; | 5 library test_unions_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; |
8 | 9 |
9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 import 'package:_mojo_for_test_only/mojo/test/test_included_unions.mojom.dart' a
s test_included_unions_mojom; | 14 import 'package:_mojo_for_test_only/mojo/test/test_included_unions.mojom.dart' a
s test_included_unions_mojom; |
12 | 15 |
13 class AnEnum extends bindings.MojoEnum { | 16 class AnEnum extends bindings.MojoEnum { |
14 static const AnEnum first = const AnEnum._(0); | 17 static const AnEnum first = const AnEnum._(0); |
15 static const AnEnum second = const AnEnum._(1); | 18 static const AnEnum second = const AnEnum._(1); |
16 | 19 |
17 const AnEnum._(int v) : super(v); | 20 const AnEnum._(int v) : super(v); |
18 | 21 |
19 static const Map<String, AnEnum> valuesMap = const { | 22 static const Map<String, AnEnum> valuesMap = const { |
20 "first": first, | 23 "first": first, |
(...skipping 26 matching lines...) Expand all Loading... |
47 } | 50 } |
48 return result; | 51 return result; |
49 } | 52 } |
50 | 53 |
51 String toString() { | 54 String toString() { |
52 switch(this) { | 55 switch(this) { |
53 case first: | 56 case first: |
54 return 'AnEnum.first'; | 57 return 'AnEnum.first'; |
55 case second: | 58 case second: |
56 return 'AnEnum.second'; | 59 return 'AnEnum.second'; |
| 60 default: |
| 61 return null; |
57 } | 62 } |
58 } | 63 } |
59 | 64 |
60 int toJson() => mojoEnumValue; | 65 int toJson() => mojoEnumValue; |
61 } | 66 } |
62 | 67 |
| 68 mojom_types.MojomEnum _testUnionsAnEnum() { |
| 69 return new mojom_types.MojomEnum() |
| 70 ..declData = (new mojom_types.DeclarationData() |
| 71 ..shortName = 'AnEnum' |
| 72 ..fullIdentifier = 'mojo.test.AnEnum') |
| 73 ..values = <mojom_types.EnumValue>[ |
| 74 new mojom_types.EnumValue() |
| 75 ..declData = (new mojom_types.DeclarationData() |
| 76 ..shortName = 'First') |
| 77 ..enumTypeKey = 'test_unions_AnEnum__' |
| 78 ..intValue = 0, |
| 79 new mojom_types.EnumValue() |
| 80 ..declData = (new mojom_types.DeclarationData() |
| 81 ..shortName = 'Second') |
| 82 ..enumTypeKey = 'test_unions_AnEnum__' |
| 83 ..intValue = 1,]; |
| 84 } |
| 85 |
63 | 86 |
64 | 87 |
65 class StructOfUnions extends bindings.Struct { | 88 class StructOfUnions extends bindings.Struct { |
66 static const List<bindings.StructDataHeader> kVersions = const [ | 89 static const List<bindings.StructDataHeader> kVersions = const [ |
67 const bindings.StructDataHeader(56, 0) | 90 const bindings.StructDataHeader(56, 0) |
68 ]; | 91 ]; |
69 ObjectUnion u = null; | 92 ObjectUnion u = null; |
70 List<ObjectUnion> aOu = null; | 93 List<ObjectUnion> aOu = null; |
71 List<HandleUnion> aHu = null; | 94 List<HandleUnion> aHu = null; |
72 Map<int, ObjectUnion> mOu = null; | 95 Map<int, ObjectUnion> mOu = null; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 "mOu: $mOu" ", " | 307 "mOu: $mOu" ", " |
285 "mHu: $mHu" ")"; | 308 "mHu: $mHu" ")"; |
286 } | 309 } |
287 | 310 |
288 Map toJson() { | 311 Map toJson() { |
289 throw new bindings.MojoCodecError( | 312 throw new bindings.MojoCodecError( |
290 'Object containing handles cannot be encoded to JSON.'); | 313 'Object containing handles cannot be encoded to JSON.'); |
291 } | 314 } |
292 } | 315 } |
293 | 316 |
| 317 mojom_types.MojomStruct _testUnionsStructOfUnions() { |
| 318 return new mojom_types.MojomStruct() |
| 319 ..declData = (new mojom_types.DeclarationData() |
| 320 ..shortName = 'StructOfUnions' |
| 321 ..fullIdentifier = 'mojo.test.StructOfUnions') |
| 322 ..fields = <mojom_types.StructField>[ |
| 323 new mojom_types.StructField() |
| 324 ..declData = (new mojom_types.DeclarationData() |
| 325 ..shortName = 'U') |
| 326 ..type = (new mojom_types.Type() |
| 327 ..typeReference = (new mojom_types.TypeReference() |
| 328 ..identifier = 'test_unions_ObjectUnion__' |
| 329 ..typeKey = 'test_unions_ObjectUnion__' |
| 330 )), |
| 331 new mojom_types.StructField() |
| 332 ..declData = (new mojom_types.DeclarationData() |
| 333 ..shortName = 'AOu') |
| 334 ..type = (new mojom_types.Type() |
| 335 ..arrayType = (new mojom_types.ArrayType() |
| 336 ..elementType = (new mojom_types.Type() |
| 337 ..typeReference = (new mojom_types.TypeReference() |
| 338 ..identifier = 'test_unions_ObjectUnion__' |
| 339 ..typeKey = 'test_unions_ObjectUnion__' |
| 340 )))), |
| 341 new mojom_types.StructField() |
| 342 ..declData = (new mojom_types.DeclarationData() |
| 343 ..shortName = 'AHu') |
| 344 ..type = (new mojom_types.Type() |
| 345 ..arrayType = (new mojom_types.ArrayType() |
| 346 ..elementType = (new mojom_types.Type() |
| 347 ..typeReference = (new mojom_types.TypeReference() |
| 348 ..identifier = 'test_unions_HandleUnion__' |
| 349 ..typeKey = 'test_unions_HandleUnion__' |
| 350 )))), |
| 351 new mojom_types.StructField() |
| 352 ..declData = (new mojom_types.DeclarationData() |
| 353 ..shortName = 'MOu') |
| 354 ..type = (new mojom_types.Type() |
| 355 ..mapType = (new mojom_types.MapType() |
| 356 ..keyType = (new mojom_types.Type() |
| 357 ..simpleType = mojom_types.SimpleType.int64) |
| 358 ..valueType = (new mojom_types.Type() |
| 359 ..typeReference = (new mojom_types.TypeReference() |
| 360 ..identifier = 'test_unions_ObjectUnion__' |
| 361 ..typeKey = 'test_unions_ObjectUnion__' |
| 362 )))), |
| 363 new mojom_types.StructField() |
| 364 ..declData = (new mojom_types.DeclarationData() |
| 365 ..shortName = 'MHu') |
| 366 ..type = (new mojom_types.Type() |
| 367 ..mapType = (new mojom_types.MapType() |
| 368 ..keyType = (new mojom_types.Type() |
| 369 ..simpleType = mojom_types.SimpleType.int64) |
| 370 ..valueType = (new mojom_types.Type() |
| 371 ..typeReference = (new mojom_types.TypeReference() |
| 372 ..identifier = 'test_unions_HandleUnion__' |
| 373 ..typeKey = 'test_unions_HandleUnion__' |
| 374 )))),]; |
| 375 } |
| 376 |
294 | 377 |
295 class WrapperStruct extends bindings.Struct { | 378 class WrapperStruct extends bindings.Struct { |
296 static const List<bindings.StructDataHeader> kVersions = const [ | 379 static const List<bindings.StructDataHeader> kVersions = const [ |
297 const bindings.StructDataHeader(56, 0) | 380 const bindings.StructDataHeader(56, 0) |
298 ]; | 381 ]; |
299 ObjectUnion objectUnion = null; | 382 ObjectUnion objectUnion = null; |
300 PodUnion podUnion = null; | 383 PodUnion podUnion = null; |
301 HandleUnion handleUnion = null; | 384 HandleUnion handleUnion = null; |
302 | 385 |
303 WrapperStruct() : super(kVersions.last.size); | 386 WrapperStruct() : super(kVersions.last.size); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 "podUnion: $podUnion" ", " | 449 "podUnion: $podUnion" ", " |
367 "handleUnion: $handleUnion" ")"; | 450 "handleUnion: $handleUnion" ")"; |
368 } | 451 } |
369 | 452 |
370 Map toJson() { | 453 Map toJson() { |
371 throw new bindings.MojoCodecError( | 454 throw new bindings.MojoCodecError( |
372 'Object containing handles cannot be encoded to JSON.'); | 455 'Object containing handles cannot be encoded to JSON.'); |
373 } | 456 } |
374 } | 457 } |
375 | 458 |
| 459 mojom_types.MojomStruct _testUnionsWrapperStruct() { |
| 460 return new mojom_types.MojomStruct() |
| 461 ..declData = (new mojom_types.DeclarationData() |
| 462 ..shortName = 'WrapperStruct' |
| 463 ..fullIdentifier = 'mojo.test.WrapperStruct') |
| 464 ..fields = <mojom_types.StructField>[ |
| 465 new mojom_types.StructField() |
| 466 ..declData = (new mojom_types.DeclarationData() |
| 467 ..shortName = 'ObjectUnion') |
| 468 ..type = (new mojom_types.Type() |
| 469 ..typeReference = (new mojom_types.TypeReference() |
| 470 ..nullable = true |
| 471 |
| 472 ..identifier = 'test_unions_ObjectUnion__' |
| 473 ..typeKey = 'test_unions_ObjectUnion__' |
| 474 )), |
| 475 new mojom_types.StructField() |
| 476 ..declData = (new mojom_types.DeclarationData() |
| 477 ..shortName = 'PodUnion') |
| 478 ..type = (new mojom_types.Type() |
| 479 ..typeReference = (new mojom_types.TypeReference() |
| 480 ..nullable = true |
| 481 |
| 482 ..identifier = 'test_unions_PodUnion__' |
| 483 ..typeKey = 'test_unions_PodUnion__' |
| 484 )), |
| 485 new mojom_types.StructField() |
| 486 ..declData = (new mojom_types.DeclarationData() |
| 487 ..shortName = 'HandleUnion') |
| 488 ..type = (new mojom_types.Type() |
| 489 ..typeReference = (new mojom_types.TypeReference() |
| 490 ..nullable = true |
| 491 |
| 492 ..identifier = 'test_unions_HandleUnion__' |
| 493 ..typeKey = 'test_unions_HandleUnion__' |
| 494 )),]; |
| 495 } |
| 496 |
376 | 497 |
377 class DummyStruct extends bindings.Struct { | 498 class DummyStruct extends bindings.Struct { |
378 static const List<bindings.StructDataHeader> kVersions = const [ | 499 static const List<bindings.StructDataHeader> kVersions = const [ |
379 const bindings.StructDataHeader(16, 0) | 500 const bindings.StructDataHeader(16, 0) |
380 ]; | 501 ]; |
381 int fInt8 = 0; | 502 int fInt8 = 0; |
382 | 503 |
383 DummyStruct() : super(kVersions.last.size); | 504 DummyStruct() : super(kVersions.last.size); |
384 | 505 |
385 static DummyStruct deserialize(bindings.Message message) { | 506 static DummyStruct deserialize(bindings.Message message) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 "fInt8: $fInt8" ")"; | 554 "fInt8: $fInt8" ")"; |
434 } | 555 } |
435 | 556 |
436 Map toJson() { | 557 Map toJson() { |
437 Map map = new Map(); | 558 Map map = new Map(); |
438 map["fInt8"] = fInt8; | 559 map["fInt8"] = fInt8; |
439 return map; | 560 return map; |
440 } | 561 } |
441 } | 562 } |
442 | 563 |
| 564 mojom_types.MojomStruct _testUnionsDummyStruct() { |
| 565 return new mojom_types.MojomStruct() |
| 566 ..declData = (new mojom_types.DeclarationData() |
| 567 ..shortName = 'DummyStruct' |
| 568 ..fullIdentifier = 'mojo.test.DummyStruct') |
| 569 ..fields = <mojom_types.StructField>[ |
| 570 new mojom_types.StructField() |
| 571 ..declData = (new mojom_types.DeclarationData() |
| 572 ..shortName = 'FInt8') |
| 573 ..type = (new mojom_types.Type() |
| 574 ..simpleType = mojom_types.SimpleType.int8),]; |
| 575 } |
| 576 |
443 | 577 |
444 class SmallStruct extends bindings.Struct { | 578 class SmallStruct extends bindings.Struct { |
445 static const List<bindings.StructDataHeader> kVersions = const [ | 579 static const List<bindings.StructDataHeader> kVersions = const [ |
446 const bindings.StructDataHeader(72, 0) | 580 const bindings.StructDataHeader(72, 0) |
447 ]; | 581 ]; |
448 DummyStruct dummyStruct = null; | 582 DummyStruct dummyStruct = null; |
449 PodUnion podUnion = null; | 583 PodUnion podUnion = null; |
450 List<PodUnion> podUnionArray = null; | 584 List<PodUnion> podUnionArray = null; |
451 List<PodUnion> nullablePodUnionArray = null; | 585 List<PodUnion> nullablePodUnionArray = null; |
452 List<DummyStruct> sArray = null; | 586 List<DummyStruct> sArray = null; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 map["podUnion"] = podUnion; | 864 map["podUnion"] = podUnion; |
731 map["podUnionArray"] = podUnionArray; | 865 map["podUnionArray"] = podUnionArray; |
732 map["nullablePodUnionArray"] = nullablePodUnionArray; | 866 map["nullablePodUnionArray"] = nullablePodUnionArray; |
733 map["sArray"] = sArray; | 867 map["sArray"] = sArray; |
734 map["podUnionMap"] = podUnionMap; | 868 map["podUnionMap"] = podUnionMap; |
735 map["nullablePodUnionMap"] = nullablePodUnionMap; | 869 map["nullablePodUnionMap"] = nullablePodUnionMap; |
736 return map; | 870 return map; |
737 } | 871 } |
738 } | 872 } |
739 | 873 |
| 874 mojom_types.MojomStruct _testUnionsSmallStruct() { |
| 875 return new mojom_types.MojomStruct() |
| 876 ..declData = (new mojom_types.DeclarationData() |
| 877 ..shortName = 'SmallStruct' |
| 878 ..fullIdentifier = 'mojo.test.SmallStruct') |
| 879 ..fields = <mojom_types.StructField>[ |
| 880 new mojom_types.StructField() |
| 881 ..declData = (new mojom_types.DeclarationData() |
| 882 ..shortName = 'DummyStruct') |
| 883 ..type = (new mojom_types.Type() |
| 884 ..typeReference = (new mojom_types.TypeReference() |
| 885 ..nullable = true |
| 886 |
| 887 ..identifier = 'test_unions_DummyStruct__' |
| 888 ..typeKey = 'test_unions_DummyStruct__' |
| 889 )), |
| 890 new mojom_types.StructField() |
| 891 ..declData = (new mojom_types.DeclarationData() |
| 892 ..shortName = 'PodUnion') |
| 893 ..type = (new mojom_types.Type() |
| 894 ..typeReference = (new mojom_types.TypeReference() |
| 895 ..nullable = true |
| 896 |
| 897 ..identifier = 'test_unions_PodUnion__' |
| 898 ..typeKey = 'test_unions_PodUnion__' |
| 899 )), |
| 900 new mojom_types.StructField() |
| 901 ..declData = (new mojom_types.DeclarationData() |
| 902 ..shortName = 'PodUnionArray') |
| 903 ..type = (new mojom_types.Type() |
| 904 ..arrayType = (new mojom_types.ArrayType() |
| 905 ..nullable = true |
| 906 ..elementType = (new mojom_types.Type() |
| 907 ..typeReference = (new mojom_types.TypeReference() |
| 908 ..identifier = 'test_unions_PodUnion__' |
| 909 ..typeKey = 'test_unions_PodUnion__' |
| 910 )))), |
| 911 new mojom_types.StructField() |
| 912 ..declData = (new mojom_types.DeclarationData() |
| 913 ..shortName = 'NullablePodUnionArray') |
| 914 ..type = (new mojom_types.Type() |
| 915 ..arrayType = (new mojom_types.ArrayType() |
| 916 ..nullable = true |
| 917 ..elementType = (new mojom_types.Type() |
| 918 ..typeReference = (new mojom_types.TypeReference() |
| 919 ..nullable = true |
| 920 |
| 921 ..identifier = 'test_unions_PodUnion__' |
| 922 ..typeKey = 'test_unions_PodUnion__' |
| 923 )))), |
| 924 new mojom_types.StructField() |
| 925 ..declData = (new mojom_types.DeclarationData() |
| 926 ..shortName = 'SArray') |
| 927 ..type = (new mojom_types.Type() |
| 928 ..arrayType = (new mojom_types.ArrayType() |
| 929 ..nullable = true |
| 930 ..elementType = (new mojom_types.Type() |
| 931 ..typeReference = (new mojom_types.TypeReference() |
| 932 ..identifier = 'test_unions_DummyStruct__' |
| 933 ..typeKey = 'test_unions_DummyStruct__' |
| 934 )))), |
| 935 new mojom_types.StructField() |
| 936 ..declData = (new mojom_types.DeclarationData() |
| 937 ..shortName = 'PodUnionMap') |
| 938 ..type = (new mojom_types.Type() |
| 939 ..mapType = (new mojom_types.MapType() |
| 940 ..nullable = true |
| 941 |
| 942 ..keyType = (new mojom_types.Type() |
| 943 ..stringType = (new mojom_types.StringType())) |
| 944 ..valueType = (new mojom_types.Type() |
| 945 ..typeReference = (new mojom_types.TypeReference() |
| 946 ..identifier = 'test_unions_PodUnion__' |
| 947 ..typeKey = 'test_unions_PodUnion__' |
| 948 )))), |
| 949 new mojom_types.StructField() |
| 950 ..declData = (new mojom_types.DeclarationData() |
| 951 ..shortName = 'NullablePodUnionMap') |
| 952 ..type = (new mojom_types.Type() |
| 953 ..mapType = (new mojom_types.MapType() |
| 954 ..nullable = true |
| 955 |
| 956 ..keyType = (new mojom_types.Type() |
| 957 ..stringType = (new mojom_types.StringType())) |
| 958 ..valueType = (new mojom_types.Type() |
| 959 ..typeReference = (new mojom_types.TypeReference() |
| 960 ..nullable = true |
| 961 |
| 962 ..identifier = 'test_unions_PodUnion__' |
| 963 ..typeKey = 'test_unions_PodUnion__' |
| 964 )))),]; |
| 965 } |
| 966 |
740 | 967 |
741 class SmallStructNonNullableUnion extends bindings.Struct { | 968 class SmallStructNonNullableUnion extends bindings.Struct { |
742 static const List<bindings.StructDataHeader> kVersions = const [ | 969 static const List<bindings.StructDataHeader> kVersions = const [ |
743 const bindings.StructDataHeader(24, 0) | 970 const bindings.StructDataHeader(24, 0) |
744 ]; | 971 ]; |
745 PodUnion podUnion = null; | 972 PodUnion podUnion = null; |
746 | 973 |
747 SmallStructNonNullableUnion() : super(kVersions.last.size); | 974 SmallStructNonNullableUnion() : super(kVersions.last.size); |
748 | 975 |
749 static SmallStructNonNullableUnion deserialize(bindings.Message message) { | 976 static SmallStructNonNullableUnion deserialize(bindings.Message message) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 "podUnion: $podUnion" ")"; | 1028 "podUnion: $podUnion" ")"; |
802 } | 1029 } |
803 | 1030 |
804 Map toJson() { | 1031 Map toJson() { |
805 Map map = new Map(); | 1032 Map map = new Map(); |
806 map["podUnion"] = podUnion; | 1033 map["podUnion"] = podUnion; |
807 return map; | 1034 return map; |
808 } | 1035 } |
809 } | 1036 } |
810 | 1037 |
| 1038 mojom_types.MojomStruct _testUnionsSmallStructNonNullableUnion() { |
| 1039 return new mojom_types.MojomStruct() |
| 1040 ..declData = (new mojom_types.DeclarationData() |
| 1041 ..shortName = 'SmallStructNonNullableUnion' |
| 1042 ..fullIdentifier = 'mojo.test.SmallStructNonNullableUnion') |
| 1043 ..fields = <mojom_types.StructField>[ |
| 1044 new mojom_types.StructField() |
| 1045 ..declData = (new mojom_types.DeclarationData() |
| 1046 ..shortName = 'PodUnion') |
| 1047 ..type = (new mojom_types.Type() |
| 1048 ..typeReference = (new mojom_types.TypeReference() |
| 1049 ..identifier = 'test_unions_PodUnion__' |
| 1050 ..typeKey = 'test_unions_PodUnion__' |
| 1051 )),]; |
| 1052 } |
| 1053 |
811 | 1054 |
812 class StructNullObjectUnion extends bindings.Struct { | 1055 class StructNullObjectUnion extends bindings.Struct { |
813 static const List<bindings.StructDataHeader> kVersions = const [ | 1056 static const List<bindings.StructDataHeader> kVersions = const [ |
814 const bindings.StructDataHeader(24, 0) | 1057 const bindings.StructDataHeader(24, 0) |
815 ]; | 1058 ]; |
816 ObjectOnlyUnion objUnion = null; | 1059 ObjectOnlyUnion objUnion = null; |
817 | 1060 |
818 StructNullObjectUnion() : super(kVersions.last.size); | 1061 StructNullObjectUnion() : super(kVersions.last.size); |
819 | 1062 |
820 static StructNullObjectUnion deserialize(bindings.Message message) { | 1063 static StructNullObjectUnion deserialize(bindings.Message message) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 "objUnion: $objUnion" ")"; | 1111 "objUnion: $objUnion" ")"; |
869 } | 1112 } |
870 | 1113 |
871 Map toJson() { | 1114 Map toJson() { |
872 Map map = new Map(); | 1115 Map map = new Map(); |
873 map["objUnion"] = objUnion; | 1116 map["objUnion"] = objUnion; |
874 return map; | 1117 return map; |
875 } | 1118 } |
876 } | 1119 } |
877 | 1120 |
| 1121 mojom_types.MojomStruct _testUnionsStructNullObjectUnion() { |
| 1122 return new mojom_types.MojomStruct() |
| 1123 ..declData = (new mojom_types.DeclarationData() |
| 1124 ..shortName = 'StructNullObjectUnion' |
| 1125 ..fullIdentifier = 'mojo.test.StructNullObjectUnion') |
| 1126 ..fields = <mojom_types.StructField>[ |
| 1127 new mojom_types.StructField() |
| 1128 ..declData = (new mojom_types.DeclarationData() |
| 1129 ..shortName = 'ObjUnion') |
| 1130 ..type = (new mojom_types.Type() |
| 1131 ..typeReference = (new mojom_types.TypeReference() |
| 1132 ..nullable = true |
| 1133 |
| 1134 ..identifier = 'test_unions_ObjectOnlyUnion__' |
| 1135 ..typeKey = 'test_unions_ObjectOnlyUnion__' |
| 1136 )),]; |
| 1137 } |
| 1138 |
878 | 1139 |
879 class SmallObjStruct extends bindings.Struct { | 1140 class SmallObjStruct extends bindings.Struct { |
880 static const List<bindings.StructDataHeader> kVersions = const [ | 1141 static const List<bindings.StructDataHeader> kVersions = const [ |
881 const bindings.StructDataHeader(32, 0) | 1142 const bindings.StructDataHeader(32, 0) |
882 ]; | 1143 ]; |
883 ObjectUnion objUnion = null; | 1144 ObjectUnion objUnion = null; |
884 int fInt8 = 0; | 1145 int fInt8 = 0; |
885 | 1146 |
886 SmallObjStruct() : super(kVersions.last.size); | 1147 SmallObjStruct() : super(kVersions.last.size); |
887 | 1148 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 } | 1209 } |
949 | 1210 |
950 Map toJson() { | 1211 Map toJson() { |
951 Map map = new Map(); | 1212 Map map = new Map(); |
952 map["objUnion"] = objUnion; | 1213 map["objUnion"] = objUnion; |
953 map["fInt8"] = fInt8; | 1214 map["fInt8"] = fInt8; |
954 return map; | 1215 return map; |
955 } | 1216 } |
956 } | 1217 } |
957 | 1218 |
| 1219 mojom_types.MojomStruct _testUnionsSmallObjStruct() { |
| 1220 return new mojom_types.MojomStruct() |
| 1221 ..declData = (new mojom_types.DeclarationData() |
| 1222 ..shortName = 'SmallObjStruct' |
| 1223 ..fullIdentifier = 'mojo.test.SmallObjStruct') |
| 1224 ..fields = <mojom_types.StructField>[ |
| 1225 new mojom_types.StructField() |
| 1226 ..declData = (new mojom_types.DeclarationData() |
| 1227 ..shortName = 'ObjUnion') |
| 1228 ..type = (new mojom_types.Type() |
| 1229 ..typeReference = (new mojom_types.TypeReference() |
| 1230 ..identifier = 'test_unions_ObjectUnion__' |
| 1231 ..typeKey = 'test_unions_ObjectUnion__' |
| 1232 )), |
| 1233 new mojom_types.StructField() |
| 1234 ..declData = (new mojom_types.DeclarationData() |
| 1235 ..shortName = 'FInt8') |
| 1236 ..type = (new mojom_types.Type() |
| 1237 ..simpleType = mojom_types.SimpleType.int8),]; |
| 1238 } |
| 1239 |
958 | 1240 |
959 class TryNonNullStruct extends bindings.Struct { | 1241 class TryNonNullStruct extends bindings.Struct { |
960 static const List<bindings.StructDataHeader> kVersions = const [ | 1242 static const List<bindings.StructDataHeader> kVersions = const [ |
961 const bindings.StructDataHeader(24, 0) | 1243 const bindings.StructDataHeader(24, 0) |
962 ]; | 1244 ]; |
963 DummyStruct nullable = null; | 1245 DummyStruct nullable = null; |
964 DummyStruct nonNullable = null; | 1246 DummyStruct nonNullable = null; |
965 | 1247 |
966 TryNonNullStruct() : super(kVersions.last.size); | 1248 TryNonNullStruct() : super(kVersions.last.size); |
967 | 1249 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 } | 1308 } |
1027 | 1309 |
1028 Map toJson() { | 1310 Map toJson() { |
1029 Map map = new Map(); | 1311 Map map = new Map(); |
1030 map["nullable"] = nullable; | 1312 map["nullable"] = nullable; |
1031 map["nonNullable"] = nonNullable; | 1313 map["nonNullable"] = nonNullable; |
1032 return map; | 1314 return map; |
1033 } | 1315 } |
1034 } | 1316 } |
1035 | 1317 |
| 1318 mojom_types.MojomStruct _testUnionsTryNonNullStruct() { |
| 1319 return new mojom_types.MojomStruct() |
| 1320 ..declData = (new mojom_types.DeclarationData() |
| 1321 ..shortName = 'TryNonNullStruct' |
| 1322 ..fullIdentifier = 'mojo.test.TryNonNullStruct') |
| 1323 ..fields = <mojom_types.StructField>[ |
| 1324 new mojom_types.StructField() |
| 1325 ..declData = (new mojom_types.DeclarationData() |
| 1326 ..shortName = 'Nullable') |
| 1327 ..type = (new mojom_types.Type() |
| 1328 ..typeReference = (new mojom_types.TypeReference() |
| 1329 ..nullable = true |
| 1330 |
| 1331 ..identifier = 'test_unions_DummyStruct__' |
| 1332 ..typeKey = 'test_unions_DummyStruct__' |
| 1333 )), |
| 1334 new mojom_types.StructField() |
| 1335 ..declData = (new mojom_types.DeclarationData() |
| 1336 ..shortName = 'NonNullable') |
| 1337 ..type = (new mojom_types.Type() |
| 1338 ..typeReference = (new mojom_types.TypeReference() |
| 1339 ..identifier = 'test_unions_DummyStruct__' |
| 1340 ..typeKey = 'test_unions_DummyStruct__' |
| 1341 )),]; |
| 1342 } |
| 1343 |
1036 | 1344 |
1037 class IncludingStruct extends bindings.Struct { | 1345 class IncludingStruct extends bindings.Struct { |
1038 static const List<bindings.StructDataHeader> kVersions = const [ | 1346 static const List<bindings.StructDataHeader> kVersions = const [ |
1039 const bindings.StructDataHeader(24, 0) | 1347 const bindings.StructDataHeader(24, 0) |
1040 ]; | 1348 ]; |
1041 test_included_unions_mojom.IncludedUnion a = null; | 1349 test_included_unions_mojom.IncludedUnion a = null; |
1042 | 1350 |
1043 IncludingStruct() : super(kVersions.last.size); | 1351 IncludingStruct() : super(kVersions.last.size); |
1044 | 1352 |
1045 static IncludingStruct deserialize(bindings.Message message) { | 1353 static IncludingStruct deserialize(bindings.Message message) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 "a: $a" ")"; | 1405 "a: $a" ")"; |
1098 } | 1406 } |
1099 | 1407 |
1100 Map toJson() { | 1408 Map toJson() { |
1101 Map map = new Map(); | 1409 Map map = new Map(); |
1102 map["a"] = a; | 1410 map["a"] = a; |
1103 return map; | 1411 return map; |
1104 } | 1412 } |
1105 } | 1413 } |
1106 | 1414 |
| 1415 mojom_types.MojomStruct _testUnionsIncludingStruct() { |
| 1416 return new mojom_types.MojomStruct() |
| 1417 ..declData = (new mojom_types.DeclarationData() |
| 1418 ..shortName = 'IncludingStruct' |
| 1419 ..fullIdentifier = 'mojo.test.IncludingStruct') |
| 1420 ..fields = <mojom_types.StructField>[ |
| 1421 new mojom_types.StructField() |
| 1422 ..declData = (new mojom_types.DeclarationData() |
| 1423 ..shortName = 'A') |
| 1424 ..type = (new mojom_types.Type() |
| 1425 ..typeReference = (new mojom_types.TypeReference() |
| 1426 ..identifier = 'test_included_unions_IncludedUnion__' |
| 1427 ..typeKey = 'test_included_unions_IncludedUnion__' |
| 1428 )),]; |
| 1429 } |
| 1430 |
1107 | 1431 |
1108 class _SmallCacheSetIntValueParams extends bindings.Struct { | 1432 class _SmallCacheSetIntValueParams extends bindings.Struct { |
1109 static const List<bindings.StructDataHeader> kVersions = const [ | 1433 static const List<bindings.StructDataHeader> kVersions = const [ |
1110 const bindings.StructDataHeader(16, 0) | 1434 const bindings.StructDataHeader(16, 0) |
1111 ]; | 1435 ]; |
1112 int intValue = 0; | 1436 int intValue = 0; |
1113 | 1437 |
1114 _SmallCacheSetIntValueParams() : super(kVersions.last.size); | 1438 _SmallCacheSetIntValueParams() : super(kVersions.last.size); |
1115 | 1439 |
1116 static _SmallCacheSetIntValueParams deserialize(bindings.Message message) { | 1440 static _SmallCacheSetIntValueParams deserialize(bindings.Message message) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 "intValue: $intValue" ")"; | 1488 "intValue: $intValue" ")"; |
1165 } | 1489 } |
1166 | 1490 |
1167 Map toJson() { | 1491 Map toJson() { |
1168 Map map = new Map(); | 1492 Map map = new Map(); |
1169 map["intValue"] = intValue; | 1493 map["intValue"] = intValue; |
1170 return map; | 1494 return map; |
1171 } | 1495 } |
1172 } | 1496 } |
1173 | 1497 |
| 1498 mojom_types.MojomStruct _testUnionsSmallCacheSetIntValueParams() { |
| 1499 return new mojom_types.MojomStruct() |
| 1500 ..declData = (new mojom_types.DeclarationData() |
| 1501 ..shortName = 'SmallCacheSetIntValueParams' |
| 1502 ..fullIdentifier = 'mojo.test.SmallCache_SetIntValue_Params') |
| 1503 ..fields = <mojom_types.StructField>[ |
| 1504 new mojom_types.StructField() |
| 1505 ..declData = (new mojom_types.DeclarationData() |
| 1506 ..shortName = 'IntValue') |
| 1507 ..type = (new mojom_types.Type() |
| 1508 ..simpleType = mojom_types.SimpleType.int64),]; |
| 1509 } |
| 1510 |
1174 | 1511 |
1175 class _SmallCacheGetIntValueParams extends bindings.Struct { | 1512 class _SmallCacheGetIntValueParams extends bindings.Struct { |
1176 static const List<bindings.StructDataHeader> kVersions = const [ | 1513 static const List<bindings.StructDataHeader> kVersions = const [ |
1177 const bindings.StructDataHeader(8, 0) | 1514 const bindings.StructDataHeader(8, 0) |
1178 ]; | 1515 ]; |
1179 | 1516 |
1180 _SmallCacheGetIntValueParams() : super(kVersions.last.size); | 1517 _SmallCacheGetIntValueParams() : super(kVersions.last.size); |
1181 | 1518 |
1182 static _SmallCacheGetIntValueParams deserialize(bindings.Message message) { | 1519 static _SmallCacheGetIntValueParams deserialize(bindings.Message message) { |
1183 var decoder = new bindings.Decoder(message); | 1520 var decoder = new bindings.Decoder(message); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 String toString() { | 1559 String toString() { |
1223 return "_SmallCacheGetIntValueParams("")"; | 1560 return "_SmallCacheGetIntValueParams("")"; |
1224 } | 1561 } |
1225 | 1562 |
1226 Map toJson() { | 1563 Map toJson() { |
1227 Map map = new Map(); | 1564 Map map = new Map(); |
1228 return map; | 1565 return map; |
1229 } | 1566 } |
1230 } | 1567 } |
1231 | 1568 |
| 1569 mojom_types.MojomStruct _testUnionsSmallCacheGetIntValueParams() { |
| 1570 return new mojom_types.MojomStruct() |
| 1571 ..declData = (new mojom_types.DeclarationData() |
| 1572 ..shortName = 'SmallCacheGetIntValueParams' |
| 1573 ..fullIdentifier = 'mojo.test.SmallCache_GetIntValue_Params') |
| 1574 ..fields = <mojom_types.StructField>[]; |
| 1575 } |
| 1576 |
1232 | 1577 |
1233 class SmallCacheGetIntValueResponseParams extends bindings.Struct { | 1578 class SmallCacheGetIntValueResponseParams extends bindings.Struct { |
1234 static const List<bindings.StructDataHeader> kVersions = const [ | 1579 static const List<bindings.StructDataHeader> kVersions = const [ |
1235 const bindings.StructDataHeader(16, 0) | 1580 const bindings.StructDataHeader(16, 0) |
1236 ]; | 1581 ]; |
1237 int intValue = 0; | 1582 int intValue = 0; |
1238 | 1583 |
1239 SmallCacheGetIntValueResponseParams() : super(kVersions.last.size); | 1584 SmallCacheGetIntValueResponseParams() : super(kVersions.last.size); |
1240 | 1585 |
1241 static SmallCacheGetIntValueResponseParams deserialize(bindings.Message messag
e) { | 1586 static SmallCacheGetIntValueResponseParams deserialize(bindings.Message messag
e) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 "intValue: $intValue" ")"; | 1634 "intValue: $intValue" ")"; |
1290 } | 1635 } |
1291 | 1636 |
1292 Map toJson() { | 1637 Map toJson() { |
1293 Map map = new Map(); | 1638 Map map = new Map(); |
1294 map["intValue"] = intValue; | 1639 map["intValue"] = intValue; |
1295 return map; | 1640 return map; |
1296 } | 1641 } |
1297 } | 1642 } |
1298 | 1643 |
| 1644 mojom_types.MojomStruct _testUnionsSmallCacheGetIntValueResponseParams() { |
| 1645 return new mojom_types.MojomStruct() |
| 1646 ..declData = (new mojom_types.DeclarationData() |
| 1647 ..shortName = 'SmallCacheGetIntValueResponseParams' |
| 1648 ..fullIdentifier = 'mojo.test.SmallCache_GetIntValue_ResponseParams') |
| 1649 ..fields = <mojom_types.StructField>[ |
| 1650 new mojom_types.StructField() |
| 1651 ..declData = (new mojom_types.DeclarationData() |
| 1652 ..shortName = 'IntValue') |
| 1653 ..type = (new mojom_types.Type() |
| 1654 ..simpleType = mojom_types.SimpleType.int64),]; |
| 1655 } |
| 1656 |
1299 | 1657 |
1300 class _UnionInterfaceEchoParams extends bindings.Struct { | 1658 class _UnionInterfaceEchoParams extends bindings.Struct { |
1301 static const List<bindings.StructDataHeader> kVersions = const [ | 1659 static const List<bindings.StructDataHeader> kVersions = const [ |
1302 const bindings.StructDataHeader(24, 0) | 1660 const bindings.StructDataHeader(24, 0) |
1303 ]; | 1661 ]; |
1304 PodUnion inVal = null; | 1662 PodUnion inVal = null; |
1305 | 1663 |
1306 _UnionInterfaceEchoParams() : super(kVersions.last.size); | 1664 _UnionInterfaceEchoParams() : super(kVersions.last.size); |
1307 | 1665 |
1308 static _UnionInterfaceEchoParams deserialize(bindings.Message message) { | 1666 static _UnionInterfaceEchoParams deserialize(bindings.Message message) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 "inVal: $inVal" ")"; | 1718 "inVal: $inVal" ")"; |
1361 } | 1719 } |
1362 | 1720 |
1363 Map toJson() { | 1721 Map toJson() { |
1364 Map map = new Map(); | 1722 Map map = new Map(); |
1365 map["inVal"] = inVal; | 1723 map["inVal"] = inVal; |
1366 return map; | 1724 return map; |
1367 } | 1725 } |
1368 } | 1726 } |
1369 | 1727 |
| 1728 mojom_types.MojomStruct _testUnionsUnionInterfaceEchoParams() { |
| 1729 return new mojom_types.MojomStruct() |
| 1730 ..declData = (new mojom_types.DeclarationData() |
| 1731 ..shortName = 'UnionInterfaceEchoParams' |
| 1732 ..fullIdentifier = 'mojo.test.UnionInterface_Echo_Params') |
| 1733 ..fields = <mojom_types.StructField>[ |
| 1734 new mojom_types.StructField() |
| 1735 ..declData = (new mojom_types.DeclarationData() |
| 1736 ..shortName = 'InVal') |
| 1737 ..type = (new mojom_types.Type() |
| 1738 ..typeReference = (new mojom_types.TypeReference() |
| 1739 ..identifier = 'test_unions_PodUnion__' |
| 1740 ..typeKey = 'test_unions_PodUnion__' |
| 1741 )),]; |
| 1742 } |
| 1743 |
1370 | 1744 |
1371 class UnionInterfaceEchoResponseParams extends bindings.Struct { | 1745 class UnionInterfaceEchoResponseParams extends bindings.Struct { |
1372 static const List<bindings.StructDataHeader> kVersions = const [ | 1746 static const List<bindings.StructDataHeader> kVersions = const [ |
1373 const bindings.StructDataHeader(24, 0) | 1747 const bindings.StructDataHeader(24, 0) |
1374 ]; | 1748 ]; |
1375 PodUnion outVal = null; | 1749 PodUnion outVal = null; |
1376 | 1750 |
1377 UnionInterfaceEchoResponseParams() : super(kVersions.last.size); | 1751 UnionInterfaceEchoResponseParams() : super(kVersions.last.size); |
1378 | 1752 |
1379 static UnionInterfaceEchoResponseParams deserialize(bindings.Message message)
{ | 1753 static UnionInterfaceEchoResponseParams deserialize(bindings.Message message)
{ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 "outVal: $outVal" ")"; | 1805 "outVal: $outVal" ")"; |
1432 } | 1806 } |
1433 | 1807 |
1434 Map toJson() { | 1808 Map toJson() { |
1435 Map map = new Map(); | 1809 Map map = new Map(); |
1436 map["outVal"] = outVal; | 1810 map["outVal"] = outVal; |
1437 return map; | 1811 return map; |
1438 } | 1812 } |
1439 } | 1813 } |
1440 | 1814 |
| 1815 mojom_types.MojomStruct _testUnionsUnionInterfaceEchoResponseParams() { |
| 1816 return new mojom_types.MojomStruct() |
| 1817 ..declData = (new mojom_types.DeclarationData() |
| 1818 ..shortName = 'UnionInterfaceEchoResponseParams' |
| 1819 ..fullIdentifier = 'mojo.test.UnionInterface_Echo_ResponseParams') |
| 1820 ..fields = <mojom_types.StructField>[ |
| 1821 new mojom_types.StructField() |
| 1822 ..declData = (new mojom_types.DeclarationData() |
| 1823 ..shortName = 'OutVal') |
| 1824 ..type = (new mojom_types.Type() |
| 1825 ..typeReference = (new mojom_types.TypeReference() |
| 1826 ..identifier = 'test_unions_PodUnion__' |
| 1827 ..typeKey = 'test_unions_PodUnion__' |
| 1828 )),]; |
| 1829 } |
| 1830 |
1441 | 1831 |
1442 | 1832 |
1443 enum PodUnionTag { | 1833 enum PodUnionTag { |
1444 fInt8, | 1834 fInt8, |
1445 fInt8Other, | 1835 fInt8Other, |
1446 fUint8, | 1836 fUint8, |
1447 fInt16, | 1837 fInt16, |
1448 fUint16, | 1838 fUint16, |
1449 fInt32, | 1839 fInt32, |
1450 fUint32, | 1840 fUint32, |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 result += "fEnum"; | 2206 result += "fEnum"; |
1817 break; | 2207 break; |
1818 default: | 2208 default: |
1819 result += "unknown"; | 2209 result += "unknown"; |
1820 } | 2210 } |
1821 result += ": $_data)"; | 2211 result += ": $_data)"; |
1822 return result; | 2212 return result; |
1823 } | 2213 } |
1824 } | 2214 } |
1825 | 2215 |
| 2216 mojom_types.MojomUnion _testUnionsPodUnion() { |
| 2217 return new mojom_types.MojomUnion() |
| 2218 ..declData = (new mojom_types.DeclarationData() |
| 2219 ..shortName = 'PodUnion' |
| 2220 ..fullIdentifier = 'mojo.test.PodUnion') |
| 2221 ..fields = <mojom_types.UnionField>[ |
| 2222 new mojom_types.UnionField() |
| 2223 ..declData = (new mojom_types.DeclarationData() |
| 2224 ..shortName = 'FInt8') |
| 2225 ..type = (new mojom_types.Type() |
| 2226 ..simpleType = mojom_types.SimpleType.int8) |
| 2227 ..tag = 0, |
| 2228 new mojom_types.UnionField() |
| 2229 ..declData = (new mojom_types.DeclarationData() |
| 2230 ..shortName = 'FInt8Other') |
| 2231 ..type = (new mojom_types.Type() |
| 2232 ..simpleType = mojom_types.SimpleType.int8) |
| 2233 ..tag = 1, |
| 2234 new mojom_types.UnionField() |
| 2235 ..declData = (new mojom_types.DeclarationData() |
| 2236 ..shortName = 'FUint8') |
| 2237 ..type = (new mojom_types.Type() |
| 2238 ..simpleType = mojom_types.SimpleType.uint8) |
| 2239 ..tag = 2, |
| 2240 new mojom_types.UnionField() |
| 2241 ..declData = (new mojom_types.DeclarationData() |
| 2242 ..shortName = 'FInt16') |
| 2243 ..type = (new mojom_types.Type() |
| 2244 ..simpleType = mojom_types.SimpleType.int16) |
| 2245 ..tag = 3, |
| 2246 new mojom_types.UnionField() |
| 2247 ..declData = (new mojom_types.DeclarationData() |
| 2248 ..shortName = 'FUint16') |
| 2249 ..type = (new mojom_types.Type() |
| 2250 ..simpleType = mojom_types.SimpleType.uint16) |
| 2251 ..tag = 4, |
| 2252 new mojom_types.UnionField() |
| 2253 ..declData = (new mojom_types.DeclarationData() |
| 2254 ..shortName = 'FInt32') |
| 2255 ..type = (new mojom_types.Type() |
| 2256 ..simpleType = mojom_types.SimpleType.int32) |
| 2257 ..tag = 5, |
| 2258 new mojom_types.UnionField() |
| 2259 ..declData = (new mojom_types.DeclarationData() |
| 2260 ..shortName = 'FUint32') |
| 2261 ..type = (new mojom_types.Type() |
| 2262 ..simpleType = mojom_types.SimpleType.uint32) |
| 2263 ..tag = 6, |
| 2264 new mojom_types.UnionField() |
| 2265 ..declData = (new mojom_types.DeclarationData() |
| 2266 ..shortName = 'FInt64') |
| 2267 ..type = (new mojom_types.Type() |
| 2268 ..simpleType = mojom_types.SimpleType.int64) |
| 2269 ..tag = 7, |
| 2270 new mojom_types.UnionField() |
| 2271 ..declData = (new mojom_types.DeclarationData() |
| 2272 ..shortName = 'FUint64') |
| 2273 ..type = (new mojom_types.Type() |
| 2274 ..simpleType = mojom_types.SimpleType.uint64) |
| 2275 ..tag = 8, |
| 2276 new mojom_types.UnionField() |
| 2277 ..declData = (new mojom_types.DeclarationData() |
| 2278 ..shortName = 'FFloat') |
| 2279 ..type = (new mojom_types.Type() |
| 2280 ..simpleType = mojom_types.SimpleType.float) |
| 2281 ..tag = 9, |
| 2282 new mojom_types.UnionField() |
| 2283 ..declData = (new mojom_types.DeclarationData() |
| 2284 ..shortName = 'FDouble') |
| 2285 ..type = (new mojom_types.Type() |
| 2286 ..simpleType = mojom_types.SimpleType.double) |
| 2287 ..tag = 10, |
| 2288 new mojom_types.UnionField() |
| 2289 ..declData = (new mojom_types.DeclarationData() |
| 2290 ..shortName = 'FBool') |
| 2291 ..type = (new mojom_types.Type() |
| 2292 ..simpleType = mojom_types.SimpleType.bool) |
| 2293 ..tag = 11, |
| 2294 new mojom_types.UnionField() |
| 2295 ..declData = (new mojom_types.DeclarationData() |
| 2296 ..shortName = 'FEnum') |
| 2297 ..type = (new mojom_types.Type() |
| 2298 ..typeReference = (new mojom_types.TypeReference() |
| 2299 ..identifier = 'test_unions_AnEnum__' |
| 2300 ..typeKey = 'test_unions_AnEnum__' |
| 2301 )) |
| 2302 ..tag = 12,]; |
| 2303 } |
| 2304 |
1826 | 2305 |
1827 enum UnionOfUnionsTag { | 2306 enum UnionOfUnionsTag { |
1828 u, | 2307 u, |
1829 aOu, | 2308 aOu, |
1830 aHu, | 2309 aHu, |
1831 mOu, | 2310 mOu, |
1832 mHu, | 2311 mHu, |
1833 unknown | 2312 unknown |
1834 } | 2313 } |
1835 | 2314 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 result += "mHu"; | 2602 result += "mHu"; |
2124 break; | 2603 break; |
2125 default: | 2604 default: |
2126 result += "unknown"; | 2605 result += "unknown"; |
2127 } | 2606 } |
2128 result += ": $_data)"; | 2607 result += ": $_data)"; |
2129 return result; | 2608 return result; |
2130 } | 2609 } |
2131 } | 2610 } |
2132 | 2611 |
| 2612 mojom_types.MojomUnion _testUnionsUnionOfUnions() { |
| 2613 return new mojom_types.MojomUnion() |
| 2614 ..declData = (new mojom_types.DeclarationData() |
| 2615 ..shortName = 'UnionOfUnions' |
| 2616 ..fullIdentifier = 'mojo.test.UnionOfUnions') |
| 2617 ..fields = <mojom_types.UnionField>[ |
| 2618 new mojom_types.UnionField() |
| 2619 ..declData = (new mojom_types.DeclarationData() |
| 2620 ..shortName = 'U') |
| 2621 ..type = (new mojom_types.Type() |
| 2622 ..typeReference = (new mojom_types.TypeReference() |
| 2623 ..identifier = 'test_unions_ObjectUnion__' |
| 2624 ..typeKey = 'test_unions_ObjectUnion__' |
| 2625 )) |
| 2626 ..tag = 0, |
| 2627 new mojom_types.UnionField() |
| 2628 ..declData = (new mojom_types.DeclarationData() |
| 2629 ..shortName = 'AOu') |
| 2630 ..type = (new mojom_types.Type() |
| 2631 ..arrayType = (new mojom_types.ArrayType() |
| 2632 ..elementType = (new mojom_types.Type() |
| 2633 ..typeReference = (new mojom_types.TypeReference() |
| 2634 ..identifier = 'test_unions_ObjectUnion__' |
| 2635 ..typeKey = 'test_unions_ObjectUnion__' |
| 2636 )))) |
| 2637 ..tag = 1, |
| 2638 new mojom_types.UnionField() |
| 2639 ..declData = (new mojom_types.DeclarationData() |
| 2640 ..shortName = 'AHu') |
| 2641 ..type = (new mojom_types.Type() |
| 2642 ..arrayType = (new mojom_types.ArrayType() |
| 2643 ..elementType = (new mojom_types.Type() |
| 2644 ..typeReference = (new mojom_types.TypeReference() |
| 2645 ..identifier = 'test_unions_HandleUnion__' |
| 2646 ..typeKey = 'test_unions_HandleUnion__' |
| 2647 )))) |
| 2648 ..tag = 2, |
| 2649 new mojom_types.UnionField() |
| 2650 ..declData = (new mojom_types.DeclarationData() |
| 2651 ..shortName = 'MOu') |
| 2652 ..type = (new mojom_types.Type() |
| 2653 ..mapType = (new mojom_types.MapType() |
| 2654 ..keyType = (new mojom_types.Type() |
| 2655 ..simpleType = mojom_types.SimpleType.int64) |
| 2656 ..valueType = (new mojom_types.Type() |
| 2657 ..typeReference = (new mojom_types.TypeReference() |
| 2658 ..identifier = 'test_unions_ObjectUnion__' |
| 2659 ..typeKey = 'test_unions_ObjectUnion__' |
| 2660 )))) |
| 2661 ..tag = 3, |
| 2662 new mojom_types.UnionField() |
| 2663 ..declData = (new mojom_types.DeclarationData() |
| 2664 ..shortName = 'MHu') |
| 2665 ..type = (new mojom_types.Type() |
| 2666 ..mapType = (new mojom_types.MapType() |
| 2667 ..keyType = (new mojom_types.Type() |
| 2668 ..simpleType = mojom_types.SimpleType.int64) |
| 2669 ..valueType = (new mojom_types.Type() |
| 2670 ..typeReference = (new mojom_types.TypeReference() |
| 2671 ..identifier = 'test_unions_HandleUnion__' |
| 2672 ..typeKey = 'test_unions_HandleUnion__' |
| 2673 )))) |
| 2674 ..tag = 4,]; |
| 2675 } |
| 2676 |
2133 | 2677 |
2134 enum ObjectUnionTag { | 2678 enum ObjectUnionTag { |
2135 fInt8, | 2679 fInt8, |
2136 fString, | 2680 fString, |
2137 fDummy, | 2681 fDummy, |
2138 fNullable, | 2682 fNullable, |
2139 fArrayInt8, | 2683 fArrayInt8, |
2140 fMapInt8, | 2684 fMapInt8, |
2141 fPodUnion, | 2685 fPodUnion, |
2142 unknown | 2686 unknown |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 result += "fPodUnion"; | 2938 result += "fPodUnion"; |
2395 break; | 2939 break; |
2396 default: | 2940 default: |
2397 result += "unknown"; | 2941 result += "unknown"; |
2398 } | 2942 } |
2399 result += ": $_data)"; | 2943 result += ": $_data)"; |
2400 return result; | 2944 return result; |
2401 } | 2945 } |
2402 } | 2946 } |
2403 | 2947 |
| 2948 mojom_types.MojomUnion _testUnionsObjectUnion() { |
| 2949 return new mojom_types.MojomUnion() |
| 2950 ..declData = (new mojom_types.DeclarationData() |
| 2951 ..shortName = 'ObjectUnion' |
| 2952 ..fullIdentifier = 'mojo.test.ObjectUnion') |
| 2953 ..fields = <mojom_types.UnionField>[ |
| 2954 new mojom_types.UnionField() |
| 2955 ..declData = (new mojom_types.DeclarationData() |
| 2956 ..shortName = 'FInt8') |
| 2957 ..type = (new mojom_types.Type() |
| 2958 ..simpleType = mojom_types.SimpleType.int8) |
| 2959 ..tag = 0, |
| 2960 new mojom_types.UnionField() |
| 2961 ..declData = (new mojom_types.DeclarationData() |
| 2962 ..shortName = 'FString') |
| 2963 ..type = (new mojom_types.Type() |
| 2964 ..stringType = (new mojom_types.StringType())) |
| 2965 ..tag = 1, |
| 2966 new mojom_types.UnionField() |
| 2967 ..declData = (new mojom_types.DeclarationData() |
| 2968 ..shortName = 'FDummy') |
| 2969 ..type = (new mojom_types.Type() |
| 2970 ..typeReference = (new mojom_types.TypeReference() |
| 2971 ..identifier = 'test_unions_DummyStruct__' |
| 2972 ..typeKey = 'test_unions_DummyStruct__' |
| 2973 )) |
| 2974 ..tag = 2, |
| 2975 new mojom_types.UnionField() |
| 2976 ..declData = (new mojom_types.DeclarationData() |
| 2977 ..shortName = 'FNullable') |
| 2978 ..type = (new mojom_types.Type() |
| 2979 ..typeReference = (new mojom_types.TypeReference() |
| 2980 ..nullable = true |
| 2981 |
| 2982 ..identifier = 'test_unions_DummyStruct__' |
| 2983 ..typeKey = 'test_unions_DummyStruct__' |
| 2984 )) |
| 2985 ..tag = 3, |
| 2986 new mojom_types.UnionField() |
| 2987 ..declData = (new mojom_types.DeclarationData() |
| 2988 ..shortName = 'FArrayInt8') |
| 2989 ..type = (new mojom_types.Type() |
| 2990 ..arrayType = (new mojom_types.ArrayType() |
| 2991 ..elementType = (new mojom_types.Type() |
| 2992 ..simpleType = mojom_types.SimpleType.int8))) |
| 2993 ..tag = 4, |
| 2994 new mojom_types.UnionField() |
| 2995 ..declData = (new mojom_types.DeclarationData() |
| 2996 ..shortName = 'FMapInt8') |
| 2997 ..type = (new mojom_types.Type() |
| 2998 ..mapType = (new mojom_types.MapType() |
| 2999 ..keyType = (new mojom_types.Type() |
| 3000 ..stringType = (new mojom_types.StringType())) |
| 3001 ..valueType = (new mojom_types.Type() |
| 3002 ..simpleType = mojom_types.SimpleType.int8))) |
| 3003 ..tag = 5, |
| 3004 new mojom_types.UnionField() |
| 3005 ..declData = (new mojom_types.DeclarationData() |
| 3006 ..shortName = 'FPodUnion') |
| 3007 ..type = (new mojom_types.Type() |
| 3008 ..typeReference = (new mojom_types.TypeReference() |
| 3009 ..identifier = 'test_unions_PodUnion__' |
| 3010 ..typeKey = 'test_unions_PodUnion__' |
| 3011 )) |
| 3012 ..tag = 6,]; |
| 3013 } |
| 3014 |
2404 | 3015 |
2405 enum HandleUnionTag { | 3016 enum HandleUnionTag { |
2406 fHandle, | 3017 fHandle, |
2407 fMessagePipe, | 3018 fMessagePipe, |
2408 fDataPipeConsumer, | 3019 fDataPipeConsumer, |
2409 fDataPipeProducer, | 3020 fDataPipeProducer, |
2410 fSharedBuffer, | 3021 fSharedBuffer, |
2411 fSmallCache, | 3022 fSmallCache, |
2412 unknown | 3023 unknown |
2413 } | 3024 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 result += "fSmallCache"; | 3210 result += "fSmallCache"; |
2600 break; | 3211 break; |
2601 default: | 3212 default: |
2602 result += "unknown"; | 3213 result += "unknown"; |
2603 } | 3214 } |
2604 result += ": $_data)"; | 3215 result += ": $_data)"; |
2605 return result; | 3216 return result; |
2606 } | 3217 } |
2607 } | 3218 } |
2608 | 3219 |
| 3220 mojom_types.MojomUnion _testUnionsHandleUnion() { |
| 3221 return new mojom_types.MojomUnion() |
| 3222 ..declData = (new mojom_types.DeclarationData() |
| 3223 ..shortName = 'HandleUnion' |
| 3224 ..fullIdentifier = 'mojo.test.HandleUnion') |
| 3225 ..fields = <mojom_types.UnionField>[ |
| 3226 new mojom_types.UnionField() |
| 3227 ..declData = (new mojom_types.DeclarationData() |
| 3228 ..shortName = 'FHandle') |
| 3229 ..type = (new mojom_types.Type() |
| 3230 ..handleType = (new mojom_types.HandleType() |
| 3231 ..kind = mojom_types.HandleTypeKind.unspecified)) |
| 3232 ..tag = 0, |
| 3233 new mojom_types.UnionField() |
| 3234 ..declData = (new mojom_types.DeclarationData() |
| 3235 ..shortName = 'FMessagePipe') |
| 3236 ..type = (new mojom_types.Type() |
| 3237 ..handleType = (new mojom_types.HandleType() |
| 3238 ..kind = mojom_types.HandleTypeKind.messagePipe)) |
| 3239 ..tag = 1, |
| 3240 new mojom_types.UnionField() |
| 3241 ..declData = (new mojom_types.DeclarationData() |
| 3242 ..shortName = 'FDataPipeConsumer') |
| 3243 ..type = (new mojom_types.Type() |
| 3244 ..handleType = (new mojom_types.HandleType() |
| 3245 ..kind = mojom_types.HandleTypeKind.dataPipeConsumer)) |
| 3246 ..tag = 2, |
| 3247 new mojom_types.UnionField() |
| 3248 ..declData = (new mojom_types.DeclarationData() |
| 3249 ..shortName = 'FDataPipeProducer') |
| 3250 ..type = (new mojom_types.Type() |
| 3251 ..handleType = (new mojom_types.HandleType() |
| 3252 ..kind = mojom_types.HandleTypeKind.dataPipeProducer)) |
| 3253 ..tag = 3, |
| 3254 new mojom_types.UnionField() |
| 3255 ..declData = (new mojom_types.DeclarationData() |
| 3256 ..shortName = 'FSharedBuffer') |
| 3257 ..type = (new mojom_types.Type() |
| 3258 ..handleType = (new mojom_types.HandleType() |
| 3259 ..kind = mojom_types.HandleTypeKind.sharedBuffer)) |
| 3260 ..tag = 4, |
| 3261 new mojom_types.UnionField() |
| 3262 ..declData = (new mojom_types.DeclarationData() |
| 3263 ..shortName = 'FSmallCache') |
| 3264 ..type = (new mojom_types.Type() |
| 3265 ..typeReference = (new mojom_types.TypeReference() |
| 3266 ..identifier = 'test_unions_SmallCache__' |
| 3267 ..typeKey = 'test_unions_SmallCache__' |
| 3268 )) |
| 3269 ..tag = 5,]; |
| 3270 } |
| 3271 |
2609 | 3272 |
2610 enum ObjectOnlyUnionTag { | 3273 enum ObjectOnlyUnionTag { |
2611 dummy1, | 3274 dummy1, |
2612 unknown | 3275 unknown |
2613 } | 3276 } |
2614 | 3277 |
2615 class ObjectOnlyUnion extends bindings.Union { | 3278 class ObjectOnlyUnion extends bindings.Union { |
2616 static final _tag_to_int = const { | 3279 static final _tag_to_int = const { |
2617 ObjectOnlyUnionTag.dummy1: 0, | 3280 ObjectOnlyUnionTag.dummy1: 0, |
2618 }; | 3281 }; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2680 result += "dummy1"; | 3343 result += "dummy1"; |
2681 break; | 3344 break; |
2682 default: | 3345 default: |
2683 result += "unknown"; | 3346 result += "unknown"; |
2684 } | 3347 } |
2685 result += ": $_data)"; | 3348 result += ": $_data)"; |
2686 return result; | 3349 return result; |
2687 } | 3350 } |
2688 } | 3351 } |
2689 | 3352 |
| 3353 mojom_types.MojomUnion _testUnionsObjectOnlyUnion() { |
| 3354 return new mojom_types.MojomUnion() |
| 3355 ..declData = (new mojom_types.DeclarationData() |
| 3356 ..shortName = 'ObjectOnlyUnion' |
| 3357 ..fullIdentifier = 'mojo.test.ObjectOnlyUnion') |
| 3358 ..fields = <mojom_types.UnionField>[ |
| 3359 new mojom_types.UnionField() |
| 3360 ..declData = (new mojom_types.DeclarationData() |
| 3361 ..shortName = 'Dummy1') |
| 3362 ..type = (new mojom_types.Type() |
| 3363 ..typeReference = (new mojom_types.TypeReference() |
| 3364 ..identifier = 'test_unions_DummyStruct__' |
| 3365 ..typeKey = 'test_unions_DummyStruct__' |
| 3366 )) |
| 3367 ..tag = 0,]; |
| 3368 } |
| 3369 |
2690 | 3370 |
2691 enum OldUnionTag { | 3371 enum OldUnionTag { |
2692 fInt8, | 3372 fInt8, |
2693 unknown | 3373 unknown |
2694 } | 3374 } |
2695 | 3375 |
2696 class OldUnion extends bindings.Union { | 3376 class OldUnion extends bindings.Union { |
2697 static final _tag_to_int = const { | 3377 static final _tag_to_int = const { |
2698 OldUnionTag.fInt8: 0, | 3378 OldUnionTag.fInt8: 0, |
2699 }; | 3379 }; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2760 result += "fInt8"; | 3440 result += "fInt8"; |
2761 break; | 3441 break; |
2762 default: | 3442 default: |
2763 result += "unknown"; | 3443 result += "unknown"; |
2764 } | 3444 } |
2765 result += ": $_data)"; | 3445 result += ": $_data)"; |
2766 return result; | 3446 return result; |
2767 } | 3447 } |
2768 } | 3448 } |
2769 | 3449 |
| 3450 mojom_types.MojomUnion _testUnionsOldUnion() { |
| 3451 return new mojom_types.MojomUnion() |
| 3452 ..declData = (new mojom_types.DeclarationData() |
| 3453 ..shortName = 'OldUnion' |
| 3454 ..fullIdentifier = 'mojo.test.OldUnion') |
| 3455 ..fields = <mojom_types.UnionField>[ |
| 3456 new mojom_types.UnionField() |
| 3457 ..declData = (new mojom_types.DeclarationData() |
| 3458 ..shortName = 'FInt8') |
| 3459 ..type = (new mojom_types.Type() |
| 3460 ..simpleType = mojom_types.SimpleType.int8) |
| 3461 ..tag = 0,]; |
| 3462 } |
| 3463 |
2770 | 3464 |
2771 enum NewUnionTag { | 3465 enum NewUnionTag { |
2772 fInt8, | 3466 fInt8, |
2773 fInt16, | 3467 fInt16, |
2774 unknown | 3468 unknown |
2775 } | 3469 } |
2776 | 3470 |
2777 class NewUnion extends bindings.Union { | 3471 class NewUnion extends bindings.Union { |
2778 static final _tag_to_int = const { | 3472 static final _tag_to_int = const { |
2779 NewUnionTag.fInt8: 0, | 3473 NewUnionTag.fInt8: 0, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2864 case NewUnionTag.fInt16: | 3558 case NewUnionTag.fInt16: |
2865 result += "fInt16"; | 3559 result += "fInt16"; |
2866 break; | 3560 break; |
2867 default: | 3561 default: |
2868 result += "unknown"; | 3562 result += "unknown"; |
2869 } | 3563 } |
2870 result += ": $_data)"; | 3564 result += ": $_data)"; |
2871 return result; | 3565 return result; |
2872 } | 3566 } |
2873 } | 3567 } |
| 3568 |
| 3569 mojom_types.MojomUnion _testUnionsNewUnion() { |
| 3570 return new mojom_types.MojomUnion() |
| 3571 ..declData = (new mojom_types.DeclarationData() |
| 3572 ..shortName = 'NewUnion' |
| 3573 ..fullIdentifier = 'mojo.test.NewUnion') |
| 3574 ..fields = <mojom_types.UnionField>[ |
| 3575 new mojom_types.UnionField() |
| 3576 ..declData = (new mojom_types.DeclarationData() |
| 3577 ..shortName = 'FInt8') |
| 3578 ..type = (new mojom_types.Type() |
| 3579 ..simpleType = mojom_types.SimpleType.int8) |
| 3580 ..tag = 0, |
| 3581 new mojom_types.UnionField() |
| 3582 ..declData = (new mojom_types.DeclarationData() |
| 3583 ..shortName = 'FInt16') |
| 3584 ..type = (new mojom_types.Type() |
| 3585 ..simpleType = mojom_types.SimpleType.int16) |
| 3586 ..tag = 1,]; |
| 3587 } |
| 3588 |
2874 const int _SmallCache_setIntValueName = 0; | 3589 const int _SmallCache_setIntValueName = 0; |
2875 const int _SmallCache_getIntValueName = 1; | 3590 const int _SmallCache_getIntValueName = 1; |
2876 | 3591 |
| 3592 mojom_types.MojomInterface _testUnionsSmallCache() { |
| 3593 return new mojom_types.MojomInterface() |
| 3594 ..declData = (new mojom_types.DeclarationData() |
| 3595 ..shortName = 'SmallCache' |
| 3596 ..fullIdentifier = 'mojo.test.SmallCache') |
| 3597 ..interfaceName = 'SmallCache' |
| 3598 ..methods = <int, mojom_types.MojomMethod>{ |
| 3599 _SmallCache_setIntValueName: new mojom_types.MojomMethod() |
| 3600 ..declData = (new mojom_types.DeclarationData() |
| 3601 ..shortName = 'SetIntValue') |
| 3602 ..ordinal = _SmallCache_setIntValueName |
| 3603 ..parameters = _testUnionsSmallCacheSetIntValueParams(), |
| 3604 _SmallCache_getIntValueName: new mojom_types.MojomMethod() |
| 3605 ..declData = (new mojom_types.DeclarationData() |
| 3606 ..shortName = 'GetIntValue') |
| 3607 ..ordinal = _SmallCache_getIntValueName |
| 3608 ..responseParams = _testUnionsSmallCacheGetIntValueResponseParams() |
| 3609 ..parameters = _testUnionsSmallCacheGetIntValueParams(), |
| 3610 }; |
| 3611 } |
| 3612 |
| 3613 class _SmallCacheServiceDescription implements service_describer.ServiceDescript
ion { |
| 3614 dynamic getTopLevelInterface([Function responseFactory]) => |
| 3615 _testUnionsSmallCache(); |
| 3616 |
| 3617 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 3618 getAllMojomTypeDefinitions()[typeKey]; |
| 3619 |
| 3620 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 3621 getAllMojomTypeDefinitions(); |
| 3622 } |
| 3623 |
2877 abstract class SmallCache { | 3624 abstract class SmallCache { |
2878 static const String serviceName = null; | 3625 static const String serviceName = null; |
2879 void setIntValue(int intValue); | 3626 void setIntValue(int intValue); |
2880 dynamic getIntValue([Function responseFactory = null]); | 3627 dynamic getIntValue([Function responseFactory = null]); |
2881 } | 3628 } |
2882 | 3629 |
2883 | 3630 |
2884 class _SmallCacheProxyImpl extends bindings.Proxy { | 3631 class _SmallCacheProxyImpl extends bindings.Proxy { |
2885 _SmallCacheProxyImpl.fromEndpoint( | 3632 _SmallCacheProxyImpl.fromEndpoint( |
2886 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 3633 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
2887 | 3634 |
2888 _SmallCacheProxyImpl.fromHandle(core.MojoHandle handle) : | 3635 _SmallCacheProxyImpl.fromHandle(core.MojoHandle handle) : |
2889 super.fromHandle(handle); | 3636 super.fromHandle(handle); |
2890 | 3637 |
2891 _SmallCacheProxyImpl.unbound() : super.unbound(); | 3638 _SmallCacheProxyImpl.unbound() : super.unbound(); |
2892 | 3639 |
2893 static _SmallCacheProxyImpl newFromEndpoint( | 3640 static _SmallCacheProxyImpl newFromEndpoint( |
2894 core.MojoMessagePipeEndpoint endpoint) { | 3641 core.MojoMessagePipeEndpoint endpoint) { |
2895 assert(endpoint.setDescription("For _SmallCacheProxyImpl")); | 3642 assert(endpoint.setDescription("For _SmallCacheProxyImpl")); |
2896 return new _SmallCacheProxyImpl.fromEndpoint(endpoint); | 3643 return new _SmallCacheProxyImpl.fromEndpoint(endpoint); |
2897 } | 3644 } |
2898 | 3645 |
| 3646 service_describer.ServiceDescription get serviceDescription => |
| 3647 new _SmallCacheServiceDescription(); |
| 3648 |
2899 void handleResponse(bindings.ServiceMessage message) { | 3649 void handleResponse(bindings.ServiceMessage message) { |
2900 switch (message.header.type) { | 3650 switch (message.header.type) { |
2901 case _SmallCache_getIntValueName: | 3651 case _SmallCache_getIntValueName: |
2902 var r = SmallCacheGetIntValueResponseParams.deserialize( | 3652 var r = SmallCacheGetIntValueResponseParams.deserialize( |
2903 message.payload); | 3653 message.payload); |
2904 if (!message.header.hasRequestId) { | 3654 if (!message.header.hasRequestId) { |
2905 proxyError("Expected a message with a valid request Id."); | 3655 proxyError("Expected a message with a valid request Id."); |
2906 return; | 3656 return; |
2907 } | 3657 } |
2908 Completer c = completerMap[message.header.requestId]; | 3658 Completer c = completerMap[message.header.requestId]; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3087 assert(_impl == null); | 3837 assert(_impl == null); |
3088 _impl = d; | 3838 _impl = d; |
3089 } | 3839 } |
3090 | 3840 |
3091 String toString() { | 3841 String toString() { |
3092 var superString = super.toString(); | 3842 var superString = super.toString(); |
3093 return "SmallCacheStub($superString)"; | 3843 return "SmallCacheStub($superString)"; |
3094 } | 3844 } |
3095 | 3845 |
3096 int get version => 0; | 3846 int get version => 0; |
| 3847 |
| 3848 service_describer.ServiceDescription get serviceDescription => |
| 3849 new _SmallCacheServiceDescription(); |
3097 } | 3850 } |
3098 | 3851 |
3099 const int _UnionInterface_echoName = 0; | 3852 const int _UnionInterface_echoName = 0; |
3100 | 3853 |
| 3854 mojom_types.MojomInterface _testUnionsUnionInterface() { |
| 3855 return new mojom_types.MojomInterface() |
| 3856 ..declData = (new mojom_types.DeclarationData() |
| 3857 ..shortName = 'UnionInterface' |
| 3858 ..fullIdentifier = 'mojo.test.UnionInterface') |
| 3859 ..interfaceName = 'UnionInterface' |
| 3860 ..methods = <int, mojom_types.MojomMethod>{ |
| 3861 _UnionInterface_echoName: new mojom_types.MojomMethod() |
| 3862 ..declData = (new mojom_types.DeclarationData() |
| 3863 ..shortName = 'Echo') |
| 3864 ..ordinal = _UnionInterface_echoName |
| 3865 ..responseParams = _testUnionsUnionInterfaceEchoResponseParams() |
| 3866 ..parameters = _testUnionsUnionInterfaceEchoParams(), |
| 3867 }; |
| 3868 } |
| 3869 |
| 3870 class _UnionInterfaceServiceDescription implements service_describer.ServiceDesc
ription { |
| 3871 dynamic getTopLevelInterface([Function responseFactory]) => |
| 3872 _testUnionsUnionInterface(); |
| 3873 |
| 3874 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 3875 getAllMojomTypeDefinitions()[typeKey]; |
| 3876 |
| 3877 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 3878 getAllMojomTypeDefinitions(); |
| 3879 } |
| 3880 |
3101 abstract class UnionInterface { | 3881 abstract class UnionInterface { |
3102 static const String serviceName = null; | 3882 static const String serviceName = null; |
3103 dynamic echo(PodUnion inVal,[Function responseFactory = null]); | 3883 dynamic echo(PodUnion inVal,[Function responseFactory = null]); |
3104 } | 3884 } |
3105 | 3885 |
3106 | 3886 |
3107 class _UnionInterfaceProxyImpl extends bindings.Proxy { | 3887 class _UnionInterfaceProxyImpl extends bindings.Proxy { |
3108 _UnionInterfaceProxyImpl.fromEndpoint( | 3888 _UnionInterfaceProxyImpl.fromEndpoint( |
3109 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 3889 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
3110 | 3890 |
3111 _UnionInterfaceProxyImpl.fromHandle(core.MojoHandle handle) : | 3891 _UnionInterfaceProxyImpl.fromHandle(core.MojoHandle handle) : |
3112 super.fromHandle(handle); | 3892 super.fromHandle(handle); |
3113 | 3893 |
3114 _UnionInterfaceProxyImpl.unbound() : super.unbound(); | 3894 _UnionInterfaceProxyImpl.unbound() : super.unbound(); |
3115 | 3895 |
3116 static _UnionInterfaceProxyImpl newFromEndpoint( | 3896 static _UnionInterfaceProxyImpl newFromEndpoint( |
3117 core.MojoMessagePipeEndpoint endpoint) { | 3897 core.MojoMessagePipeEndpoint endpoint) { |
3118 assert(endpoint.setDescription("For _UnionInterfaceProxyImpl")); | 3898 assert(endpoint.setDescription("For _UnionInterfaceProxyImpl")); |
3119 return new _UnionInterfaceProxyImpl.fromEndpoint(endpoint); | 3899 return new _UnionInterfaceProxyImpl.fromEndpoint(endpoint); |
3120 } | 3900 } |
3121 | 3901 |
| 3902 service_describer.ServiceDescription get serviceDescription => |
| 3903 new _UnionInterfaceServiceDescription(); |
| 3904 |
3122 void handleResponse(bindings.ServiceMessage message) { | 3905 void handleResponse(bindings.ServiceMessage message) { |
3123 switch (message.header.type) { | 3906 switch (message.header.type) { |
3124 case _UnionInterface_echoName: | 3907 case _UnionInterface_echoName: |
3125 var r = UnionInterfaceEchoResponseParams.deserialize( | 3908 var r = UnionInterfaceEchoResponseParams.deserialize( |
3126 message.payload); | 3909 message.payload); |
3127 if (!message.header.hasRequestId) { | 3910 if (!message.header.hasRequestId) { |
3128 proxyError("Expected a message with a valid request Id."); | 3911 proxyError("Expected a message with a valid request Id."); |
3129 return; | 3912 return; |
3130 } | 3913 } |
3131 Completer c = completerMap[message.header.requestId]; | 3914 Completer c = completerMap[message.header.requestId]; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 assert(_impl == null); | 4080 assert(_impl == null); |
3298 _impl = d; | 4081 _impl = d; |
3299 } | 4082 } |
3300 | 4083 |
3301 String toString() { | 4084 String toString() { |
3302 var superString = super.toString(); | 4085 var superString = super.toString(); |
3303 return "UnionInterfaceStub($superString)"; | 4086 return "UnionInterfaceStub($superString)"; |
3304 } | 4087 } |
3305 | 4088 |
3306 int get version => 0; | 4089 int get version => 0; |
| 4090 |
| 4091 service_describer.ServiceDescription get serviceDescription => |
| 4092 new _UnionInterfaceServiceDescription(); |
3307 } | 4093 } |
3308 | 4094 |
3309 | 4095 |
| 4096 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 4097 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 4098 map["test_unions_AnEnum__"] = |
| 4099 new mojom_types.UserDefinedType() |
| 4100 ..enumType = _testUnionsAnEnum(); |
| 4101 map["test_unions_StructOfUnions__"] = |
| 4102 new mojom_types.UserDefinedType() |
| 4103 ..structType = _testUnionsStructOfUnions(); |
| 4104 map["test_unions_WrapperStruct__"] = |
| 4105 new mojom_types.UserDefinedType() |
| 4106 ..structType = _testUnionsWrapperStruct(); |
| 4107 map["test_unions_DummyStruct__"] = |
| 4108 new mojom_types.UserDefinedType() |
| 4109 ..structType = _testUnionsDummyStruct(); |
| 4110 map["test_unions_SmallStruct__"] = |
| 4111 new mojom_types.UserDefinedType() |
| 4112 ..structType = _testUnionsSmallStruct(); |
| 4113 map["test_unions_SmallStructNonNullableUnion__"] = |
| 4114 new mojom_types.UserDefinedType() |
| 4115 ..structType = _testUnionsSmallStructNonNullableUnion(); |
| 4116 map["test_unions_StructNullObjectUnion__"] = |
| 4117 new mojom_types.UserDefinedType() |
| 4118 ..structType = _testUnionsStructNullObjectUnion(); |
| 4119 map["test_unions_SmallObjStruct__"] = |
| 4120 new mojom_types.UserDefinedType() |
| 4121 ..structType = _testUnionsSmallObjStruct(); |
| 4122 map["test_unions_TryNonNullStruct__"] = |
| 4123 new mojom_types.UserDefinedType() |
| 4124 ..structType = _testUnionsTryNonNullStruct(); |
| 4125 map["test_unions_IncludingStruct__"] = |
| 4126 new mojom_types.UserDefinedType() |
| 4127 ..structType = _testUnionsIncludingStruct(); |
| 4128 map["test_unions_SmallCache_SetIntValue_Params__"] = |
| 4129 new mojom_types.UserDefinedType() |
| 4130 ..structType = _testUnionsSmallCacheSetIntValueParams(); |
| 4131 map["test_unions_SmallCache_GetIntValue_Params__"] = |
| 4132 new mojom_types.UserDefinedType() |
| 4133 ..structType = _testUnionsSmallCacheGetIntValueParams(); |
| 4134 map["test_unions_SmallCache_GetIntValue_ResponseParams__"] = |
| 4135 new mojom_types.UserDefinedType() |
| 4136 ..structType = _testUnionsSmallCacheGetIntValueResponseParams(); |
| 4137 map["test_unions_UnionInterface_Echo_Params__"] = |
| 4138 new mojom_types.UserDefinedType() |
| 4139 ..structType = _testUnionsUnionInterfaceEchoParams(); |
| 4140 map["test_unions_UnionInterface_Echo_ResponseParams__"] = |
| 4141 new mojom_types.UserDefinedType() |
| 4142 ..structType = _testUnionsUnionInterfaceEchoResponseParams(); |
| 4143 map["test_unions_PodUnion__"] = |
| 4144 new mojom_types.UserDefinedType() |
| 4145 ..unionType = _testUnionsPodUnion(); |
| 4146 map["test_unions_UnionOfUnions__"] = |
| 4147 new mojom_types.UserDefinedType() |
| 4148 ..unionType = _testUnionsUnionOfUnions(); |
| 4149 map["test_unions_ObjectUnion__"] = |
| 4150 new mojom_types.UserDefinedType() |
| 4151 ..unionType = _testUnionsObjectUnion(); |
| 4152 map["test_unions_HandleUnion__"] = |
| 4153 new mojom_types.UserDefinedType() |
| 4154 ..unionType = _testUnionsHandleUnion(); |
| 4155 map["test_unions_ObjectOnlyUnion__"] = |
| 4156 new mojom_types.UserDefinedType() |
| 4157 ..unionType = _testUnionsObjectOnlyUnion(); |
| 4158 map["test_unions_OldUnion__"] = |
| 4159 new mojom_types.UserDefinedType() |
| 4160 ..unionType = _testUnionsOldUnion(); |
| 4161 map["test_unions_NewUnion__"] = |
| 4162 new mojom_types.UserDefinedType() |
| 4163 ..unionType = _testUnionsNewUnion(); |
| 4164 map["test_unions_SmallCache__"] = |
| 4165 new mojom_types.UserDefinedType() |
| 4166 ..interfaceType = _testUnionsSmallCache(); |
| 4167 map["test_unions_UnionInterface__"] = |
| 4168 new mojom_types.UserDefinedType() |
| 4169 ..interfaceType = _testUnionsUnionInterface(); |
| 4170 test_included_unions_mojom.getAllMojomTypeDefinitions() |
| 4171 .forEach((String s, mojom_types.UserDefinedType udt) { |
| 4172 map[s] = udt; |
| 4173 }); |
| 4174 |
| 4175 return map; |
| 4176 } |
| 4177 |
| 4178 var _mojomDesc; |
| 4179 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 4180 if (_mojomDesc == null) { |
| 4181 _mojomDesc = _initDescriptions(); |
| 4182 } |
| 4183 return _mojomDesc; |
| 4184 } |
| 4185 |
OLD | NEW |