OLD | NEW |
1 // WARNING: DO NOT EDIT. This file was generated by a program. | 1 // WARNING: DO NOT EDIT. This file was generated by a program. |
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. | 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. |
3 | 3 |
4 library sample_factory_mojom; | 4 library sample_factory_mojom; |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
10 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
11 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; | 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; | 13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
14 import 'package:_mojo_for_test_only/imported/sample_import.mojom.dart' as sample
_import_mojom; | 14 import 'package:_mojo_for_test_only/imported/sample_import.mojom.dart' as sample
_import_mojom; |
15 | 15 |
16 | 16 |
17 | 17 |
18 class Request extends bindings.Struct { | 18 class Request extends bindings.Struct { |
19 static const List<bindings.StructDataHeader> kVersions = const [ | 19 static const List<bindings.StructDataHeader> kVersions = const [ |
20 const bindings.StructDataHeader(32, 0) | 20 const bindings.StructDataHeader(32, 0) |
21 ]; | 21 ]; |
22 int x = 0; | 22 int x = 0; |
23 core.MojoMessagePipeEndpoint pipe = null; | 23 core.MojoMessagePipeEndpoint pipe = null; |
24 List<core.MojoMessagePipeEndpoint> morePipes = null; | 24 List<core.MojoMessagePipeEndpoint> morePipes = null; |
25 sample_import_mojom.ImportedInterfaceInterface obj = null; | 25 sample_import_mojom.ImportedInterfaceInterface obj = null; |
26 | 26 |
27 Request() : super(kVersions.last.size); | 27 Request() : super(kVersions.last.size); |
28 | 28 |
| 29 Request.init( |
| 30 int this.x, |
| 31 core.MojoMessagePipeEndpoint this.pipe, |
| 32 List<core.MojoMessagePipeEndpoint> this.morePipes, |
| 33 sample_import_mojom.ImportedInterfaceInterface this.obj |
| 34 ) : super(kVersions.last.size); |
| 35 |
29 static Request deserialize(bindings.Message message) { | 36 static Request deserialize(bindings.Message message) { |
30 var decoder = new bindings.Decoder(message); | 37 var decoder = new bindings.Decoder(message); |
31 var result = decode(decoder); | 38 var result = decode(decoder); |
32 if (decoder.excessHandles != null) { | 39 if (decoder.excessHandles != null) { |
33 decoder.excessHandles.forEach((h) => h.close()); | 40 decoder.excessHandles.forEach((h) => h.close()); |
34 } | 41 } |
35 return result; | 42 return result; |
36 } | 43 } |
37 | 44 |
38 static Request decode(bindings.Decoder decoder0) { | 45 static Request decode(bindings.Decoder decoder0) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 134 |
128 class Response extends bindings.Struct { | 135 class Response extends bindings.Struct { |
129 static const List<bindings.StructDataHeader> kVersions = const [ | 136 static const List<bindings.StructDataHeader> kVersions = const [ |
130 const bindings.StructDataHeader(16, 0) | 137 const bindings.StructDataHeader(16, 0) |
131 ]; | 138 ]; |
132 int x = 0; | 139 int x = 0; |
133 core.MojoMessagePipeEndpoint pipe = null; | 140 core.MojoMessagePipeEndpoint pipe = null; |
134 | 141 |
135 Response() : super(kVersions.last.size); | 142 Response() : super(kVersions.last.size); |
136 | 143 |
| 144 Response.init( |
| 145 int this.x, |
| 146 core.MojoMessagePipeEndpoint this.pipe |
| 147 ) : super(kVersions.last.size); |
| 148 |
137 static Response deserialize(bindings.Message message) { | 149 static Response deserialize(bindings.Message message) { |
138 var decoder = new bindings.Decoder(message); | 150 var decoder = new bindings.Decoder(message); |
139 var result = decode(decoder); | 151 var result = decode(decoder); |
140 if (decoder.excessHandles != null) { | 152 if (decoder.excessHandles != null) { |
141 decoder.excessHandles.forEach((h) => h.close()); | 153 decoder.excessHandles.forEach((h) => h.close()); |
142 } | 154 } |
143 return result; | 155 return result; |
144 } | 156 } |
145 | 157 |
146 static Response decode(bindings.Decoder decoder0) { | 158 static Response decode(bindings.Decoder decoder0) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 222 |
211 | 223 |
212 class _NamedObjectSetNameParams extends bindings.Struct { | 224 class _NamedObjectSetNameParams extends bindings.Struct { |
213 static const List<bindings.StructDataHeader> kVersions = const [ | 225 static const List<bindings.StructDataHeader> kVersions = const [ |
214 const bindings.StructDataHeader(16, 0) | 226 const bindings.StructDataHeader(16, 0) |
215 ]; | 227 ]; |
216 String name = null; | 228 String name = null; |
217 | 229 |
218 _NamedObjectSetNameParams() : super(kVersions.last.size); | 230 _NamedObjectSetNameParams() : super(kVersions.last.size); |
219 | 231 |
| 232 _NamedObjectSetNameParams.init( |
| 233 String this.name |
| 234 ) : super(kVersions.last.size); |
| 235 |
220 static _NamedObjectSetNameParams deserialize(bindings.Message message) { | 236 static _NamedObjectSetNameParams deserialize(bindings.Message message) { |
221 var decoder = new bindings.Decoder(message); | 237 var decoder = new bindings.Decoder(message); |
222 var result = decode(decoder); | 238 var result = decode(decoder); |
223 if (decoder.excessHandles != null) { | 239 if (decoder.excessHandles != null) { |
224 decoder.excessHandles.forEach((h) => h.close()); | 240 decoder.excessHandles.forEach((h) => h.close()); |
225 } | 241 } |
226 return result; | 242 return result; |
227 } | 243 } |
228 | 244 |
229 static _NamedObjectSetNameParams decode(bindings.Decoder decoder0) { | 245 static _NamedObjectSetNameParams decode(bindings.Decoder decoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 297 } |
282 | 298 |
283 | 299 |
284 class _NamedObjectGetNameParams extends bindings.Struct { | 300 class _NamedObjectGetNameParams extends bindings.Struct { |
285 static const List<bindings.StructDataHeader> kVersions = const [ | 301 static const List<bindings.StructDataHeader> kVersions = const [ |
286 const bindings.StructDataHeader(8, 0) | 302 const bindings.StructDataHeader(8, 0) |
287 ]; | 303 ]; |
288 | 304 |
289 _NamedObjectGetNameParams() : super(kVersions.last.size); | 305 _NamedObjectGetNameParams() : super(kVersions.last.size); |
290 | 306 |
| 307 _NamedObjectGetNameParams.init( |
| 308 ) : super(kVersions.last.size); |
| 309 |
291 static _NamedObjectGetNameParams deserialize(bindings.Message message) { | 310 static _NamedObjectGetNameParams deserialize(bindings.Message message) { |
292 var decoder = new bindings.Decoder(message); | 311 var decoder = new bindings.Decoder(message); |
293 var result = decode(decoder); | 312 var result = decode(decoder); |
294 if (decoder.excessHandles != null) { | 313 if (decoder.excessHandles != null) { |
295 decoder.excessHandles.forEach((h) => h.close()); | 314 decoder.excessHandles.forEach((h) => h.close()); |
296 } | 315 } |
297 return result; | 316 return result; |
298 } | 317 } |
299 | 318 |
300 static _NamedObjectGetNameParams decode(bindings.Decoder decoder0) { | 319 static _NamedObjectGetNameParams decode(bindings.Decoder decoder0) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 359 |
341 | 360 |
342 class NamedObjectGetNameResponseParams extends bindings.Struct { | 361 class NamedObjectGetNameResponseParams extends bindings.Struct { |
343 static const List<bindings.StructDataHeader> kVersions = const [ | 362 static const List<bindings.StructDataHeader> kVersions = const [ |
344 const bindings.StructDataHeader(16, 0) | 363 const bindings.StructDataHeader(16, 0) |
345 ]; | 364 ]; |
346 String name = null; | 365 String name = null; |
347 | 366 |
348 NamedObjectGetNameResponseParams() : super(kVersions.last.size); | 367 NamedObjectGetNameResponseParams() : super(kVersions.last.size); |
349 | 368 |
| 369 NamedObjectGetNameResponseParams.init( |
| 370 String this.name |
| 371 ) : super(kVersions.last.size); |
| 372 |
350 static NamedObjectGetNameResponseParams deserialize(bindings.Message message)
{ | 373 static NamedObjectGetNameResponseParams deserialize(bindings.Message message)
{ |
351 var decoder = new bindings.Decoder(message); | 374 var decoder = new bindings.Decoder(message); |
352 var result = decode(decoder); | 375 var result = decode(decoder); |
353 if (decoder.excessHandles != null) { | 376 if (decoder.excessHandles != null) { |
354 decoder.excessHandles.forEach((h) => h.close()); | 377 decoder.excessHandles.forEach((h) => h.close()); |
355 } | 378 } |
356 return result; | 379 return result; |
357 } | 380 } |
358 | 381 |
359 static NamedObjectGetNameResponseParams decode(bindings.Decoder decoder0) { | 382 static NamedObjectGetNameResponseParams decode(bindings.Decoder decoder0) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 436 |
414 class _FactoryDoStuffParams extends bindings.Struct { | 437 class _FactoryDoStuffParams extends bindings.Struct { |
415 static const List<bindings.StructDataHeader> kVersions = const [ | 438 static const List<bindings.StructDataHeader> kVersions = const [ |
416 const bindings.StructDataHeader(24, 0) | 439 const bindings.StructDataHeader(24, 0) |
417 ]; | 440 ]; |
418 Request request = null; | 441 Request request = null; |
419 core.MojoMessagePipeEndpoint pipe = null; | 442 core.MojoMessagePipeEndpoint pipe = null; |
420 | 443 |
421 _FactoryDoStuffParams() : super(kVersions.last.size); | 444 _FactoryDoStuffParams() : super(kVersions.last.size); |
422 | 445 |
| 446 _FactoryDoStuffParams.init( |
| 447 Request this.request, |
| 448 core.MojoMessagePipeEndpoint this.pipe |
| 449 ) : super(kVersions.last.size); |
| 450 |
423 static _FactoryDoStuffParams deserialize(bindings.Message message) { | 451 static _FactoryDoStuffParams deserialize(bindings.Message message) { |
424 var decoder = new bindings.Decoder(message); | 452 var decoder = new bindings.Decoder(message); |
425 var result = decode(decoder); | 453 var result = decode(decoder); |
426 if (decoder.excessHandles != null) { | 454 if (decoder.excessHandles != null) { |
427 decoder.excessHandles.forEach((h) => h.close()); | 455 decoder.excessHandles.forEach((h) => h.close()); |
428 } | 456 } |
429 return result; | 457 return result; |
430 } | 458 } |
431 | 459 |
432 static _FactoryDoStuffParams decode(bindings.Decoder decoder0) { | 460 static _FactoryDoStuffParams decode(bindings.Decoder decoder0) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 526 |
499 class FactoryDoStuffResponseParams extends bindings.Struct { | 527 class FactoryDoStuffResponseParams extends bindings.Struct { |
500 static const List<bindings.StructDataHeader> kVersions = const [ | 528 static const List<bindings.StructDataHeader> kVersions = const [ |
501 const bindings.StructDataHeader(24, 0) | 529 const bindings.StructDataHeader(24, 0) |
502 ]; | 530 ]; |
503 Response response = null; | 531 Response response = null; |
504 String text = null; | 532 String text = null; |
505 | 533 |
506 FactoryDoStuffResponseParams() : super(kVersions.last.size); | 534 FactoryDoStuffResponseParams() : super(kVersions.last.size); |
507 | 535 |
| 536 FactoryDoStuffResponseParams.init( |
| 537 Response this.response, |
| 538 String this.text |
| 539 ) : super(kVersions.last.size); |
| 540 |
508 static FactoryDoStuffResponseParams deserialize(bindings.Message message) { | 541 static FactoryDoStuffResponseParams deserialize(bindings.Message message) { |
509 var decoder = new bindings.Decoder(message); | 542 var decoder = new bindings.Decoder(message); |
510 var result = decode(decoder); | 543 var result = decode(decoder); |
511 if (decoder.excessHandles != null) { | 544 if (decoder.excessHandles != null) { |
512 decoder.excessHandles.forEach((h) => h.close()); | 545 decoder.excessHandles.forEach((h) => h.close()); |
513 } | 546 } |
514 return result; | 547 return result; |
515 } | 548 } |
516 | 549 |
517 static FactoryDoStuffResponseParams decode(bindings.Decoder decoder0) { | 550 static FactoryDoStuffResponseParams decode(bindings.Decoder decoder0) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 615 |
583 | 616 |
584 class _FactoryDoStuff2Params extends bindings.Struct { | 617 class _FactoryDoStuff2Params extends bindings.Struct { |
585 static const List<bindings.StructDataHeader> kVersions = const [ | 618 static const List<bindings.StructDataHeader> kVersions = const [ |
586 const bindings.StructDataHeader(16, 0) | 619 const bindings.StructDataHeader(16, 0) |
587 ]; | 620 ]; |
588 core.MojoDataPipeConsumer pipe = null; | 621 core.MojoDataPipeConsumer pipe = null; |
589 | 622 |
590 _FactoryDoStuff2Params() : super(kVersions.last.size); | 623 _FactoryDoStuff2Params() : super(kVersions.last.size); |
591 | 624 |
| 625 _FactoryDoStuff2Params.init( |
| 626 core.MojoDataPipeConsumer this.pipe |
| 627 ) : super(kVersions.last.size); |
| 628 |
592 static _FactoryDoStuff2Params deserialize(bindings.Message message) { | 629 static _FactoryDoStuff2Params deserialize(bindings.Message message) { |
593 var decoder = new bindings.Decoder(message); | 630 var decoder = new bindings.Decoder(message); |
594 var result = decode(decoder); | 631 var result = decode(decoder); |
595 if (decoder.excessHandles != null) { | 632 if (decoder.excessHandles != null) { |
596 decoder.excessHandles.forEach((h) => h.close()); | 633 decoder.excessHandles.forEach((h) => h.close()); |
597 } | 634 } |
598 return result; | 635 return result; |
599 } | 636 } |
600 | 637 |
601 static _FactoryDoStuff2Params decode(bindings.Decoder decoder0) { | 638 static _FactoryDoStuff2Params decode(bindings.Decoder decoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 690 |
654 | 691 |
655 class FactoryDoStuff2ResponseParams extends bindings.Struct { | 692 class FactoryDoStuff2ResponseParams extends bindings.Struct { |
656 static const List<bindings.StructDataHeader> kVersions = const [ | 693 static const List<bindings.StructDataHeader> kVersions = const [ |
657 const bindings.StructDataHeader(16, 0) | 694 const bindings.StructDataHeader(16, 0) |
658 ]; | 695 ]; |
659 String text = null; | 696 String text = null; |
660 | 697 |
661 FactoryDoStuff2ResponseParams() : super(kVersions.last.size); | 698 FactoryDoStuff2ResponseParams() : super(kVersions.last.size); |
662 | 699 |
| 700 FactoryDoStuff2ResponseParams.init( |
| 701 String this.text |
| 702 ) : super(kVersions.last.size); |
| 703 |
663 static FactoryDoStuff2ResponseParams deserialize(bindings.Message message) { | 704 static FactoryDoStuff2ResponseParams deserialize(bindings.Message message) { |
664 var decoder = new bindings.Decoder(message); | 705 var decoder = new bindings.Decoder(message); |
665 var result = decode(decoder); | 706 var result = decode(decoder); |
666 if (decoder.excessHandles != null) { | 707 if (decoder.excessHandles != null) { |
667 decoder.excessHandles.forEach((h) => h.close()); | 708 decoder.excessHandles.forEach((h) => h.close()); |
668 } | 709 } |
669 return result; | 710 return result; |
670 } | 711 } |
671 | 712 |
672 static FactoryDoStuff2ResponseParams decode(bindings.Decoder decoder0) { | 713 static FactoryDoStuff2ResponseParams decode(bindings.Decoder decoder0) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 766 |
726 | 767 |
727 class _FactoryCreateNamedObjectParams extends bindings.Struct { | 768 class _FactoryCreateNamedObjectParams extends bindings.Struct { |
728 static const List<bindings.StructDataHeader> kVersions = const [ | 769 static const List<bindings.StructDataHeader> kVersions = const [ |
729 const bindings.StructDataHeader(16, 0) | 770 const bindings.StructDataHeader(16, 0) |
730 ]; | 771 ]; |
731 NamedObjectInterfaceRequest obj = null; | 772 NamedObjectInterfaceRequest obj = null; |
732 | 773 |
733 _FactoryCreateNamedObjectParams() : super(kVersions.last.size); | 774 _FactoryCreateNamedObjectParams() : super(kVersions.last.size); |
734 | 775 |
| 776 _FactoryCreateNamedObjectParams.init( |
| 777 NamedObjectInterfaceRequest this.obj |
| 778 ) : super(kVersions.last.size); |
| 779 |
735 static _FactoryCreateNamedObjectParams deserialize(bindings.Message message) { | 780 static _FactoryCreateNamedObjectParams deserialize(bindings.Message message) { |
736 var decoder = new bindings.Decoder(message); | 781 var decoder = new bindings.Decoder(message); |
737 var result = decode(decoder); | 782 var result = decode(decoder); |
738 if (decoder.excessHandles != null) { | 783 if (decoder.excessHandles != null) { |
739 decoder.excessHandles.forEach((h) => h.close()); | 784 decoder.excessHandles.forEach((h) => h.close()); |
740 } | 785 } |
741 return result; | 786 return result; |
742 } | 787 } |
743 | 788 |
744 static _FactoryCreateNamedObjectParams decode(bindings.Decoder decoder0) { | 789 static _FactoryCreateNamedObjectParams decode(bindings.Decoder decoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 841 |
797 | 842 |
798 class _FactoryRequestImportedInterfaceParams extends bindings.Struct { | 843 class _FactoryRequestImportedInterfaceParams extends bindings.Struct { |
799 static const List<bindings.StructDataHeader> kVersions = const [ | 844 static const List<bindings.StructDataHeader> kVersions = const [ |
800 const bindings.StructDataHeader(16, 0) | 845 const bindings.StructDataHeader(16, 0) |
801 ]; | 846 ]; |
802 sample_import_mojom.ImportedInterfaceInterfaceRequest obj = null; | 847 sample_import_mojom.ImportedInterfaceInterfaceRequest obj = null; |
803 | 848 |
804 _FactoryRequestImportedInterfaceParams() : super(kVersions.last.size); | 849 _FactoryRequestImportedInterfaceParams() : super(kVersions.last.size); |
805 | 850 |
| 851 _FactoryRequestImportedInterfaceParams.init( |
| 852 sample_import_mojom.ImportedInterfaceInterfaceRequest this.obj |
| 853 ) : super(kVersions.last.size); |
| 854 |
806 static _FactoryRequestImportedInterfaceParams deserialize(bindings.Message mes
sage) { | 855 static _FactoryRequestImportedInterfaceParams deserialize(bindings.Message mes
sage) { |
807 var decoder = new bindings.Decoder(message); | 856 var decoder = new bindings.Decoder(message); |
808 var result = decode(decoder); | 857 var result = decode(decoder); |
809 if (decoder.excessHandles != null) { | 858 if (decoder.excessHandles != null) { |
810 decoder.excessHandles.forEach((h) => h.close()); | 859 decoder.excessHandles.forEach((h) => h.close()); |
811 } | 860 } |
812 return result; | 861 return result; |
813 } | 862 } |
814 | 863 |
815 static _FactoryRequestImportedInterfaceParams decode(bindings.Decoder decoder0
) { | 864 static _FactoryRequestImportedInterfaceParams decode(bindings.Decoder decoder0
) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 916 |
868 | 917 |
869 class FactoryRequestImportedInterfaceResponseParams extends bindings.Struct { | 918 class FactoryRequestImportedInterfaceResponseParams extends bindings.Struct { |
870 static const List<bindings.StructDataHeader> kVersions = const [ | 919 static const List<bindings.StructDataHeader> kVersions = const [ |
871 const bindings.StructDataHeader(16, 0) | 920 const bindings.StructDataHeader(16, 0) |
872 ]; | 921 ]; |
873 sample_import_mojom.ImportedInterfaceInterfaceRequest obj = null; | 922 sample_import_mojom.ImportedInterfaceInterfaceRequest obj = null; |
874 | 923 |
875 FactoryRequestImportedInterfaceResponseParams() : super(kVersions.last.size); | 924 FactoryRequestImportedInterfaceResponseParams() : super(kVersions.last.size); |
876 | 925 |
| 926 FactoryRequestImportedInterfaceResponseParams.init( |
| 927 sample_import_mojom.ImportedInterfaceInterfaceRequest this.obj |
| 928 ) : super(kVersions.last.size); |
| 929 |
877 static FactoryRequestImportedInterfaceResponseParams deserialize(bindings.Mess
age message) { | 930 static FactoryRequestImportedInterfaceResponseParams deserialize(bindings.Mess
age message) { |
878 var decoder = new bindings.Decoder(message); | 931 var decoder = new bindings.Decoder(message); |
879 var result = decode(decoder); | 932 var result = decode(decoder); |
880 if (decoder.excessHandles != null) { | 933 if (decoder.excessHandles != null) { |
881 decoder.excessHandles.forEach((h) => h.close()); | 934 decoder.excessHandles.forEach((h) => h.close()); |
882 } | 935 } |
883 return result; | 936 return result; |
884 } | 937 } |
885 | 938 |
886 static FactoryRequestImportedInterfaceResponseParams decode(bindings.Decoder d
ecoder0) { | 939 static FactoryRequestImportedInterfaceResponseParams decode(bindings.Decoder d
ecoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 | 991 |
939 | 992 |
940 class _FactoryTakeImportedInterfaceParams extends bindings.Struct { | 993 class _FactoryTakeImportedInterfaceParams extends bindings.Struct { |
941 static const List<bindings.StructDataHeader> kVersions = const [ | 994 static const List<bindings.StructDataHeader> kVersions = const [ |
942 const bindings.StructDataHeader(16, 0) | 995 const bindings.StructDataHeader(16, 0) |
943 ]; | 996 ]; |
944 sample_import_mojom.ImportedInterfaceInterface obj = null; | 997 sample_import_mojom.ImportedInterfaceInterface obj = null; |
945 | 998 |
946 _FactoryTakeImportedInterfaceParams() : super(kVersions.last.size); | 999 _FactoryTakeImportedInterfaceParams() : super(kVersions.last.size); |
947 | 1000 |
| 1001 _FactoryTakeImportedInterfaceParams.init( |
| 1002 sample_import_mojom.ImportedInterfaceInterface this.obj |
| 1003 ) : super(kVersions.last.size); |
| 1004 |
948 static _FactoryTakeImportedInterfaceParams deserialize(bindings.Message messag
e) { | 1005 static _FactoryTakeImportedInterfaceParams deserialize(bindings.Message messag
e) { |
949 var decoder = new bindings.Decoder(message); | 1006 var decoder = new bindings.Decoder(message); |
950 var result = decode(decoder); | 1007 var result = decode(decoder); |
951 if (decoder.excessHandles != null) { | 1008 if (decoder.excessHandles != null) { |
952 decoder.excessHandles.forEach((h) => h.close()); | 1009 decoder.excessHandles.forEach((h) => h.close()); |
953 } | 1010 } |
954 return result; | 1011 return result; |
955 } | 1012 } |
956 | 1013 |
957 static _FactoryTakeImportedInterfaceParams decode(bindings.Decoder decoder0) { | 1014 static _FactoryTakeImportedInterfaceParams decode(bindings.Decoder decoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1066 |
1010 | 1067 |
1011 class FactoryTakeImportedInterfaceResponseParams extends bindings.Struct { | 1068 class FactoryTakeImportedInterfaceResponseParams extends bindings.Struct { |
1012 static const List<bindings.StructDataHeader> kVersions = const [ | 1069 static const List<bindings.StructDataHeader> kVersions = const [ |
1013 const bindings.StructDataHeader(16, 0) | 1070 const bindings.StructDataHeader(16, 0) |
1014 ]; | 1071 ]; |
1015 sample_import_mojom.ImportedInterfaceInterface obj = null; | 1072 sample_import_mojom.ImportedInterfaceInterface obj = null; |
1016 | 1073 |
1017 FactoryTakeImportedInterfaceResponseParams() : super(kVersions.last.size); | 1074 FactoryTakeImportedInterfaceResponseParams() : super(kVersions.last.size); |
1018 | 1075 |
| 1076 FactoryTakeImportedInterfaceResponseParams.init( |
| 1077 sample_import_mojom.ImportedInterfaceInterface this.obj |
| 1078 ) : super(kVersions.last.size); |
| 1079 |
1019 static FactoryTakeImportedInterfaceResponseParams deserialize(bindings.Message
message) { | 1080 static FactoryTakeImportedInterfaceResponseParams deserialize(bindings.Message
message) { |
1020 var decoder = new bindings.Decoder(message); | 1081 var decoder = new bindings.Decoder(message); |
1021 var result = decode(decoder); | 1082 var result = decode(decoder); |
1022 if (decoder.excessHandles != null) { | 1083 if (decoder.excessHandles != null) { |
1023 decoder.excessHandles.forEach((h) => h.close()); | 1084 decoder.excessHandles.forEach((h) => h.close()); |
1024 } | 1085 } |
1025 return result; | 1086 return result; |
1026 } | 1087 } |
1027 | 1088 |
1028 static FactoryTakeImportedInterfaceResponseParams decode(bindings.Decoder deco
der0) { | 1089 static FactoryTakeImportedInterfaceResponseParams decode(bindings.Decoder deco
der0) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 Map toJson() { | 1136 Map toJson() { |
1076 throw new bindings.MojoCodecError( | 1137 throw new bindings.MojoCodecError( |
1077 'Object containing handles cannot be encoded to JSON.'); | 1138 'Object containing handles cannot be encoded to JSON.'); |
1078 } | 1139 } |
1079 } | 1140 } |
1080 | 1141 |
1081 const int _namedObjectMethodSetNameName = 0; | 1142 const int _namedObjectMethodSetNameName = 0; |
1082 const int _namedObjectMethodGetNameName = 1; | 1143 const int _namedObjectMethodGetNameName = 1; |
1083 | 1144 |
1084 class _NamedObjectServiceDescription implements service_describer.ServiceDescrip
tion { | 1145 class _NamedObjectServiceDescription implements service_describer.ServiceDescrip
tion { |
1085 dynamic getTopLevelInterface([Function responseFactory]){ | 1146 void getTopLevelInterface(Function responder){ |
1086 var interfaceTypeKey = getRuntimeTypeInfo().services["sample::NamedObject"]; | 1147 var interfaceTypeKey = getRuntimeTypeInfo().services["sample::NamedObject"]; |
1087 var userDefinedType = getAllMojomTypeDefinitions()[interfaceTypeKey]; | 1148 var userDefinedType = getAllMojomTypeDefinitions()[interfaceTypeKey]; |
1088 return responseFactory(userDefinedType.interfaceType); | 1149 responder(userDefinedType.interfaceType); |
1089 } | 1150 } |
1090 | 1151 |
1091 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1152 void getTypeDefinition(String typeKey, Function responder) { |
1092 responseFactory(getAllMojomTypeDefinitions()[typeKey]); | 1153 responder(getAllMojomTypeDefinitions()[typeKey]); |
| 1154 } |
1093 | 1155 |
1094 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1156 void getAllTypeDefinitions(Function responder) { |
1095 responseFactory(getAllMojomTypeDefinitions()); | 1157 responder(getAllMojomTypeDefinitions()); |
| 1158 } |
1096 } | 1159 } |
1097 | 1160 |
1098 abstract class NamedObject { | 1161 abstract class NamedObject { |
1099 static const String serviceName = "sample::NamedObject"; | 1162 static const String serviceName = "sample::NamedObject"; |
1100 | 1163 |
1101 static service_describer.ServiceDescription _cachedServiceDescription; | 1164 static service_describer.ServiceDescription _cachedServiceDescription; |
1102 static service_describer.ServiceDescription get serviceDescription { | 1165 static service_describer.ServiceDescription get serviceDescription { |
1103 if (_cachedServiceDescription == null) { | 1166 if (_cachedServiceDescription == null) { |
1104 _cachedServiceDescription = new _NamedObjectServiceDescription(); | 1167 _cachedServiceDescription = new _NamedObjectServiceDescription(); |
1105 } | 1168 } |
1106 return _cachedServiceDescription; | 1169 return _cachedServiceDescription; |
1107 } | 1170 } |
1108 | 1171 |
1109 static NamedObjectProxy connectToService( | 1172 static NamedObjectProxy connectToService( |
1110 bindings.ServiceConnector s, String url, [String serviceName]) { | 1173 bindings.ServiceConnector s, String url, [String serviceName]) { |
1111 NamedObjectProxy p = new NamedObjectProxy.unbound(); | 1174 NamedObjectProxy p = new NamedObjectProxy.unbound(); |
1112 String name = serviceName ?? NamedObject.serviceName; | 1175 String name = serviceName ?? NamedObject.serviceName; |
1113 if ((name == null) || name.isEmpty) { | 1176 if ((name == null) || name.isEmpty) { |
1114 throw new core.MojoApiError( | 1177 throw new core.MojoApiError( |
1115 "If an interface has no ServiceName, then one must be provided."); | 1178 "If an interface has no ServiceName, then one must be provided."); |
1116 } | 1179 } |
1117 s.connectToService(url, p, name); | 1180 s.connectToService(url, p, name); |
1118 return p; | 1181 return p; |
1119 } | 1182 } |
1120 void setName(String name); | 1183 void setName(String name); |
1121 dynamic getName([Function responseFactory = null]); | 1184 void getName(void callback(String name)); |
1122 } | 1185 } |
1123 | 1186 |
1124 abstract class NamedObjectInterface | 1187 abstract class NamedObjectInterface |
1125 implements bindings.MojoInterface<NamedObject>, | 1188 implements bindings.MojoInterface<NamedObject>, |
1126 NamedObject { | 1189 NamedObject { |
1127 factory NamedObjectInterface([NamedObject impl]) => | 1190 factory NamedObjectInterface([NamedObject impl]) => |
1128 new NamedObjectStub.unbound(impl); | 1191 new NamedObjectStub.unbound(impl); |
1129 | 1192 |
1130 factory NamedObjectInterface.fromEndpoint( | 1193 factory NamedObjectInterface.fromEndpoint( |
1131 core.MojoMessagePipeEndpoint endpoint, | 1194 core.MojoMessagePipeEndpoint endpoint, |
(...skipping 29 matching lines...) Expand all Loading... |
1161 | 1224 |
1162 void handleResponse(bindings.ServiceMessage message) { | 1225 void handleResponse(bindings.ServiceMessage message) { |
1163 switch (message.header.type) { | 1226 switch (message.header.type) { |
1164 case _namedObjectMethodGetNameName: | 1227 case _namedObjectMethodGetNameName: |
1165 var r = NamedObjectGetNameResponseParams.deserialize( | 1228 var r = NamedObjectGetNameResponseParams.deserialize( |
1166 message.payload); | 1229 message.payload); |
1167 if (!message.header.hasRequestId) { | 1230 if (!message.header.hasRequestId) { |
1168 proxyError("Expected a message with a valid request Id."); | 1231 proxyError("Expected a message with a valid request Id."); |
1169 return; | 1232 return; |
1170 } | 1233 } |
1171 Completer c = completerMap[message.header.requestId]; | 1234 Function callback = callbackMap[message.header.requestId]; |
1172 if (c == null) { | 1235 if (callback == null) { |
1173 proxyError( | 1236 proxyError( |
1174 "Message had unknown request Id: ${message.header.requestId}"); | 1237 "Message had unknown request Id: ${message.header.requestId}"); |
1175 return; | 1238 return; |
1176 } | 1239 } |
1177 completerMap.remove(message.header.requestId); | 1240 callbackMap.remove(message.header.requestId); |
1178 if (c.isCompleted) { | 1241 callback(r.name ); |
1179 proxyError("Response completer already completed"); | |
1180 return; | |
1181 } | |
1182 c.complete(r); | |
1183 break; | 1242 break; |
1184 default: | 1243 default: |
1185 proxyError("Unexpected message type: ${message.header.type}"); | 1244 proxyError("Unexpected message type: ${message.header.type}"); |
1186 close(immediate: true); | 1245 close(immediate: true); |
1187 break; | 1246 break; |
1188 } | 1247 } |
1189 } | 1248 } |
1190 | 1249 |
1191 @override | 1250 @override |
1192 String toString() { | 1251 String toString() { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 } | 1290 } |
1232 if (!ctrl.isBound) { | 1291 if (!ctrl.isBound) { |
1233 ctrl.proxyError("The Proxy is closed."); | 1292 ctrl.proxyError("The Proxy is closed."); |
1234 return; | 1293 return; |
1235 } | 1294 } |
1236 var params = new _NamedObjectSetNameParams(); | 1295 var params = new _NamedObjectSetNameParams(); |
1237 params.name = name; | 1296 params.name = name; |
1238 ctrl.sendMessage(params, | 1297 ctrl.sendMessage(params, |
1239 _namedObjectMethodSetNameName); | 1298 _namedObjectMethodSetNameName); |
1240 } | 1299 } |
1241 dynamic getName([Function responseFactory = null]) { | 1300 void getName(void callback(String name)) { |
1242 if (impl != null) { | 1301 if (impl != null) { |
1243 return new Future(() => impl.getName(_NamedObjectStubControl._namedObjectG
etNameResponseParamsFactory)); | 1302 impl.getName(callback); |
| 1303 return; |
1244 } | 1304 } |
1245 var params = new _NamedObjectGetNameParams(); | 1305 var params = new _NamedObjectGetNameParams(); |
1246 return ctrl.sendMessageWithRequestId( | 1306 ctrl.sendMessageWithRequestId( |
1247 params, | 1307 params, |
1248 _namedObjectMethodGetNameName, | 1308 _namedObjectMethodGetNameName, |
1249 -1, | 1309 -1, |
1250 bindings.MessageHeader.kMessageExpectsResponse); | 1310 bindings.MessageHeader.kMessageExpectsResponse, |
| 1311 callback); |
1251 } | 1312 } |
1252 } | 1313 } |
1253 | 1314 |
1254 class _NamedObjectStubControl | 1315 class _NamedObjectStubControl |
1255 extends bindings.StubMessageHandler | 1316 extends bindings.StubMessageHandler |
1256 implements bindings.StubControl<NamedObject> { | 1317 implements bindings.StubControl<NamedObject> { |
1257 NamedObject _impl; | 1318 NamedObject _impl; |
1258 | 1319 |
1259 _NamedObjectStubControl.fromEndpoint( | 1320 _NamedObjectStubControl.fromEndpoint( |
1260 core.MojoMessagePipeEndpoint endpoint, [NamedObject impl]) | 1321 core.MojoMessagePipeEndpoint endpoint, [NamedObject impl]) |
1261 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1322 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1262 _impl = impl; | 1323 _impl = impl; |
1263 } | 1324 } |
1264 | 1325 |
1265 _NamedObjectStubControl.fromHandle( | 1326 _NamedObjectStubControl.fromHandle( |
1266 core.MojoHandle handle, [NamedObject impl]) | 1327 core.MojoHandle handle, [NamedObject impl]) |
1267 : super.fromHandle(handle, autoBegin: impl != null) { | 1328 : super.fromHandle(handle, autoBegin: impl != null) { |
1268 _impl = impl; | 1329 _impl = impl; |
1269 } | 1330 } |
1270 | 1331 |
1271 _NamedObjectStubControl.unbound([this._impl]) : super.unbound(); | 1332 _NamedObjectStubControl.unbound([this._impl]) : super.unbound(); |
1272 | 1333 |
1273 String get serviceName => NamedObject.serviceName; | 1334 String get serviceName => NamedObject.serviceName; |
1274 | 1335 |
1275 | 1336 |
1276 static NamedObjectGetNameResponseParams _namedObjectGetNameResponseParamsFacto
ry(String name) { | 1337 Function _namedObjectGetNameResponseParamsResponder( |
1277 var result = new NamedObjectGetNameResponseParams(); | 1338 int requestId) { |
1278 result.name = name; | 1339 return (String name) { |
1279 return result; | 1340 var result = new NamedObjectGetNameResponseParams(); |
| 1341 result.name = name; |
| 1342 sendResponse(buildResponseWithId( |
| 1343 result, |
| 1344 _namedObjectMethodGetNameName, |
| 1345 requestId, |
| 1346 bindings.MessageHeader.kMessageIsResponse)); |
| 1347 }; |
1280 } | 1348 } |
1281 | 1349 |
1282 dynamic handleMessage(bindings.ServiceMessage message) { | 1350 void handleMessage(bindings.ServiceMessage message) { |
1283 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1351 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1284 return bindings.ControlMessageHandler.handleMessage(this, | 1352 bindings.ControlMessageHandler.handleMessage( |
1285 0, | 1353 this, 0, message); |
1286 message); | 1354 return; |
1287 } | 1355 } |
1288 if (_impl == null) { | 1356 if (_impl == null) { |
1289 throw new core.MojoApiError("$this has no implementation set"); | 1357 throw new core.MojoApiError("$this has no implementation set"); |
1290 } | 1358 } |
1291 switch (message.header.type) { | 1359 switch (message.header.type) { |
1292 case _namedObjectMethodSetNameName: | 1360 case _namedObjectMethodSetNameName: |
1293 var params = _NamedObjectSetNameParams.deserialize( | 1361 var params = _NamedObjectSetNameParams.deserialize( |
1294 message.payload); | 1362 message.payload); |
1295 _impl.setName(params.name); | 1363 _impl.setName(params.name); |
1296 break; | 1364 break; |
1297 case _namedObjectMethodGetNameName: | 1365 case _namedObjectMethodGetNameName: |
1298 var response = _impl.getName(_namedObjectGetNameResponseParamsFactory); | 1366 _impl.getName(_namedObjectGetNameResponseParamsResponder(message.header.
requestId)); |
1299 if (response is Future) { | |
1300 return response.then((response) { | |
1301 if (response != null) { | |
1302 return buildResponseWithId( | |
1303 response, | |
1304 _namedObjectMethodGetNameName, | |
1305 message.header.requestId, | |
1306 bindings.MessageHeader.kMessageIsResponse); | |
1307 } | |
1308 }); | |
1309 } else if (response != null) { | |
1310 return buildResponseWithId( | |
1311 response, | |
1312 _namedObjectMethodGetNameName, | |
1313 message.header.requestId, | |
1314 bindings.MessageHeader.kMessageIsResponse); | |
1315 } | |
1316 break; | 1367 break; |
1317 default: | 1368 default: |
1318 throw new bindings.MojoCodecError("Unexpected message name"); | 1369 throw new bindings.MojoCodecError("Unexpected message name"); |
1319 break; | 1370 break; |
1320 } | 1371 } |
1321 return null; | |
1322 } | 1372 } |
1323 | 1373 |
1324 NamedObject get impl => _impl; | 1374 NamedObject get impl => _impl; |
1325 set impl(NamedObject d) { | 1375 set impl(NamedObject d) { |
1326 if (d == null) { | 1376 if (d == null) { |
1327 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1377 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
1328 } | 1378 } |
1329 if (isBound && (_impl == null)) { | 1379 if (isBound && (_impl == null)) { |
1330 beginHandlingEvents(); | 1380 beginHandlingEvents(); |
1331 } | 1381 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 static NamedObjectStub newFromEndpoint( | 1418 static NamedObjectStub newFromEndpoint( |
1369 core.MojoMessagePipeEndpoint endpoint) { | 1419 core.MojoMessagePipeEndpoint endpoint) { |
1370 assert(endpoint.setDescription("For NamedObjectStub")); | 1420 assert(endpoint.setDescription("For NamedObjectStub")); |
1371 return new NamedObjectStub.fromEndpoint(endpoint); | 1421 return new NamedObjectStub.fromEndpoint(endpoint); |
1372 } | 1422 } |
1373 | 1423 |
1374 | 1424 |
1375 void setName(String name) { | 1425 void setName(String name) { |
1376 return impl.setName(name); | 1426 return impl.setName(name); |
1377 } | 1427 } |
1378 dynamic getName([Function responseFactory = null]) { | 1428 void getName(void callback(String name)) { |
1379 return impl.getName(responseFactory); | 1429 return impl.getName(callback); |
1380 } | 1430 } |
1381 } | 1431 } |
1382 | 1432 |
1383 const int _factoryMethodDoStuffName = 0; | 1433 const int _factoryMethodDoStuffName = 0; |
1384 const int _factoryMethodDoStuff2Name = 1; | 1434 const int _factoryMethodDoStuff2Name = 1; |
1385 const int _factoryMethodCreateNamedObjectName = 2; | 1435 const int _factoryMethodCreateNamedObjectName = 2; |
1386 const int _factoryMethodRequestImportedInterfaceName = 3; | 1436 const int _factoryMethodRequestImportedInterfaceName = 3; |
1387 const int _factoryMethodTakeImportedInterfaceName = 4; | 1437 const int _factoryMethodTakeImportedInterfaceName = 4; |
1388 | 1438 |
1389 class _FactoryServiceDescription implements service_describer.ServiceDescription
{ | 1439 class _FactoryServiceDescription implements service_describer.ServiceDescription
{ |
1390 dynamic getTopLevelInterface([Function responseFactory]) => | 1440 void getTopLevelInterface(Function responder) { |
1391 responseFactory(null); | 1441 responder(null); |
| 1442 } |
1392 | 1443 |
1393 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1444 void getTypeDefinition(String typeKey, Function responder) { |
1394 responseFactory(null); | 1445 responder(null); |
| 1446 } |
1395 | 1447 |
1396 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1448 void getAllTypeDefinitions(Function responder) { |
1397 responseFactory(null); | 1449 responder(null); |
| 1450 } |
1398 } | 1451 } |
1399 | 1452 |
1400 abstract class Factory { | 1453 abstract class Factory { |
1401 static const String serviceName = null; | 1454 static const String serviceName = null; |
1402 | 1455 |
1403 static service_describer.ServiceDescription _cachedServiceDescription; | 1456 static service_describer.ServiceDescription _cachedServiceDescription; |
1404 static service_describer.ServiceDescription get serviceDescription { | 1457 static service_describer.ServiceDescription get serviceDescription { |
1405 if (_cachedServiceDescription == null) { | 1458 if (_cachedServiceDescription == null) { |
1406 _cachedServiceDescription = new _FactoryServiceDescription(); | 1459 _cachedServiceDescription = new _FactoryServiceDescription(); |
1407 } | 1460 } |
1408 return _cachedServiceDescription; | 1461 return _cachedServiceDescription; |
1409 } | 1462 } |
1410 | 1463 |
1411 static FactoryProxy connectToService( | 1464 static FactoryProxy connectToService( |
1412 bindings.ServiceConnector s, String url, [String serviceName]) { | 1465 bindings.ServiceConnector s, String url, [String serviceName]) { |
1413 FactoryProxy p = new FactoryProxy.unbound(); | 1466 FactoryProxy p = new FactoryProxy.unbound(); |
1414 String name = serviceName ?? Factory.serviceName; | 1467 String name = serviceName ?? Factory.serviceName; |
1415 if ((name == null) || name.isEmpty) { | 1468 if ((name == null) || name.isEmpty) { |
1416 throw new core.MojoApiError( | 1469 throw new core.MojoApiError( |
1417 "If an interface has no ServiceName, then one must be provided."); | 1470 "If an interface has no ServiceName, then one must be provided."); |
1418 } | 1471 } |
1419 s.connectToService(url, p, name); | 1472 s.connectToService(url, p, name); |
1420 return p; | 1473 return p; |
1421 } | 1474 } |
1422 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]); | 1475 void doStuff(Request request,core.MojoMessagePipeEndpoint pipe,void callback(R
esponse response, String text)); |
1423 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]); | 1476 void doStuff2(core.MojoDataPipeConsumer pipe,void callback(String text)); |
1424 void createNamedObject(NamedObjectInterfaceRequest obj); | 1477 void createNamedObject(NamedObjectInterfaceRequest obj); |
1425 dynamic requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfac
eRequest obj,[Function responseFactory = null]); | 1478 void requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfaceRe
quest obj,void callback(sample_import_mojom.ImportedInterfaceInterfaceRequest ob
j)); |
1426 dynamic takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface o
bj,[Function responseFactory = null]); | 1479 void takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface obj,
void callback(sample_import_mojom.ImportedInterfaceInterface obj)); |
1427 } | 1480 } |
1428 | 1481 |
1429 abstract class FactoryInterface | 1482 abstract class FactoryInterface |
1430 implements bindings.MojoInterface<Factory>, | 1483 implements bindings.MojoInterface<Factory>, |
1431 Factory { | 1484 Factory { |
1432 factory FactoryInterface([Factory impl]) => | 1485 factory FactoryInterface([Factory impl]) => |
1433 new FactoryStub.unbound(impl); | 1486 new FactoryStub.unbound(impl); |
1434 | 1487 |
1435 factory FactoryInterface.fromEndpoint( | 1488 factory FactoryInterface.fromEndpoint( |
1436 core.MojoMessagePipeEndpoint endpoint, | 1489 core.MojoMessagePipeEndpoint endpoint, |
(...skipping 29 matching lines...) Expand all Loading... |
1466 | 1519 |
1467 void handleResponse(bindings.ServiceMessage message) { | 1520 void handleResponse(bindings.ServiceMessage message) { |
1468 switch (message.header.type) { | 1521 switch (message.header.type) { |
1469 case _factoryMethodDoStuffName: | 1522 case _factoryMethodDoStuffName: |
1470 var r = FactoryDoStuffResponseParams.deserialize( | 1523 var r = FactoryDoStuffResponseParams.deserialize( |
1471 message.payload); | 1524 message.payload); |
1472 if (!message.header.hasRequestId) { | 1525 if (!message.header.hasRequestId) { |
1473 proxyError("Expected a message with a valid request Id."); | 1526 proxyError("Expected a message with a valid request Id."); |
1474 return; | 1527 return; |
1475 } | 1528 } |
1476 Completer c = completerMap[message.header.requestId]; | 1529 Function callback = callbackMap[message.header.requestId]; |
1477 if (c == null) { | 1530 if (callback == null) { |
1478 proxyError( | 1531 proxyError( |
1479 "Message had unknown request Id: ${message.header.requestId}"); | 1532 "Message had unknown request Id: ${message.header.requestId}"); |
1480 return; | 1533 return; |
1481 } | 1534 } |
1482 completerMap.remove(message.header.requestId); | 1535 callbackMap.remove(message.header.requestId); |
1483 if (c.isCompleted) { | 1536 callback(r.response , r.text ); |
1484 proxyError("Response completer already completed"); | |
1485 return; | |
1486 } | |
1487 c.complete(r); | |
1488 break; | 1537 break; |
1489 case _factoryMethodDoStuff2Name: | 1538 case _factoryMethodDoStuff2Name: |
1490 var r = FactoryDoStuff2ResponseParams.deserialize( | 1539 var r = FactoryDoStuff2ResponseParams.deserialize( |
1491 message.payload); | 1540 message.payload); |
1492 if (!message.header.hasRequestId) { | 1541 if (!message.header.hasRequestId) { |
1493 proxyError("Expected a message with a valid request Id."); | 1542 proxyError("Expected a message with a valid request Id."); |
1494 return; | 1543 return; |
1495 } | 1544 } |
1496 Completer c = completerMap[message.header.requestId]; | 1545 Function callback = callbackMap[message.header.requestId]; |
1497 if (c == null) { | 1546 if (callback == null) { |
1498 proxyError( | 1547 proxyError( |
1499 "Message had unknown request Id: ${message.header.requestId}"); | 1548 "Message had unknown request Id: ${message.header.requestId}"); |
1500 return; | 1549 return; |
1501 } | 1550 } |
1502 completerMap.remove(message.header.requestId); | 1551 callbackMap.remove(message.header.requestId); |
1503 if (c.isCompleted) { | 1552 callback(r.text ); |
1504 proxyError("Response completer already completed"); | |
1505 return; | |
1506 } | |
1507 c.complete(r); | |
1508 break; | 1553 break; |
1509 case _factoryMethodRequestImportedInterfaceName: | 1554 case _factoryMethodRequestImportedInterfaceName: |
1510 var r = FactoryRequestImportedInterfaceResponseParams.deserialize( | 1555 var r = FactoryRequestImportedInterfaceResponseParams.deserialize( |
1511 message.payload); | 1556 message.payload); |
1512 if (!message.header.hasRequestId) { | 1557 if (!message.header.hasRequestId) { |
1513 proxyError("Expected a message with a valid request Id."); | 1558 proxyError("Expected a message with a valid request Id."); |
1514 return; | 1559 return; |
1515 } | 1560 } |
1516 Completer c = completerMap[message.header.requestId]; | 1561 Function callback = callbackMap[message.header.requestId]; |
1517 if (c == null) { | 1562 if (callback == null) { |
1518 proxyError( | 1563 proxyError( |
1519 "Message had unknown request Id: ${message.header.requestId}"); | 1564 "Message had unknown request Id: ${message.header.requestId}"); |
1520 return; | 1565 return; |
1521 } | 1566 } |
1522 completerMap.remove(message.header.requestId); | 1567 callbackMap.remove(message.header.requestId); |
1523 if (c.isCompleted) { | 1568 callback(r.obj ); |
1524 proxyError("Response completer already completed"); | |
1525 return; | |
1526 } | |
1527 c.complete(r); | |
1528 break; | 1569 break; |
1529 case _factoryMethodTakeImportedInterfaceName: | 1570 case _factoryMethodTakeImportedInterfaceName: |
1530 var r = FactoryTakeImportedInterfaceResponseParams.deserialize( | 1571 var r = FactoryTakeImportedInterfaceResponseParams.deserialize( |
1531 message.payload); | 1572 message.payload); |
1532 if (!message.header.hasRequestId) { | 1573 if (!message.header.hasRequestId) { |
1533 proxyError("Expected a message with a valid request Id."); | 1574 proxyError("Expected a message with a valid request Id."); |
1534 return; | 1575 return; |
1535 } | 1576 } |
1536 Completer c = completerMap[message.header.requestId]; | 1577 Function callback = callbackMap[message.header.requestId]; |
1537 if (c == null) { | 1578 if (callback == null) { |
1538 proxyError( | 1579 proxyError( |
1539 "Message had unknown request Id: ${message.header.requestId}"); | 1580 "Message had unknown request Id: ${message.header.requestId}"); |
1540 return; | 1581 return; |
1541 } | 1582 } |
1542 completerMap.remove(message.header.requestId); | 1583 callbackMap.remove(message.header.requestId); |
1543 if (c.isCompleted) { | 1584 callback(r.obj ); |
1544 proxyError("Response completer already completed"); | |
1545 return; | |
1546 } | |
1547 c.complete(r); | |
1548 break; | 1585 break; |
1549 default: | 1586 default: |
1550 proxyError("Unexpected message type: ${message.header.type}"); | 1587 proxyError("Unexpected message type: ${message.header.type}"); |
1551 close(immediate: true); | 1588 close(immediate: true); |
1552 break; | 1589 break; |
1553 } | 1590 } |
1554 } | 1591 } |
1555 | 1592 |
1556 @override | 1593 @override |
1557 String toString() { | 1594 String toString() { |
(...skipping 24 matching lines...) Expand all Loading... |
1582 return newMockedProxy; | 1619 return newMockedProxy; |
1583 } | 1620 } |
1584 | 1621 |
1585 static FactoryProxy newFromEndpoint( | 1622 static FactoryProxy newFromEndpoint( |
1586 core.MojoMessagePipeEndpoint endpoint) { | 1623 core.MojoMessagePipeEndpoint endpoint) { |
1587 assert(endpoint.setDescription("For FactoryProxy")); | 1624 assert(endpoint.setDescription("For FactoryProxy")); |
1588 return new FactoryProxy.fromEndpoint(endpoint); | 1625 return new FactoryProxy.fromEndpoint(endpoint); |
1589 } | 1626 } |
1590 | 1627 |
1591 | 1628 |
1592 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]) { | 1629 void doStuff(Request request,core.MojoMessagePipeEndpoint pipe,void callback(R
esponse response, String text)) { |
1593 if (impl != null) { | 1630 if (impl != null) { |
1594 return new Future(() => impl.doStuff(request,pipe,_FactoryStubControl._fac
toryDoStuffResponseParamsFactory)); | 1631 impl.doStuff(request,pipe,callback); |
| 1632 return; |
1595 } | 1633 } |
1596 var params = new _FactoryDoStuffParams(); | 1634 var params = new _FactoryDoStuffParams(); |
1597 params.request = request; | 1635 params.request = request; |
1598 params.pipe = pipe; | 1636 params.pipe = pipe; |
1599 return ctrl.sendMessageWithRequestId( | 1637 ctrl.sendMessageWithRequestId( |
1600 params, | 1638 params, |
1601 _factoryMethodDoStuffName, | 1639 _factoryMethodDoStuffName, |
1602 -1, | 1640 -1, |
1603 bindings.MessageHeader.kMessageExpectsResponse); | 1641 bindings.MessageHeader.kMessageExpectsResponse, |
| 1642 callback); |
1604 } | 1643 } |
1605 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]) { | 1644 void doStuff2(core.MojoDataPipeConsumer pipe,void callback(String text)) { |
1606 if (impl != null) { | 1645 if (impl != null) { |
1607 return new Future(() => impl.doStuff2(pipe,_FactoryStubControl._factoryDoS
tuff2ResponseParamsFactory)); | 1646 impl.doStuff2(pipe,callback); |
| 1647 return; |
1608 } | 1648 } |
1609 var params = new _FactoryDoStuff2Params(); | 1649 var params = new _FactoryDoStuff2Params(); |
1610 params.pipe = pipe; | 1650 params.pipe = pipe; |
1611 return ctrl.sendMessageWithRequestId( | 1651 ctrl.sendMessageWithRequestId( |
1612 params, | 1652 params, |
1613 _factoryMethodDoStuff2Name, | 1653 _factoryMethodDoStuff2Name, |
1614 -1, | 1654 -1, |
1615 bindings.MessageHeader.kMessageExpectsResponse); | 1655 bindings.MessageHeader.kMessageExpectsResponse, |
| 1656 callback); |
1616 } | 1657 } |
1617 void createNamedObject(NamedObjectInterfaceRequest obj) { | 1658 void createNamedObject(NamedObjectInterfaceRequest obj) { |
1618 if (impl != null) { | 1659 if (impl != null) { |
1619 impl.createNamedObject(obj); | 1660 impl.createNamedObject(obj); |
1620 return; | 1661 return; |
1621 } | 1662 } |
1622 if (!ctrl.isBound) { | 1663 if (!ctrl.isBound) { |
1623 ctrl.proxyError("The Proxy is closed."); | 1664 ctrl.proxyError("The Proxy is closed."); |
1624 return; | 1665 return; |
1625 } | 1666 } |
1626 var params = new _FactoryCreateNamedObjectParams(); | 1667 var params = new _FactoryCreateNamedObjectParams(); |
1627 params.obj = obj; | 1668 params.obj = obj; |
1628 ctrl.sendMessage(params, | 1669 ctrl.sendMessage(params, |
1629 _factoryMethodCreateNamedObjectName); | 1670 _factoryMethodCreateNamedObjectName); |
1630 } | 1671 } |
1631 dynamic requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfac
eRequest obj,[Function responseFactory = null]) { | 1672 void requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfaceRe
quest obj,void callback(sample_import_mojom.ImportedInterfaceInterfaceRequest ob
j)) { |
1632 if (impl != null) { | 1673 if (impl != null) { |
1633 return new Future(() => impl.requestImportedInterface(obj,_FactoryStubCont
rol._factoryRequestImportedInterfaceResponseParamsFactory)); | 1674 impl.requestImportedInterface(obj,callback); |
| 1675 return; |
1634 } | 1676 } |
1635 var params = new _FactoryRequestImportedInterfaceParams(); | 1677 var params = new _FactoryRequestImportedInterfaceParams(); |
1636 params.obj = obj; | 1678 params.obj = obj; |
1637 return ctrl.sendMessageWithRequestId( | 1679 ctrl.sendMessageWithRequestId( |
1638 params, | 1680 params, |
1639 _factoryMethodRequestImportedInterfaceName, | 1681 _factoryMethodRequestImportedInterfaceName, |
1640 -1, | 1682 -1, |
1641 bindings.MessageHeader.kMessageExpectsResponse); | 1683 bindings.MessageHeader.kMessageExpectsResponse, |
| 1684 callback); |
1642 } | 1685 } |
1643 dynamic takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface o
bj,[Function responseFactory = null]) { | 1686 void takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface obj,
void callback(sample_import_mojom.ImportedInterfaceInterface obj)) { |
1644 if (impl != null) { | 1687 if (impl != null) { |
1645 return new Future(() => impl.takeImportedInterface(obj,_FactoryStubControl
._factoryTakeImportedInterfaceResponseParamsFactory)); | 1688 impl.takeImportedInterface(obj,callback); |
| 1689 return; |
1646 } | 1690 } |
1647 var params = new _FactoryTakeImportedInterfaceParams(); | 1691 var params = new _FactoryTakeImportedInterfaceParams(); |
1648 params.obj = obj; | 1692 params.obj = obj; |
1649 return ctrl.sendMessageWithRequestId( | 1693 ctrl.sendMessageWithRequestId( |
1650 params, | 1694 params, |
1651 _factoryMethodTakeImportedInterfaceName, | 1695 _factoryMethodTakeImportedInterfaceName, |
1652 -1, | 1696 -1, |
1653 bindings.MessageHeader.kMessageExpectsResponse); | 1697 bindings.MessageHeader.kMessageExpectsResponse, |
| 1698 callback); |
1654 } | 1699 } |
1655 } | 1700 } |
1656 | 1701 |
1657 class _FactoryStubControl | 1702 class _FactoryStubControl |
1658 extends bindings.StubMessageHandler | 1703 extends bindings.StubMessageHandler |
1659 implements bindings.StubControl<Factory> { | 1704 implements bindings.StubControl<Factory> { |
1660 Factory _impl; | 1705 Factory _impl; |
1661 | 1706 |
1662 _FactoryStubControl.fromEndpoint( | 1707 _FactoryStubControl.fromEndpoint( |
1663 core.MojoMessagePipeEndpoint endpoint, [Factory impl]) | 1708 core.MojoMessagePipeEndpoint endpoint, [Factory impl]) |
1664 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1709 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1665 _impl = impl; | 1710 _impl = impl; |
1666 } | 1711 } |
1667 | 1712 |
1668 _FactoryStubControl.fromHandle( | 1713 _FactoryStubControl.fromHandle( |
1669 core.MojoHandle handle, [Factory impl]) | 1714 core.MojoHandle handle, [Factory impl]) |
1670 : super.fromHandle(handle, autoBegin: impl != null) { | 1715 : super.fromHandle(handle, autoBegin: impl != null) { |
1671 _impl = impl; | 1716 _impl = impl; |
1672 } | 1717 } |
1673 | 1718 |
1674 _FactoryStubControl.unbound([this._impl]) : super.unbound(); | 1719 _FactoryStubControl.unbound([this._impl]) : super.unbound(); |
1675 | 1720 |
1676 String get serviceName => Factory.serviceName; | 1721 String get serviceName => Factory.serviceName; |
1677 | 1722 |
1678 | 1723 |
1679 static FactoryDoStuffResponseParams _factoryDoStuffResponseParamsFactory(Respo
nse response, String text) { | 1724 Function _factoryDoStuffResponseParamsResponder( |
1680 var result = new FactoryDoStuffResponseParams(); | 1725 int requestId) { |
1681 result.response = response; | 1726 return (Response response, String text) { |
1682 result.text = text; | 1727 var result = new FactoryDoStuffResponseParams(); |
1683 return result; | 1728 result.response = response; |
| 1729 result.text = text; |
| 1730 sendResponse(buildResponseWithId( |
| 1731 result, |
| 1732 _factoryMethodDoStuffName, |
| 1733 requestId, |
| 1734 bindings.MessageHeader.kMessageIsResponse)); |
| 1735 }; |
1684 } | 1736 } |
1685 static FactoryDoStuff2ResponseParams _factoryDoStuff2ResponseParamsFactory(Str
ing text) { | 1737 Function _factoryDoStuff2ResponseParamsResponder( |
1686 var result = new FactoryDoStuff2ResponseParams(); | 1738 int requestId) { |
1687 result.text = text; | 1739 return (String text) { |
1688 return result; | 1740 var result = new FactoryDoStuff2ResponseParams(); |
| 1741 result.text = text; |
| 1742 sendResponse(buildResponseWithId( |
| 1743 result, |
| 1744 _factoryMethodDoStuff2Name, |
| 1745 requestId, |
| 1746 bindings.MessageHeader.kMessageIsResponse)); |
| 1747 }; |
1689 } | 1748 } |
1690 static FactoryRequestImportedInterfaceResponseParams _factoryRequestImportedIn
terfaceResponseParamsFactory(sample_import_mojom.ImportedInterfaceInterfaceReque
st obj) { | 1749 Function _factoryRequestImportedInterfaceResponseParamsResponder( |
1691 var result = new FactoryRequestImportedInterfaceResponseParams(); | 1750 int requestId) { |
1692 result.obj = obj; | 1751 return (sample_import_mojom.ImportedInterfaceInterfaceRequest obj) { |
1693 return result; | 1752 var result = new FactoryRequestImportedInterfaceResponseParams(); |
| 1753 result.obj = obj; |
| 1754 sendResponse(buildResponseWithId( |
| 1755 result, |
| 1756 _factoryMethodRequestImportedInterfaceName, |
| 1757 requestId, |
| 1758 bindings.MessageHeader.kMessageIsResponse)); |
| 1759 }; |
1694 } | 1760 } |
1695 static FactoryTakeImportedInterfaceResponseParams _factoryTakeImportedInterfac
eResponseParamsFactory(sample_import_mojom.ImportedInterfaceInterface obj) { | 1761 Function _factoryTakeImportedInterfaceResponseParamsResponder( |
1696 var result = new FactoryTakeImportedInterfaceResponseParams(); | 1762 int requestId) { |
1697 result.obj = obj; | 1763 return (sample_import_mojom.ImportedInterfaceInterface obj) { |
1698 return result; | 1764 var result = new FactoryTakeImportedInterfaceResponseParams(); |
| 1765 result.obj = obj; |
| 1766 sendResponse(buildResponseWithId( |
| 1767 result, |
| 1768 _factoryMethodTakeImportedInterfaceName, |
| 1769 requestId, |
| 1770 bindings.MessageHeader.kMessageIsResponse)); |
| 1771 }; |
1699 } | 1772 } |
1700 | 1773 |
1701 dynamic handleMessage(bindings.ServiceMessage message) { | 1774 void handleMessage(bindings.ServiceMessage message) { |
1702 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1775 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1703 return bindings.ControlMessageHandler.handleMessage(this, | 1776 bindings.ControlMessageHandler.handleMessage( |
1704 0, | 1777 this, 0, message); |
1705 message); | 1778 return; |
1706 } | 1779 } |
1707 if (_impl == null) { | 1780 if (_impl == null) { |
1708 throw new core.MojoApiError("$this has no implementation set"); | 1781 throw new core.MojoApiError("$this has no implementation set"); |
1709 } | 1782 } |
1710 switch (message.header.type) { | 1783 switch (message.header.type) { |
1711 case _factoryMethodDoStuffName: | 1784 case _factoryMethodDoStuffName: |
1712 var params = _FactoryDoStuffParams.deserialize( | 1785 var params = _FactoryDoStuffParams.deserialize( |
1713 message.payload); | 1786 message.payload); |
1714 var response = _impl.doStuff(params.request,params.pipe,_factoryDoStuffR
esponseParamsFactory); | 1787 _impl.doStuff(params.request, params.pipe, _factoryDoStuffResponseParams
Responder(message.header.requestId)); |
1715 if (response is Future) { | |
1716 return response.then((response) { | |
1717 if (response != null) { | |
1718 return buildResponseWithId( | |
1719 response, | |
1720 _factoryMethodDoStuffName, | |
1721 message.header.requestId, | |
1722 bindings.MessageHeader.kMessageIsResponse); | |
1723 } | |
1724 }); | |
1725 } else if (response != null) { | |
1726 return buildResponseWithId( | |
1727 response, | |
1728 _factoryMethodDoStuffName, | |
1729 message.header.requestId, | |
1730 bindings.MessageHeader.kMessageIsResponse); | |
1731 } | |
1732 break; | 1788 break; |
1733 case _factoryMethodDoStuff2Name: | 1789 case _factoryMethodDoStuff2Name: |
1734 var params = _FactoryDoStuff2Params.deserialize( | 1790 var params = _FactoryDoStuff2Params.deserialize( |
1735 message.payload); | 1791 message.payload); |
1736 var response = _impl.doStuff2(params.pipe,_factoryDoStuff2ResponseParams
Factory); | 1792 _impl.doStuff2(params.pipe, _factoryDoStuff2ResponseParamsResponder(mess
age.header.requestId)); |
1737 if (response is Future) { | |
1738 return response.then((response) { | |
1739 if (response != null) { | |
1740 return buildResponseWithId( | |
1741 response, | |
1742 _factoryMethodDoStuff2Name, | |
1743 message.header.requestId, | |
1744 bindings.MessageHeader.kMessageIsResponse); | |
1745 } | |
1746 }); | |
1747 } else if (response != null) { | |
1748 return buildResponseWithId( | |
1749 response, | |
1750 _factoryMethodDoStuff2Name, | |
1751 message.header.requestId, | |
1752 bindings.MessageHeader.kMessageIsResponse); | |
1753 } | |
1754 break; | 1793 break; |
1755 case _factoryMethodCreateNamedObjectName: | 1794 case _factoryMethodCreateNamedObjectName: |
1756 var params = _FactoryCreateNamedObjectParams.deserialize( | 1795 var params = _FactoryCreateNamedObjectParams.deserialize( |
1757 message.payload); | 1796 message.payload); |
1758 _impl.createNamedObject(params.obj); | 1797 _impl.createNamedObject(params.obj); |
1759 break; | 1798 break; |
1760 case _factoryMethodRequestImportedInterfaceName: | 1799 case _factoryMethodRequestImportedInterfaceName: |
1761 var params = _FactoryRequestImportedInterfaceParams.deserialize( | 1800 var params = _FactoryRequestImportedInterfaceParams.deserialize( |
1762 message.payload); | 1801 message.payload); |
1763 var response = _impl.requestImportedInterface(params.obj,_factoryRequest
ImportedInterfaceResponseParamsFactory); | 1802 _impl.requestImportedInterface(params.obj, _factoryRequestImportedInterf
aceResponseParamsResponder(message.header.requestId)); |
1764 if (response is Future) { | |
1765 return response.then((response) { | |
1766 if (response != null) { | |
1767 return buildResponseWithId( | |
1768 response, | |
1769 _factoryMethodRequestImportedInterfaceName, | |
1770 message.header.requestId, | |
1771 bindings.MessageHeader.kMessageIsResponse); | |
1772 } | |
1773 }); | |
1774 } else if (response != null) { | |
1775 return buildResponseWithId( | |
1776 response, | |
1777 _factoryMethodRequestImportedInterfaceName, | |
1778 message.header.requestId, | |
1779 bindings.MessageHeader.kMessageIsResponse); | |
1780 } | |
1781 break; | 1803 break; |
1782 case _factoryMethodTakeImportedInterfaceName: | 1804 case _factoryMethodTakeImportedInterfaceName: |
1783 var params = _FactoryTakeImportedInterfaceParams.deserialize( | 1805 var params = _FactoryTakeImportedInterfaceParams.deserialize( |
1784 message.payload); | 1806 message.payload); |
1785 var response = _impl.takeImportedInterface(params.obj,_factoryTakeImport
edInterfaceResponseParamsFactory); | 1807 _impl.takeImportedInterface(params.obj, _factoryTakeImportedInterfaceRes
ponseParamsResponder(message.header.requestId)); |
1786 if (response is Future) { | |
1787 return response.then((response) { | |
1788 if (response != null) { | |
1789 return buildResponseWithId( | |
1790 response, | |
1791 _factoryMethodTakeImportedInterfaceName, | |
1792 message.header.requestId, | |
1793 bindings.MessageHeader.kMessageIsResponse); | |
1794 } | |
1795 }); | |
1796 } else if (response != null) { | |
1797 return buildResponseWithId( | |
1798 response, | |
1799 _factoryMethodTakeImportedInterfaceName, | |
1800 message.header.requestId, | |
1801 bindings.MessageHeader.kMessageIsResponse); | |
1802 } | |
1803 break; | 1808 break; |
1804 default: | 1809 default: |
1805 throw new bindings.MojoCodecError("Unexpected message name"); | 1810 throw new bindings.MojoCodecError("Unexpected message name"); |
1806 break; | 1811 break; |
1807 } | 1812 } |
1808 return null; | |
1809 } | 1813 } |
1810 | 1814 |
1811 Factory get impl => _impl; | 1815 Factory get impl => _impl; |
1812 set impl(Factory d) { | 1816 set impl(Factory d) { |
1813 if (d == null) { | 1817 if (d == null) { |
1814 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1818 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
1815 } | 1819 } |
1816 if (isBound && (_impl == null)) { | 1820 if (isBound && (_impl == null)) { |
1817 beginHandlingEvents(); | 1821 beginHandlingEvents(); |
1818 } | 1822 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 core.MojoHandle handle, [Factory impl]) | 1856 core.MojoHandle handle, [Factory impl]) |
1853 : super(new _FactoryStubControl.fromHandle(handle, impl)); | 1857 : super(new _FactoryStubControl.fromHandle(handle, impl)); |
1854 | 1858 |
1855 static FactoryStub newFromEndpoint( | 1859 static FactoryStub newFromEndpoint( |
1856 core.MojoMessagePipeEndpoint endpoint) { | 1860 core.MojoMessagePipeEndpoint endpoint) { |
1857 assert(endpoint.setDescription("For FactoryStub")); | 1861 assert(endpoint.setDescription("For FactoryStub")); |
1858 return new FactoryStub.fromEndpoint(endpoint); | 1862 return new FactoryStub.fromEndpoint(endpoint); |
1859 } | 1863 } |
1860 | 1864 |
1861 | 1865 |
1862 dynamic doStuff(Request request,core.MojoMessagePipeEndpoint pipe,[Function re
sponseFactory = null]) { | 1866 void doStuff(Request request,core.MojoMessagePipeEndpoint pipe,void callback(R
esponse response, String text)) { |
1863 return impl.doStuff(request,pipe,responseFactory); | 1867 return impl.doStuff(request,pipe,callback); |
1864 } | 1868 } |
1865 dynamic doStuff2(core.MojoDataPipeConsumer pipe,[Function responseFactory = nu
ll]) { | 1869 void doStuff2(core.MojoDataPipeConsumer pipe,void callback(String text)) { |
1866 return impl.doStuff2(pipe,responseFactory); | 1870 return impl.doStuff2(pipe,callback); |
1867 } | 1871 } |
1868 void createNamedObject(NamedObjectInterfaceRequest obj) { | 1872 void createNamedObject(NamedObjectInterfaceRequest obj) { |
1869 return impl.createNamedObject(obj); | 1873 return impl.createNamedObject(obj); |
1870 } | 1874 } |
1871 dynamic requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfac
eRequest obj,[Function responseFactory = null]) { | 1875 void requestImportedInterface(sample_import_mojom.ImportedInterfaceInterfaceRe
quest obj,void callback(sample_import_mojom.ImportedInterfaceInterfaceRequest ob
j)) { |
1872 return impl.requestImportedInterface(obj,responseFactory); | 1876 return impl.requestImportedInterface(obj,callback); |
1873 } | 1877 } |
1874 dynamic takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface o
bj,[Function responseFactory = null]) { | 1878 void takeImportedInterface(sample_import_mojom.ImportedInterfaceInterface obj,
void callback(sample_import_mojom.ImportedInterfaceInterface obj)) { |
1875 return impl.takeImportedInterface(obj,responseFactory); | 1879 return impl.takeImportedInterface(obj,callback); |
1876 } | 1880 } |
1877 } | 1881 } |
1878 | 1882 |
1879 | 1883 |
1880 mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ?? | 1884 mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ?? |
1881 _initRuntimeTypeInfo(); | 1885 _initRuntimeTypeInfo(); |
1882 | 1886 |
1883 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { | 1887 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
1884 return getRuntimeTypeInfo().typeMap; | 1888 return getRuntimeTypeInfo().typeMap; |
1885 } | 1889 } |
1886 | 1890 |
1887 var _runtimeTypeInfo; | 1891 var _runtimeTypeInfo; |
1888 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { | 1892 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { |
1889 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of | 1893 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of |
1890 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this | 1894 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this |
1891 // file. The string contains the base64 encoding of the gzip-compressed bytes. | 1895 // file. The string contains the base64 encoding of the gzip-compressed bytes. |
1892 var serializedRuntimeTypeInfo = "H4sIAAAJbogC/+xaSZPbRBTW4qmYJYknU8QiJDMekgyZo
hiZcMA1p1RBSFJUQQpzIMVhxkubaIgsIcmUuXHMT+DIkZ+QI8f8jBw55pgbtKzXdrvVrcXR5mBVdbWlk
ab7ff19771eNCm4GlA/hZp93qHuZVzqcP8BLju4uD3TfoKOj7/pmWj4bf8MDTzu+9fhm+8fPbx78vXdR
8fBh0fsd2z7z6C+hUsNlxbTrx+gtqHew6XJaeer3sCznN8S90P0f75Dv0yQ6836oXH/7trW2EX3ob++H
SqDo3//fG8ZV+1w+b6jL+yWKLvJ9ZK5v8Pctxmc/oWLfY9cF3E5hwvB6TL+fWE+vnP4QuOzj8vbuPyIS
xcX/bFlIt2ZDC3TGCNHN60zS3edQfDDnvSfGAPdGHvIGfUGyNX7xnhojH9ydQ+j6upBcyejoLkj/yOTy
wuCy1VctuC3j5sC+NYoHLao9x8CIf8+D/zZDurnTT7eL6Ce1pLhLVF40/9PhPeXVtebjEYh+z4EW/LGt
cXonth7qia307/aAjubYCvY+YkD+mHtJVcRPFKodk/lZTtpnW5xdCa6suKDCB+fD5cK5IPEtK8x/SR+M
M5P8nCtReBaXwFXOQLXd6E927ARz4/4uH5aAK4NykfJnPioUX1WqPu89alBXxb6DOLXRp9hHdRn+uTjc
x3yobL1SfpJ8pC4POWOIM8rWp8emno8ffq43ihQn5Ig3xXpU5QvaOpC71ngRMYVdHqbxelGyfnCrPHs/
dFtkjCU5Y9YHqSNZ1n7obh45vPgoGC9KDF6kan3Wf78Q/xKSv50BPi8j8v2Mn8CRyeY31aJR3IJPBL5X
Z9Hn1fM78qc+V9LMB9WUuCkUOMg4tMXDup5iF0lCON2syQ/TOw/Takj0XrAPtgesns+g6u+norMD9+Bd
QerfybkxX6BvFCY9snzHegry+Sk62Kvq88/IS9SU+CuRuiT5Lcw33xg2pbjoeEDghw7Dgcl63OakT5vQ
Rsiu9chb6qSPg8Kincifbap9YgruBgwoEehkQ3e+xg0O9drzAer5mevoP49JW/vC8bhEPxgBG/XJl+rE
n8/Kijvrzp/4+JOLcV41CLizjVc3vP73/sZ8XrM2694E+LOTbCdazeVG250m0y3/neflbhuWNW4kzVvf
d+4G8FbEnQ2vE3G20PwBf933rLxxoYF36cyfzzIeP4B9V8Mf59FrP/S/Wlx8qNznHleFzm/GoPZBD7Ru
Q3R/PAK7D8KpoUhflwt6FxAnD1axD6JQo0nu+/UUaPX9/Pa/+0ibzZWbL+vvSHr++Q8ANhZ+nmAqq7Lj
kGwPB5sr9G6LOHPKznb/TCil3sCveyWrJcXUrZ6uVcRvdQT8EGKiFN57Rcu8Cn3/MK6+ZNd4FhV/YloX
vByKxqftOceyXkl5twjeRzC7Tx8lzdu7LnXFjjQNujnsSrmmSQtzkbmzbO3YNymgnW7CzDWeeOVdn++l
tN5FtH+/EV4VvR5Mx4uCrW+m8U5H4XznFyXYD5gWg468cFx+Tzx670C47YMfSc8qXPihrzCfLyxAn7qa
8zHd8CXF4lbVebjS/5REC9aajbxgj1fR/Iz5lhdaHwuFxQv2HlsQ16P+NDcxIc5LmXEh7jzjuT9/wIAA
P//4cQFxDg0AAA="; | 1896 var serializedRuntimeTypeInfo = "H4sIAAAJbogC/+xaT3PbRBTXH4eaf6nTDI0oberQNrgwR
CYcyOTUGShthxnoEA705JGdteNgW0KSGcOJY44c8xH4CPkYfIweOXKjK+utvV7tSpYrS+uOd2ZnLUWK9
v3e7/3Z3WcoYavAeAEje/+IulZxL8P1R7hv4+5ZfaeHjo+/t/ro9IfmOWr53OfvwTs/vXj+uPHd4xfH4
YsH7Hvs969grOFewr3KzOtnGB0Y7+K+w/nOt1bLt93f556H6P/8iH4dIs8fz8Pg/t1z7IGHnsJ8Azl0B
sfg+rI6i2vt09lrpz6VW6HkJu0/5voRc11ncPofGvscaddxv4Y7wekm/r050e8Evoh+9nB/B/cO7g3cz
aHnmj27ZfXMjm13esg8s/vI/MO1zL59bh+antsa/zKdYbPXbZndgY/cttVCntnsDk67g45n+hhhzww/3
WiHnz4IXupHvk/wuY37BvwO8NMA5xKFxwb1/AUQs7oZjv9sheOZwcf9JYyXpflwVyjc6f8nwv0b+8Qft
tsR+T4GWfLCt8r4ASL3SJ9f3qDVBfLugMwg7+cu2BMrN2l58kqjvn+mzspL2+8Gx/5ELSt+iHAK+HGjA
H4ozDwMZr7ETyb5UR6+pRh8ywvgq8bg+x58z+k6iBd/Any/yBHfCuXDVE4cNai5a9T1su3WgLlM7TaMc
2u75bcK6EyE0z3In2SxWzJfkr8k5TePBPlh3nbro5HPs9sA3/sF2K0iyJdFdivKM+r61A9kgRfRL9jvI
YvXfUnyjIq2FH91SBKNov0Vy4u08S9rP5UU/wJe7BdkR1qCHanUPFk+/UuuU/LpSIDTh7hvzfIpdISCd
bOMvFIL4JXIPwe8+kpS/6xy1pdVwbpbS4GXRulDxK+vXWT5iN2NiOL3oGB/TXBwUtqXaP9hDzCIyD9ZI
a6OneWZZ74L+xx281zIk70CeKIx8yD3t2HOLMPn3Zd7Xbu9grxKT4G/HmO3JE+G9eyzvmO7Pjp9RlBj9
bEvid1eZGS3NcBAJP8q5V0y2e1+zvFRZLd1ah/kFu5dUPBBRNPhc5+BLU/sOOGFRfM7sjD6KyWPnwr08
RD8ZAyPVy7fk4nPn+S8jpCdz0nxqZRCL6WY+HQH9w+C+Vu/IN6Meecpb1J8egAYcOWncsu1Paez5+C9L
yXYv5Q1PmXN48B37sbwmASnNY/T8fgh+Ig1j/lxaUTyLJWvF6LXSxj/Zvh8FbMfTc+nysmrrnHWjSfI/
a3bGm8QzFWHIlpv3oJzU8EyM8KT2znXOSTJZcSc42iUXtnzsed6/LnDss6vT5A/1hk77ztv2LkDqW8Ae
aWpb5B1f3gAhszjxdYK7g8TPpW1bM/viB09EdjRriR29FLJ1o6eSGZH5Tn4ocTEtWWdc05xkqMuY9X8z
S5wTnZ/I1pnGG/F45S2DpTUZzF1oOR2BL/34b288GPrgWuk7gfs6k9dzDtFmdaKLpt3b4P+RoJ9w03Qe
V64pa03KOVcb3cd7hVVb8fDR6MDeQZ1TRrnPmk3YJ3Rt13UCEDy+LwJxrsFxHsVZCC8KXPijLrAur+yA
I76a6z7t8HnF4GfLOt+2n+K4sqRnk1cYesLSX7HlBVG9HQz57jCrpcNdTXiyM46jkT2Q4qMI0n1n+T5V
wEAAP//hkGPYIg1AAA="; |
1893 | 1897 |
1894 // Deserialize RuntimeTypeInfo | 1898 // Deserialize RuntimeTypeInfo |
1895 var bytes = BASE64.decode(serializedRuntimeTypeInfo); | 1899 var bytes = BASE64.decode(serializedRuntimeTypeInfo); |
1896 var unzippedBytes = new ZLibDecoder().convert(bytes); | 1900 var unzippedBytes = new ZLibDecoder().convert(bytes); |
1897 var bdata = new ByteData.view(unzippedBytes.buffer); | 1901 var bdata = new ByteData.view(unzippedBytes.buffer); |
1898 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); | 1902 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); |
1899 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); | 1903 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); |
1900 sample_import_mojom.getAllMojomTypeDefinitions() | 1904 sample_import_mojom.getAllMojomTypeDefinitions() |
1901 .forEach((String s, mojom_types.UserDefinedType udt) { | 1905 .forEach((String s, mojom_types.UserDefinedType udt) { |
1902 _runtimeTypeInfo.typeMap[s] = udt; | 1906 _runtimeTypeInfo.typeMap[s] = udt; |
1903 }); | 1907 }); |
1904 | 1908 |
1905 return _runtimeTypeInfo; | 1909 return _runtimeTypeInfo; |
1906 } | 1910 } |
OLD | NEW |