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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/ui/view_containers.mojom.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 view_containers_mojom; 4 library view_containers_mojom;
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:mojo/bindings.dart' as bindings; 6 import 'package:mojo/bindings.dart' as bindings;
7 import 'package:mojo/core.dart' as core; 7 import 'package:mojo/core.dart' as core;
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
9 import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as sc ene_token_mojom; 9 import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as sc ene_token_mojom;
10 import 'package:mojo_services/mojo/ui/view_properties.mojom.dart' as view_proper ties_mojom; 10 import 'package:mojo_services/mojo/ui/view_properties.mojom.dart' as view_proper ties_mojom;
11 import 'package:mojo_services/mojo/ui/view_token.mojom.dart' as view_token_mojom ; 11 import 'package:mojo_services/mojo/ui/view_token.mojom.dart' as view_token_mojom ;
12 12
13 13
14 14
15 class ViewInfo extends bindings.Struct { 15 class ViewInfo extends bindings.Struct {
16 static const List<bindings.StructDataHeader> kVersions = const [ 16 static const List<bindings.StructDataHeader> kVersions = const [
17 const bindings.StructDataHeader(16, 0) 17 const bindings.StructDataHeader(16, 0)
18 ]; 18 ];
19 scene_token_mojom.SceneToken sceneToken = null; 19 scene_token_mojom.SceneToken sceneToken = null;
20 20
21 ViewInfo() : super(kVersions.last.size); 21 ViewInfo() : super(kVersions.last.size);
22 22
23 ViewInfo.init(
24 scene_token_mojom.SceneToken this.sceneToken
25 ) : super(kVersions.last.size);
26
23 static ViewInfo deserialize(bindings.Message message) { 27 static ViewInfo deserialize(bindings.Message message) {
24 var decoder = new bindings.Decoder(message); 28 var decoder = new bindings.Decoder(message);
25 var result = decode(decoder); 29 var result = decode(decoder);
26 if (decoder.excessHandles != null) { 30 if (decoder.excessHandles != null) {
27 decoder.excessHandles.forEach((h) => h.close()); 31 decoder.excessHandles.forEach((h) => h.close());
28 } 32 }
29 return result; 33 return result;
30 } 34 }
31 35
32 static ViewInfo decode(bindings.Decoder decoder0) { 36 static ViewInfo decode(bindings.Decoder decoder0) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 90
87 91
88 class _ViewContainerSetListenerParams extends bindings.Struct { 92 class _ViewContainerSetListenerParams extends bindings.Struct {
89 static const List<bindings.StructDataHeader> kVersions = const [ 93 static const List<bindings.StructDataHeader> kVersions = const [
90 const bindings.StructDataHeader(16, 0) 94 const bindings.StructDataHeader(16, 0)
91 ]; 95 ];
92 ViewContainerListenerInterface listener = null; 96 ViewContainerListenerInterface listener = null;
93 97
94 _ViewContainerSetListenerParams() : super(kVersions.last.size); 98 _ViewContainerSetListenerParams() : super(kVersions.last.size);
95 99
100 _ViewContainerSetListenerParams.init(
101 ViewContainerListenerInterface this.listener
102 ) : super(kVersions.last.size);
103
96 static _ViewContainerSetListenerParams deserialize(bindings.Message message) { 104 static _ViewContainerSetListenerParams deserialize(bindings.Message message) {
97 var decoder = new bindings.Decoder(message); 105 var decoder = new bindings.Decoder(message);
98 var result = decode(decoder); 106 var result = decode(decoder);
99 if (decoder.excessHandles != null) { 107 if (decoder.excessHandles != null) {
100 decoder.excessHandles.forEach((h) => h.close()); 108 decoder.excessHandles.forEach((h) => h.close());
101 } 109 }
102 return result; 110 return result;
103 } 111 }
104 112
105 static _ViewContainerSetListenerParams decode(bindings.Decoder decoder0) { 113 static _ViewContainerSetListenerParams decode(bindings.Decoder decoder0) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 166
159 class _ViewContainerAddChildParams extends bindings.Struct { 167 class _ViewContainerAddChildParams extends bindings.Struct {
160 static const List<bindings.StructDataHeader> kVersions = const [ 168 static const List<bindings.StructDataHeader> kVersions = const [
161 const bindings.StructDataHeader(24, 0) 169 const bindings.StructDataHeader(24, 0)
162 ]; 170 ];
163 int childKey = 0; 171 int childKey = 0;
164 view_token_mojom.ViewOwnerInterface childViewOwner = null; 172 view_token_mojom.ViewOwnerInterface childViewOwner = null;
165 173
166 _ViewContainerAddChildParams() : super(kVersions.last.size); 174 _ViewContainerAddChildParams() : super(kVersions.last.size);
167 175
176 _ViewContainerAddChildParams.init(
177 int this.childKey,
178 view_token_mojom.ViewOwnerInterface this.childViewOwner
179 ) : super(kVersions.last.size);
180
168 static _ViewContainerAddChildParams deserialize(bindings.Message message) { 181 static _ViewContainerAddChildParams deserialize(bindings.Message message) {
169 var decoder = new bindings.Decoder(message); 182 var decoder = new bindings.Decoder(message);
170 var result = decode(decoder); 183 var result = decode(decoder);
171 if (decoder.excessHandles != null) { 184 if (decoder.excessHandles != null) {
172 decoder.excessHandles.forEach((h) => h.close()); 185 decoder.excessHandles.forEach((h) => h.close());
173 } 186 }
174 return result; 187 return result;
175 } 188 }
176 189
177 static _ViewContainerAddChildParams decode(bindings.Decoder decoder0) { 190 static _ViewContainerAddChildParams decode(bindings.Decoder decoder0) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 255
243 class _ViewContainerRemoveChildParams extends bindings.Struct { 256 class _ViewContainerRemoveChildParams extends bindings.Struct {
244 static const List<bindings.StructDataHeader> kVersions = const [ 257 static const List<bindings.StructDataHeader> kVersions = const [
245 const bindings.StructDataHeader(16, 0) 258 const bindings.StructDataHeader(16, 0)
246 ]; 259 ];
247 int childKey = 0; 260 int childKey = 0;
248 view_token_mojom.ViewOwnerInterfaceRequest transferredViewOwner = null; 261 view_token_mojom.ViewOwnerInterfaceRequest transferredViewOwner = null;
249 262
250 _ViewContainerRemoveChildParams() : super(kVersions.last.size); 263 _ViewContainerRemoveChildParams() : super(kVersions.last.size);
251 264
265 _ViewContainerRemoveChildParams.init(
266 int this.childKey,
267 view_token_mojom.ViewOwnerInterfaceRequest this.transferredViewOwner
268 ) : super(kVersions.last.size);
269
252 static _ViewContainerRemoveChildParams deserialize(bindings.Message message) { 270 static _ViewContainerRemoveChildParams deserialize(bindings.Message message) {
253 var decoder = new bindings.Decoder(message); 271 var decoder = new bindings.Decoder(message);
254 var result = decode(decoder); 272 var result = decode(decoder);
255 if (decoder.excessHandles != null) { 273 if (decoder.excessHandles != null) {
256 decoder.excessHandles.forEach((h) => h.close()); 274 decoder.excessHandles.forEach((h) => h.close());
257 } 275 }
258 return result; 276 return result;
259 } 277 }
260 278
261 static _ViewContainerRemoveChildParams decode(bindings.Decoder decoder0) { 279 static _ViewContainerRemoveChildParams decode(bindings.Decoder decoder0) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 class _ViewContainerSetChildPropertiesParams extends bindings.Struct { 345 class _ViewContainerSetChildPropertiesParams extends bindings.Struct {
328 static const List<bindings.StructDataHeader> kVersions = const [ 346 static const List<bindings.StructDataHeader> kVersions = const [
329 const bindings.StructDataHeader(24, 0) 347 const bindings.StructDataHeader(24, 0)
330 ]; 348 ];
331 int childKey = 0; 349 int childKey = 0;
332 int childSceneVersion = 0; 350 int childSceneVersion = 0;
333 view_properties_mojom.ViewProperties childViewProperties = null; 351 view_properties_mojom.ViewProperties childViewProperties = null;
334 352
335 _ViewContainerSetChildPropertiesParams() : super(kVersions.last.size); 353 _ViewContainerSetChildPropertiesParams() : super(kVersions.last.size);
336 354
355 _ViewContainerSetChildPropertiesParams.init(
356 int this.childKey,
357 int this.childSceneVersion,
358 view_properties_mojom.ViewProperties this.childViewProperties
359 ) : super(kVersions.last.size);
360
337 static _ViewContainerSetChildPropertiesParams deserialize(bindings.Message mes sage) { 361 static _ViewContainerSetChildPropertiesParams deserialize(bindings.Message mes sage) {
338 var decoder = new bindings.Decoder(message); 362 var decoder = new bindings.Decoder(message);
339 var result = decode(decoder); 363 var result = decode(decoder);
340 if (decoder.excessHandles != null) { 364 if (decoder.excessHandles != null) {
341 decoder.excessHandles.forEach((h) => h.close()); 365 decoder.excessHandles.forEach((h) => h.close());
342 } 366 }
343 return result; 367 return result;
344 } 368 }
345 369
346 static _ViewContainerSetChildPropertiesParams decode(bindings.Decoder decoder0 ) { 370 static _ViewContainerSetChildPropertiesParams decode(bindings.Decoder decoder0 ) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 450
427 451
428 class _ViewContainerFlushChildrenParams extends bindings.Struct { 452 class _ViewContainerFlushChildrenParams extends bindings.Struct {
429 static const List<bindings.StructDataHeader> kVersions = const [ 453 static const List<bindings.StructDataHeader> kVersions = const [
430 const bindings.StructDataHeader(16, 0) 454 const bindings.StructDataHeader(16, 0)
431 ]; 455 ];
432 int flushToken = 0; 456 int flushToken = 0;
433 457
434 _ViewContainerFlushChildrenParams() : super(kVersions.last.size); 458 _ViewContainerFlushChildrenParams() : super(kVersions.last.size);
435 459
460 _ViewContainerFlushChildrenParams.init(
461 int this.flushToken
462 ) : super(kVersions.last.size);
463
436 static _ViewContainerFlushChildrenParams deserialize(bindings.Message message) { 464 static _ViewContainerFlushChildrenParams deserialize(bindings.Message message) {
437 var decoder = new bindings.Decoder(message); 465 var decoder = new bindings.Decoder(message);
438 var result = decode(decoder); 466 var result = decode(decoder);
439 if (decoder.excessHandles != null) { 467 if (decoder.excessHandles != null) {
440 decoder.excessHandles.forEach((h) => h.close()); 468 decoder.excessHandles.forEach((h) => h.close());
441 } 469 }
442 return result; 470 return result;
443 } 471 }
444 472
445 static _ViewContainerFlushChildrenParams decode(bindings.Decoder decoder0) { 473 static _ViewContainerFlushChildrenParams decode(bindings.Decoder decoder0) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 527
500 class _ViewContainerListenerOnChildAttachedParams extends bindings.Struct { 528 class _ViewContainerListenerOnChildAttachedParams extends bindings.Struct {
501 static const List<bindings.StructDataHeader> kVersions = const [ 529 static const List<bindings.StructDataHeader> kVersions = const [
502 const bindings.StructDataHeader(24, 0) 530 const bindings.StructDataHeader(24, 0)
503 ]; 531 ];
504 int childKey = 0; 532 int childKey = 0;
505 ViewInfo childViewInfo = null; 533 ViewInfo childViewInfo = null;
506 534
507 _ViewContainerListenerOnChildAttachedParams() : super(kVersions.last.size); 535 _ViewContainerListenerOnChildAttachedParams() : super(kVersions.last.size);
508 536
537 _ViewContainerListenerOnChildAttachedParams.init(
538 int this.childKey,
539 ViewInfo this.childViewInfo
540 ) : super(kVersions.last.size);
541
509 static _ViewContainerListenerOnChildAttachedParams deserialize(bindings.Messag e message) { 542 static _ViewContainerListenerOnChildAttachedParams deserialize(bindings.Messag e message) {
510 var decoder = new bindings.Decoder(message); 543 var decoder = new bindings.Decoder(message);
511 var result = decode(decoder); 544 var result = decode(decoder);
512 if (decoder.excessHandles != null) { 545 if (decoder.excessHandles != null) {
513 decoder.excessHandles.forEach((h) => h.close()); 546 decoder.excessHandles.forEach((h) => h.close());
514 } 547 }
515 return result; 548 return result;
516 } 549 }
517 550
518 static _ViewContainerListenerOnChildAttachedParams decode(bindings.Decoder dec oder0) { 551 static _ViewContainerListenerOnChildAttachedParams decode(bindings.Decoder dec oder0) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 } 617 }
585 618
586 619
587 class ViewContainerListenerOnChildAttachedResponseParams extends bindings.Struct { 620 class ViewContainerListenerOnChildAttachedResponseParams extends bindings.Struct {
588 static const List<bindings.StructDataHeader> kVersions = const [ 621 static const List<bindings.StructDataHeader> kVersions = const [
589 const bindings.StructDataHeader(8, 0) 622 const bindings.StructDataHeader(8, 0)
590 ]; 623 ];
591 624
592 ViewContainerListenerOnChildAttachedResponseParams() : super(kVersions.last.si ze); 625 ViewContainerListenerOnChildAttachedResponseParams() : super(kVersions.last.si ze);
593 626
627 ViewContainerListenerOnChildAttachedResponseParams.init(
628 ) : super(kVersions.last.size);
629
594 static ViewContainerListenerOnChildAttachedResponseParams deserialize(bindings .Message message) { 630 static ViewContainerListenerOnChildAttachedResponseParams deserialize(bindings .Message message) {
595 var decoder = new bindings.Decoder(message); 631 var decoder = new bindings.Decoder(message);
596 var result = decode(decoder); 632 var result = decode(decoder);
597 if (decoder.excessHandles != null) { 633 if (decoder.excessHandles != null) {
598 decoder.excessHandles.forEach((h) => h.close()); 634 decoder.excessHandles.forEach((h) => h.close());
599 } 635 }
600 return result; 636 return result;
601 } 637 }
602 638
603 static ViewContainerListenerOnChildAttachedResponseParams decode(bindings.Deco der decoder0) { 639 static ViewContainerListenerOnChildAttachedResponseParams decode(bindings.Deco der decoder0) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 679
644 680
645 class _ViewContainerListenerOnChildUnavailableParams extends bindings.Struct { 681 class _ViewContainerListenerOnChildUnavailableParams extends bindings.Struct {
646 static const List<bindings.StructDataHeader> kVersions = const [ 682 static const List<bindings.StructDataHeader> kVersions = const [
647 const bindings.StructDataHeader(16, 0) 683 const bindings.StructDataHeader(16, 0)
648 ]; 684 ];
649 int childKey = 0; 685 int childKey = 0;
650 686
651 _ViewContainerListenerOnChildUnavailableParams() : super(kVersions.last.size); 687 _ViewContainerListenerOnChildUnavailableParams() : super(kVersions.last.size);
652 688
689 _ViewContainerListenerOnChildUnavailableParams.init(
690 int this.childKey
691 ) : super(kVersions.last.size);
692
653 static _ViewContainerListenerOnChildUnavailableParams deserialize(bindings.Mes sage message) { 693 static _ViewContainerListenerOnChildUnavailableParams deserialize(bindings.Mes sage message) {
654 var decoder = new bindings.Decoder(message); 694 var decoder = new bindings.Decoder(message);
655 var result = decode(decoder); 695 var result = decode(decoder);
656 if (decoder.excessHandles != null) { 696 if (decoder.excessHandles != null) {
657 decoder.excessHandles.forEach((h) => h.close()); 697 decoder.excessHandles.forEach((h) => h.close());
658 } 698 }
659 return result; 699 return result;
660 } 700 }
661 701
662 static _ViewContainerListenerOnChildUnavailableParams decode(bindings.Decoder decoder0) { 702 static _ViewContainerListenerOnChildUnavailableParams decode(bindings.Decoder decoder0) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 754 }
715 755
716 756
717 class ViewContainerListenerOnChildUnavailableResponseParams extends bindings.Str uct { 757 class ViewContainerListenerOnChildUnavailableResponseParams extends bindings.Str uct {
718 static const List<bindings.StructDataHeader> kVersions = const [ 758 static const List<bindings.StructDataHeader> kVersions = const [
719 const bindings.StructDataHeader(8, 0) 759 const bindings.StructDataHeader(8, 0)
720 ]; 760 ];
721 761
722 ViewContainerListenerOnChildUnavailableResponseParams() : super(kVersions.last .size); 762 ViewContainerListenerOnChildUnavailableResponseParams() : super(kVersions.last .size);
723 763
764 ViewContainerListenerOnChildUnavailableResponseParams.init(
765 ) : super(kVersions.last.size);
766
724 static ViewContainerListenerOnChildUnavailableResponseParams deserialize(bindi ngs.Message message) { 767 static ViewContainerListenerOnChildUnavailableResponseParams deserialize(bindi ngs.Message message) {
725 var decoder = new bindings.Decoder(message); 768 var decoder = new bindings.Decoder(message);
726 var result = decode(decoder); 769 var result = decode(decoder);
727 if (decoder.excessHandles != null) { 770 if (decoder.excessHandles != null) {
728 decoder.excessHandles.forEach((h) => h.close()); 771 decoder.excessHandles.forEach((h) => h.close());
729 } 772 }
730 return result; 773 return result;
731 } 774 }
732 775
733 static ViewContainerListenerOnChildUnavailableResponseParams decode(bindings.D ecoder decoder0) { 776 static ViewContainerListenerOnChildUnavailableResponseParams decode(bindings.D ecoder decoder0) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 } 814 }
772 } 815 }
773 816
774 const int _viewContainerMethodSetListenerName = 0; 817 const int _viewContainerMethodSetListenerName = 0;
775 const int _viewContainerMethodAddChildName = 1; 818 const int _viewContainerMethodAddChildName = 1;
776 const int _viewContainerMethodRemoveChildName = 2; 819 const int _viewContainerMethodRemoveChildName = 2;
777 const int _viewContainerMethodSetChildPropertiesName = 3; 820 const int _viewContainerMethodSetChildPropertiesName = 3;
778 const int _viewContainerMethodFlushChildrenName = 4; 821 const int _viewContainerMethodFlushChildrenName = 4;
779 822
780 class _ViewContainerServiceDescription implements service_describer.ServiceDescr iption { 823 class _ViewContainerServiceDescription implements service_describer.ServiceDescr iption {
781 dynamic getTopLevelInterface([Function responseFactory]) => 824 void getTopLevelInterface(Function responder) {
782 responseFactory(null); 825 responder(null);
826 }
783 827
784 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 828 void getTypeDefinition(String typeKey, Function responder) {
785 responseFactory(null); 829 responder(null);
830 }
786 831
787 dynamic getAllTypeDefinitions([Function responseFactory]) => 832 void getAllTypeDefinitions(Function responder) {
788 responseFactory(null); 833 responder(null);
834 }
789 } 835 }
790 836
791 abstract class ViewContainer { 837 abstract class ViewContainer {
792 static const String serviceName = null; 838 static const String serviceName = null;
793 839
794 static service_describer.ServiceDescription _cachedServiceDescription; 840 static service_describer.ServiceDescription _cachedServiceDescription;
795 static service_describer.ServiceDescription get serviceDescription { 841 static service_describer.ServiceDescription get serviceDescription {
796 if (_cachedServiceDescription == null) { 842 if (_cachedServiceDescription == null) {
797 _cachedServiceDescription = new _ViewContainerServiceDescription(); 843 _cachedServiceDescription = new _ViewContainerServiceDescription();
798 } 844 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 : super.fromHandle(handle, autoBegin: impl != null) { 1038 : super.fromHandle(handle, autoBegin: impl != null) {
993 _impl = impl; 1039 _impl = impl;
994 } 1040 }
995 1041
996 _ViewContainerStubControl.unbound([this._impl]) : super.unbound(); 1042 _ViewContainerStubControl.unbound([this._impl]) : super.unbound();
997 1043
998 String get serviceName => ViewContainer.serviceName; 1044 String get serviceName => ViewContainer.serviceName;
999 1045
1000 1046
1001 1047
1002 dynamic handleMessage(bindings.ServiceMessage message) { 1048 void handleMessage(bindings.ServiceMessage message) {
1003 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1049 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1004 return bindings.ControlMessageHandler.handleMessage(this, 1050 bindings.ControlMessageHandler.handleMessage(
1005 0, 1051 this, 0, message);
1006 message); 1052 return;
1007 } 1053 }
1008 if (_impl == null) { 1054 if (_impl == null) {
1009 throw new core.MojoApiError("$this has no implementation set"); 1055 throw new core.MojoApiError("$this has no implementation set");
1010 } 1056 }
1011 switch (message.header.type) { 1057 switch (message.header.type) {
1012 case _viewContainerMethodSetListenerName: 1058 case _viewContainerMethodSetListenerName:
1013 var params = _ViewContainerSetListenerParams.deserialize( 1059 var params = _ViewContainerSetListenerParams.deserialize(
1014 message.payload); 1060 message.payload);
1015 _impl.setListener(params.listener); 1061 _impl.setListener(params.listener);
1016 break; 1062 break;
(...skipping 14 matching lines...) Expand all
1031 break; 1077 break;
1032 case _viewContainerMethodFlushChildrenName: 1078 case _viewContainerMethodFlushChildrenName:
1033 var params = _ViewContainerFlushChildrenParams.deserialize( 1079 var params = _ViewContainerFlushChildrenParams.deserialize(
1034 message.payload); 1080 message.payload);
1035 _impl.flushChildren(params.flushToken); 1081 _impl.flushChildren(params.flushToken);
1036 break; 1082 break;
1037 default: 1083 default:
1038 throw new bindings.MojoCodecError("Unexpected message name"); 1084 throw new bindings.MojoCodecError("Unexpected message name");
1039 break; 1085 break;
1040 } 1086 }
1041 return null;
1042 } 1087 }
1043 1088
1044 ViewContainer get impl => _impl; 1089 ViewContainer get impl => _impl;
1045 set impl(ViewContainer d) { 1090 set impl(ViewContainer d) {
1046 if (d == null) { 1091 if (d == null) {
1047 throw new core.MojoApiError("$this: Cannot set a null implementation"); 1092 throw new core.MojoApiError("$this: Cannot set a null implementation");
1048 } 1093 }
1049 if (isBound && (_impl == null)) { 1094 if (isBound && (_impl == null)) {
1050 beginHandlingEvents(); 1095 beginHandlingEvents();
1051 } 1096 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 } 1151 }
1107 void flushChildren(int flushToken) { 1152 void flushChildren(int flushToken) {
1108 return impl.flushChildren(flushToken); 1153 return impl.flushChildren(flushToken);
1109 } 1154 }
1110 } 1155 }
1111 1156
1112 const int _viewContainerListenerMethodOnChildAttachedName = 0; 1157 const int _viewContainerListenerMethodOnChildAttachedName = 0;
1113 const int _viewContainerListenerMethodOnChildUnavailableName = 1; 1158 const int _viewContainerListenerMethodOnChildUnavailableName = 1;
1114 1159
1115 class _ViewContainerListenerServiceDescription implements service_describer.Serv iceDescription { 1160 class _ViewContainerListenerServiceDescription implements service_describer.Serv iceDescription {
1116 dynamic getTopLevelInterface([Function responseFactory]) => 1161 void getTopLevelInterface(Function responder) {
1117 responseFactory(null); 1162 responder(null);
1163 }
1118 1164
1119 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1165 void getTypeDefinition(String typeKey, Function responder) {
1120 responseFactory(null); 1166 responder(null);
1167 }
1121 1168
1122 dynamic getAllTypeDefinitions([Function responseFactory]) => 1169 void getAllTypeDefinitions(Function responder) {
1123 responseFactory(null); 1170 responder(null);
1171 }
1124 } 1172 }
1125 1173
1126 abstract class ViewContainerListener { 1174 abstract class ViewContainerListener {
1127 static const String serviceName = null; 1175 static const String serviceName = null;
1128 1176
1129 static service_describer.ServiceDescription _cachedServiceDescription; 1177 static service_describer.ServiceDescription _cachedServiceDescription;
1130 static service_describer.ServiceDescription get serviceDescription { 1178 static service_describer.ServiceDescription get serviceDescription {
1131 if (_cachedServiceDescription == null) { 1179 if (_cachedServiceDescription == null) {
1132 _cachedServiceDescription = new _ViewContainerListenerServiceDescription() ; 1180 _cachedServiceDescription = new _ViewContainerListenerServiceDescription() ;
1133 } 1181 }
1134 return _cachedServiceDescription; 1182 return _cachedServiceDescription;
1135 } 1183 }
1136 1184
1137 static ViewContainerListenerProxy connectToService( 1185 static ViewContainerListenerProxy connectToService(
1138 bindings.ServiceConnector s, String url, [String serviceName]) { 1186 bindings.ServiceConnector s, String url, [String serviceName]) {
1139 ViewContainerListenerProxy p = new ViewContainerListenerProxy.unbound(); 1187 ViewContainerListenerProxy p = new ViewContainerListenerProxy.unbound();
1140 String name = serviceName ?? ViewContainerListener.serviceName; 1188 String name = serviceName ?? ViewContainerListener.serviceName;
1141 if ((name == null) || name.isEmpty) { 1189 if ((name == null) || name.isEmpty) {
1142 throw new core.MojoApiError( 1190 throw new core.MojoApiError(
1143 "If an interface has no ServiceName, then one must be provided."); 1191 "If an interface has no ServiceName, then one must be provided.");
1144 } 1192 }
1145 s.connectToService(url, p, name); 1193 s.connectToService(url, p, name);
1146 return p; 1194 return p;
1147 } 1195 }
1148 dynamic onChildAttached(int childKey,ViewInfo childViewInfo,[Function response Factory = null]); 1196 void onChildAttached(int childKey,ViewInfo childViewInfo,void callback());
1149 dynamic onChildUnavailable(int childKey,[Function responseFactory = null]); 1197 void onChildUnavailable(int childKey,void callback());
1150 } 1198 }
1151 1199
1152 abstract class ViewContainerListenerInterface 1200 abstract class ViewContainerListenerInterface
1153 implements bindings.MojoInterface<ViewContainerListener>, 1201 implements bindings.MojoInterface<ViewContainerListener>,
1154 ViewContainerListener { 1202 ViewContainerListener {
1155 factory ViewContainerListenerInterface([ViewContainerListener impl]) => 1203 factory ViewContainerListenerInterface([ViewContainerListener impl]) =>
1156 new ViewContainerListenerStub.unbound(impl); 1204 new ViewContainerListenerStub.unbound(impl);
1157 1205
1158 factory ViewContainerListenerInterface.fromEndpoint( 1206 factory ViewContainerListenerInterface.fromEndpoint(
1159 core.MojoMessagePipeEndpoint endpoint, 1207 core.MojoMessagePipeEndpoint endpoint,
(...skipping 29 matching lines...) Expand all
1189 1237
1190 void handleResponse(bindings.ServiceMessage message) { 1238 void handleResponse(bindings.ServiceMessage message) {
1191 switch (message.header.type) { 1239 switch (message.header.type) {
1192 case _viewContainerListenerMethodOnChildAttachedName: 1240 case _viewContainerListenerMethodOnChildAttachedName:
1193 var r = ViewContainerListenerOnChildAttachedResponseParams.deserialize( 1241 var r = ViewContainerListenerOnChildAttachedResponseParams.deserialize(
1194 message.payload); 1242 message.payload);
1195 if (!message.header.hasRequestId) { 1243 if (!message.header.hasRequestId) {
1196 proxyError("Expected a message with a valid request Id."); 1244 proxyError("Expected a message with a valid request Id.");
1197 return; 1245 return;
1198 } 1246 }
1199 Completer c = completerMap[message.header.requestId]; 1247 Function callback = callbackMap[message.header.requestId];
1200 if (c == null) { 1248 if (callback == null) {
1201 proxyError( 1249 proxyError(
1202 "Message had unknown request Id: ${message.header.requestId}"); 1250 "Message had unknown request Id: ${message.header.requestId}");
1203 return; 1251 return;
1204 } 1252 }
1205 completerMap.remove(message.header.requestId); 1253 callbackMap.remove(message.header.requestId);
1206 if (c.isCompleted) { 1254 callback();
1207 proxyError("Response completer already completed");
1208 return;
1209 }
1210 c.complete(r);
1211 break; 1255 break;
1212 case _viewContainerListenerMethodOnChildUnavailableName: 1256 case _viewContainerListenerMethodOnChildUnavailableName:
1213 var r = ViewContainerListenerOnChildUnavailableResponseParams.deserializ e( 1257 var r = ViewContainerListenerOnChildUnavailableResponseParams.deserializ e(
1214 message.payload); 1258 message.payload);
1215 if (!message.header.hasRequestId) { 1259 if (!message.header.hasRequestId) {
1216 proxyError("Expected a message with a valid request Id."); 1260 proxyError("Expected a message with a valid request Id.");
1217 return; 1261 return;
1218 } 1262 }
1219 Completer c = completerMap[message.header.requestId]; 1263 Function callback = callbackMap[message.header.requestId];
1220 if (c == null) { 1264 if (callback == null) {
1221 proxyError( 1265 proxyError(
1222 "Message had unknown request Id: ${message.header.requestId}"); 1266 "Message had unknown request Id: ${message.header.requestId}");
1223 return; 1267 return;
1224 } 1268 }
1225 completerMap.remove(message.header.requestId); 1269 callbackMap.remove(message.header.requestId);
1226 if (c.isCompleted) { 1270 callback();
1227 proxyError("Response completer already completed");
1228 return;
1229 }
1230 c.complete(r);
1231 break; 1271 break;
1232 default: 1272 default:
1233 proxyError("Unexpected message type: ${message.header.type}"); 1273 proxyError("Unexpected message type: ${message.header.type}");
1234 close(immediate: true); 1274 close(immediate: true);
1235 break; 1275 break;
1236 } 1276 }
1237 } 1277 }
1238 1278
1239 @override 1279 @override
1240 String toString() { 1280 String toString() {
(...skipping 24 matching lines...) Expand all
1265 return newMockedProxy; 1305 return newMockedProxy;
1266 } 1306 }
1267 1307
1268 static ViewContainerListenerProxy newFromEndpoint( 1308 static ViewContainerListenerProxy newFromEndpoint(
1269 core.MojoMessagePipeEndpoint endpoint) { 1309 core.MojoMessagePipeEndpoint endpoint) {
1270 assert(endpoint.setDescription("For ViewContainerListenerProxy")); 1310 assert(endpoint.setDescription("For ViewContainerListenerProxy"));
1271 return new ViewContainerListenerProxy.fromEndpoint(endpoint); 1311 return new ViewContainerListenerProxy.fromEndpoint(endpoint);
1272 } 1312 }
1273 1313
1274 1314
1275 dynamic onChildAttached(int childKey,ViewInfo childViewInfo,[Function response Factory = null]) { 1315 void onChildAttached(int childKey,ViewInfo childViewInfo,void callback()) {
1276 if (impl != null) { 1316 if (impl != null) {
1277 return new Future(() => impl.onChildAttached(childKey,childViewInfo,_ViewC ontainerListenerStubControl._viewContainerListenerOnChildAttachedResponseParamsF actory)); 1317 impl.onChildAttached(childKey,childViewInfo,callback);
1318 return;
1278 } 1319 }
1279 var params = new _ViewContainerListenerOnChildAttachedParams(); 1320 var params = new _ViewContainerListenerOnChildAttachedParams();
1280 params.childKey = childKey; 1321 params.childKey = childKey;
1281 params.childViewInfo = childViewInfo; 1322 params.childViewInfo = childViewInfo;
1282 return ctrl.sendMessageWithRequestId( 1323 ctrl.sendMessageWithRequestId(
1283 params, 1324 params,
1284 _viewContainerListenerMethodOnChildAttachedName, 1325 _viewContainerListenerMethodOnChildAttachedName,
1285 -1, 1326 -1,
1286 bindings.MessageHeader.kMessageExpectsResponse); 1327 bindings.MessageHeader.kMessageExpectsResponse,
1328 callback);
1287 } 1329 }
1288 dynamic onChildUnavailable(int childKey,[Function responseFactory = null]) { 1330 void onChildUnavailable(int childKey,void callback()) {
1289 if (impl != null) { 1331 if (impl != null) {
1290 return new Future(() => impl.onChildUnavailable(childKey,_ViewContainerLis tenerStubControl._viewContainerListenerOnChildUnavailableResponseParamsFactory)) ; 1332 impl.onChildUnavailable(childKey,callback);
1333 return;
1291 } 1334 }
1292 var params = new _ViewContainerListenerOnChildUnavailableParams(); 1335 var params = new _ViewContainerListenerOnChildUnavailableParams();
1293 params.childKey = childKey; 1336 params.childKey = childKey;
1294 return ctrl.sendMessageWithRequestId( 1337 ctrl.sendMessageWithRequestId(
1295 params, 1338 params,
1296 _viewContainerListenerMethodOnChildUnavailableName, 1339 _viewContainerListenerMethodOnChildUnavailableName,
1297 -1, 1340 -1,
1298 bindings.MessageHeader.kMessageExpectsResponse); 1341 bindings.MessageHeader.kMessageExpectsResponse,
1342 callback);
1299 } 1343 }
1300 } 1344 }
1301 1345
1302 class _ViewContainerListenerStubControl 1346 class _ViewContainerListenerStubControl
1303 extends bindings.StubMessageHandler 1347 extends bindings.StubMessageHandler
1304 implements bindings.StubControl<ViewContainerListener> { 1348 implements bindings.StubControl<ViewContainerListener> {
1305 ViewContainerListener _impl; 1349 ViewContainerListener _impl;
1306 1350
1307 _ViewContainerListenerStubControl.fromEndpoint( 1351 _ViewContainerListenerStubControl.fromEndpoint(
1308 core.MojoMessagePipeEndpoint endpoint, [ViewContainerListener impl]) 1352 core.MojoMessagePipeEndpoint endpoint, [ViewContainerListener impl])
1309 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 1353 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
1310 _impl = impl; 1354 _impl = impl;
1311 } 1355 }
1312 1356
1313 _ViewContainerListenerStubControl.fromHandle( 1357 _ViewContainerListenerStubControl.fromHandle(
1314 core.MojoHandle handle, [ViewContainerListener impl]) 1358 core.MojoHandle handle, [ViewContainerListener impl])
1315 : super.fromHandle(handle, autoBegin: impl != null) { 1359 : super.fromHandle(handle, autoBegin: impl != null) {
1316 _impl = impl; 1360 _impl = impl;
1317 } 1361 }
1318 1362
1319 _ViewContainerListenerStubControl.unbound([this._impl]) : super.unbound(); 1363 _ViewContainerListenerStubControl.unbound([this._impl]) : super.unbound();
1320 1364
1321 String get serviceName => ViewContainerListener.serviceName; 1365 String get serviceName => ViewContainerListener.serviceName;
1322 1366
1323 1367
1324 static ViewContainerListenerOnChildAttachedResponseParams _viewContainerListen erOnChildAttachedResponseParamsFactory() { 1368 Function _viewContainerListenerOnChildAttachedResponseParamsResponder(
1325 var result = new ViewContainerListenerOnChildAttachedResponseParams(); 1369 int requestId) {
1326 return result; 1370 return () {
1371 var result = new ViewContainerListenerOnChildAttachedResponseParams();
1372 sendResponse(buildResponseWithId(
1373 result,
1374 _viewContainerListenerMethodOnChildAttachedName,
1375 requestId,
1376 bindings.MessageHeader.kMessageIsResponse));
1377 };
1327 } 1378 }
1328 static ViewContainerListenerOnChildUnavailableResponseParams _viewContainerLis tenerOnChildUnavailableResponseParamsFactory() { 1379 Function _viewContainerListenerOnChildUnavailableResponseParamsResponder(
1329 var result = new ViewContainerListenerOnChildUnavailableResponseParams(); 1380 int requestId) {
1330 return result; 1381 return () {
1382 var result = new ViewContainerListenerOnChildUnavailableResponseParams();
1383 sendResponse(buildResponseWithId(
1384 result,
1385 _viewContainerListenerMethodOnChildUnavailableName,
1386 requestId,
1387 bindings.MessageHeader.kMessageIsResponse));
1388 };
1331 } 1389 }
1332 1390
1333 dynamic handleMessage(bindings.ServiceMessage message) { 1391 void handleMessage(bindings.ServiceMessage message) {
1334 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1392 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1335 return bindings.ControlMessageHandler.handleMessage(this, 1393 bindings.ControlMessageHandler.handleMessage(
1336 0, 1394 this, 0, message);
1337 message); 1395 return;
1338 } 1396 }
1339 if (_impl == null) { 1397 if (_impl == null) {
1340 throw new core.MojoApiError("$this has no implementation set"); 1398 throw new core.MojoApiError("$this has no implementation set");
1341 } 1399 }
1342 switch (message.header.type) { 1400 switch (message.header.type) {
1343 case _viewContainerListenerMethodOnChildAttachedName: 1401 case _viewContainerListenerMethodOnChildAttachedName:
1344 var params = _ViewContainerListenerOnChildAttachedParams.deserialize( 1402 var params = _ViewContainerListenerOnChildAttachedParams.deserialize(
1345 message.payload); 1403 message.payload);
1346 var response = _impl.onChildAttached(params.childKey,params.childViewInf o,_viewContainerListenerOnChildAttachedResponseParamsFactory); 1404 _impl.onChildAttached(params.childKey, params.childViewInfo, _viewContai nerListenerOnChildAttachedResponseParamsResponder(message.header.requestId));
1347 if (response is Future) {
1348 return response.then((response) {
1349 if (response != null) {
1350 return buildResponseWithId(
1351 response,
1352 _viewContainerListenerMethodOnChildAttachedName,
1353 message.header.requestId,
1354 bindings.MessageHeader.kMessageIsResponse);
1355 }
1356 });
1357 } else if (response != null) {
1358 return buildResponseWithId(
1359 response,
1360 _viewContainerListenerMethodOnChildAttachedName,
1361 message.header.requestId,
1362 bindings.MessageHeader.kMessageIsResponse);
1363 }
1364 break; 1405 break;
1365 case _viewContainerListenerMethodOnChildUnavailableName: 1406 case _viewContainerListenerMethodOnChildUnavailableName:
1366 var params = _ViewContainerListenerOnChildUnavailableParams.deserialize( 1407 var params = _ViewContainerListenerOnChildUnavailableParams.deserialize(
1367 message.payload); 1408 message.payload);
1368 var response = _impl.onChildUnavailable(params.childKey,_viewContainerLi stenerOnChildUnavailableResponseParamsFactory); 1409 _impl.onChildUnavailable(params.childKey, _viewContainerListenerOnChildU navailableResponseParamsResponder(message.header.requestId));
1369 if (response is Future) {
1370 return response.then((response) {
1371 if (response != null) {
1372 return buildResponseWithId(
1373 response,
1374 _viewContainerListenerMethodOnChildUnavailableName,
1375 message.header.requestId,
1376 bindings.MessageHeader.kMessageIsResponse);
1377 }
1378 });
1379 } else if (response != null) {
1380 return buildResponseWithId(
1381 response,
1382 _viewContainerListenerMethodOnChildUnavailableName,
1383 message.header.requestId,
1384 bindings.MessageHeader.kMessageIsResponse);
1385 }
1386 break; 1410 break;
1387 default: 1411 default:
1388 throw new bindings.MojoCodecError("Unexpected message name"); 1412 throw new bindings.MojoCodecError("Unexpected message name");
1389 break; 1413 break;
1390 } 1414 }
1391 return null;
1392 } 1415 }
1393 1416
1394 ViewContainerListener get impl => _impl; 1417 ViewContainerListener get impl => _impl;
1395 set impl(ViewContainerListener d) { 1418 set impl(ViewContainerListener d) {
1396 if (d == null) { 1419 if (d == null) {
1397 throw new core.MojoApiError("$this: Cannot set a null implementation"); 1420 throw new core.MojoApiError("$this: Cannot set a null implementation");
1398 } 1421 }
1399 if (isBound && (_impl == null)) { 1422 if (isBound && (_impl == null)) {
1400 beginHandlingEvents(); 1423 beginHandlingEvents();
1401 } 1424 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 core.MojoHandle handle, [ViewContainerListener impl]) 1458 core.MojoHandle handle, [ViewContainerListener impl])
1436 : super(new _ViewContainerListenerStubControl.fromHandle(handle, impl)); 1459 : super(new _ViewContainerListenerStubControl.fromHandle(handle, impl));
1437 1460
1438 static ViewContainerListenerStub newFromEndpoint( 1461 static ViewContainerListenerStub newFromEndpoint(
1439 core.MojoMessagePipeEndpoint endpoint) { 1462 core.MojoMessagePipeEndpoint endpoint) {
1440 assert(endpoint.setDescription("For ViewContainerListenerStub")); 1463 assert(endpoint.setDescription("For ViewContainerListenerStub"));
1441 return new ViewContainerListenerStub.fromEndpoint(endpoint); 1464 return new ViewContainerListenerStub.fromEndpoint(endpoint);
1442 } 1465 }
1443 1466
1444 1467
1445 dynamic onChildAttached(int childKey,ViewInfo childViewInfo,[Function response Factory = null]) { 1468 void onChildAttached(int childKey,ViewInfo childViewInfo,void callback()) {
1446 return impl.onChildAttached(childKey,childViewInfo,responseFactory); 1469 return impl.onChildAttached(childKey,childViewInfo,callback);
1447 } 1470 }
1448 dynamic onChildUnavailable(int childKey,[Function responseFactory = null]) { 1471 void onChildUnavailable(int childKey,void callback()) {
1449 return impl.onChildUnavailable(childKey,responseFactory); 1472 return impl.onChildUnavailable(childKey,callback);
1450 } 1473 }
1451 } 1474 }
1452 1475
1453 1476
1454 1477
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698