OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library surfaces_mojom; | 5 library surfaces_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
10 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; | 10 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 | 101 |
102 class Mailbox extends bindings.Struct { | 102 class Mailbox extends bindings.Struct { |
103 static const List<bindings.StructDataHeader> kVersions = const [ | 103 static const List<bindings.StructDataHeader> kVersions = const [ |
104 const bindings.StructDataHeader(16, 0) | 104 const bindings.StructDataHeader(16, 0) |
105 ]; | 105 ]; |
106 List<int> name = null; | 106 List<int> name = null; |
107 | 107 |
108 Mailbox() : super(kVersions.last.size); | 108 Mailbox() : super(kVersions.last.size); |
109 | 109 |
| 110 Mailbox.init( |
| 111 List<int> this.name |
| 112 ) : super(kVersions.last.size); |
| 113 |
110 static Mailbox deserialize(bindings.Message message) { | 114 static Mailbox deserialize(bindings.Message message) { |
111 var decoder = new bindings.Decoder(message); | 115 var decoder = new bindings.Decoder(message); |
112 var result = decode(decoder); | 116 var result = decode(decoder); |
113 if (decoder.excessHandles != null) { | 117 if (decoder.excessHandles != null) { |
114 decoder.excessHandles.forEach((h) => h.close()); | 118 decoder.excessHandles.forEach((h) => h.close()); |
115 } | 119 } |
116 return result; | 120 return result; |
117 } | 121 } |
118 | 122 |
119 static Mailbox decode(bindings.Decoder decoder0) { | 123 static Mailbox decode(bindings.Decoder decoder0) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 class MailboxHolder extends bindings.Struct { | 178 class MailboxHolder extends bindings.Struct { |
175 static const List<bindings.StructDataHeader> kVersions = const [ | 179 static const List<bindings.StructDataHeader> kVersions = const [ |
176 const bindings.StructDataHeader(24, 0) | 180 const bindings.StructDataHeader(24, 0) |
177 ]; | 181 ]; |
178 Mailbox mailbox = null; | 182 Mailbox mailbox = null; |
179 int textureTarget = 0; | 183 int textureTarget = 0; |
180 int syncPoint = 0; | 184 int syncPoint = 0; |
181 | 185 |
182 MailboxHolder() : super(kVersions.last.size); | 186 MailboxHolder() : super(kVersions.last.size); |
183 | 187 |
| 188 MailboxHolder.init( |
| 189 Mailbox this.mailbox, |
| 190 int this.textureTarget, |
| 191 int this.syncPoint |
| 192 ) : super(kVersions.last.size); |
| 193 |
184 static MailboxHolder deserialize(bindings.Message message) { | 194 static MailboxHolder deserialize(bindings.Message message) { |
185 var decoder = new bindings.Decoder(message); | 195 var decoder = new bindings.Decoder(message); |
186 var result = decode(decoder); | 196 var result = decode(decoder); |
187 if (decoder.excessHandles != null) { | 197 if (decoder.excessHandles != null) { |
188 decoder.excessHandles.forEach((h) => h.close()); | 198 decoder.excessHandles.forEach((h) => h.close()); |
189 } | 199 } |
190 return result; | 200 return result; |
191 } | 201 } |
192 | 202 |
193 static MailboxHolder decode(bindings.Decoder decoder0) { | 203 static MailboxHolder decode(bindings.Decoder decoder0) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 int id = 0; | 289 int id = 0; |
280 ResourceFormat format = null; | 290 ResourceFormat format = null; |
281 int filter = 0; | 291 int filter = 0; |
282 bool isRepeated = false; | 292 bool isRepeated = false; |
283 bool isSoftware = false; | 293 bool isSoftware = false; |
284 geometry_mojom.Size size = null; | 294 geometry_mojom.Size size = null; |
285 MailboxHolder mailboxHolder = null; | 295 MailboxHolder mailboxHolder = null; |
286 | 296 |
287 TransferableResource() : super(kVersions.last.size); | 297 TransferableResource() : super(kVersions.last.size); |
288 | 298 |
| 299 TransferableResource.init( |
| 300 int this.id, |
| 301 ResourceFormat this.format, |
| 302 int this.filter, |
| 303 bool this.isRepeated, |
| 304 bool this.isSoftware, |
| 305 geometry_mojom.Size this.size, |
| 306 MailboxHolder this.mailboxHolder |
| 307 ) : super(kVersions.last.size); |
| 308 |
289 static TransferableResource deserialize(bindings.Message message) { | 309 static TransferableResource deserialize(bindings.Message message) { |
290 var decoder = new bindings.Decoder(message); | 310 var decoder = new bindings.Decoder(message); |
291 var result = decode(decoder); | 311 var result = decode(decoder); |
292 if (decoder.excessHandles != null) { | 312 if (decoder.excessHandles != null) { |
293 decoder.excessHandles.forEach((h) => h.close()); | 313 decoder.excessHandles.forEach((h) => h.close()); |
294 } | 314 } |
295 return result; | 315 return result; |
296 } | 316 } |
297 | 317 |
298 static TransferableResource decode(bindings.Decoder decoder0) { | 318 static TransferableResource decode(bindings.Decoder decoder0) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 static const List<bindings.StructDataHeader> kVersions = const [ | 458 static const List<bindings.StructDataHeader> kVersions = const [ |
439 const bindings.StructDataHeader(24, 0) | 459 const bindings.StructDataHeader(24, 0) |
440 ]; | 460 ]; |
441 int id = 0; | 461 int id = 0; |
442 int syncPoint = 0; | 462 int syncPoint = 0; |
443 int count = 0; | 463 int count = 0; |
444 bool lost = false; | 464 bool lost = false; |
445 | 465 |
446 ReturnedResource() : super(kVersions.last.size); | 466 ReturnedResource() : super(kVersions.last.size); |
447 | 467 |
| 468 ReturnedResource.init( |
| 469 int this.id, |
| 470 int this.syncPoint, |
| 471 int this.count, |
| 472 bool this.lost |
| 473 ) : super(kVersions.last.size); |
| 474 |
448 static ReturnedResource deserialize(bindings.Message message) { | 475 static ReturnedResource deserialize(bindings.Message message) { |
449 var decoder = new bindings.Decoder(message); | 476 var decoder = new bindings.Decoder(message); |
450 var result = decode(decoder); | 477 var result = decode(decoder); |
451 if (decoder.excessHandles != null) { | 478 if (decoder.excessHandles != null) { |
452 decoder.excessHandles.forEach((h) => h.close()); | 479 decoder.excessHandles.forEach((h) => h.close()); |
453 } | 480 } |
454 return result; | 481 return result; |
455 } | 482 } |
456 | 483 |
457 static ReturnedResource decode(bindings.Decoder decoder0) { | 484 static ReturnedResource decode(bindings.Decoder decoder0) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 577 |
551 class Frame extends bindings.Struct { | 578 class Frame extends bindings.Struct { |
552 static const List<bindings.StructDataHeader> kVersions = const [ | 579 static const List<bindings.StructDataHeader> kVersions = const [ |
553 const bindings.StructDataHeader(24, 0) | 580 const bindings.StructDataHeader(24, 0) |
554 ]; | 581 ]; |
555 List<TransferableResource> resources = null; | 582 List<TransferableResource> resources = null; |
556 List<quads_mojom.Pass> passes = null; | 583 List<quads_mojom.Pass> passes = null; |
557 | 584 |
558 Frame() : super(kVersions.last.size); | 585 Frame() : super(kVersions.last.size); |
559 | 586 |
| 587 Frame.init( |
| 588 List<TransferableResource> this.resources, |
| 589 List<quads_mojom.Pass> this.passes |
| 590 ) : super(kVersions.last.size); |
| 591 |
560 static Frame deserialize(bindings.Message message) { | 592 static Frame deserialize(bindings.Message message) { |
561 var decoder = new bindings.Decoder(message); | 593 var decoder = new bindings.Decoder(message); |
562 var result = decode(decoder); | 594 var result = decode(decoder); |
563 if (decoder.excessHandles != null) { | 595 if (decoder.excessHandles != null) { |
564 decoder.excessHandles.forEach((h) => h.close()); | 596 decoder.excessHandles.forEach((h) => h.close()); |
565 } | 597 } |
566 return result; | 598 return result; |
567 } | 599 } |
568 | 600 |
569 static Frame decode(bindings.Decoder decoder0) { | 601 static Frame decode(bindings.Decoder decoder0) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 699 |
668 | 700 |
669 class _ResourceReturnerReturnResourcesParams extends bindings.Struct { | 701 class _ResourceReturnerReturnResourcesParams extends bindings.Struct { |
670 static const List<bindings.StructDataHeader> kVersions = const [ | 702 static const List<bindings.StructDataHeader> kVersions = const [ |
671 const bindings.StructDataHeader(16, 0) | 703 const bindings.StructDataHeader(16, 0) |
672 ]; | 704 ]; |
673 List<ReturnedResource> resources = null; | 705 List<ReturnedResource> resources = null; |
674 | 706 |
675 _ResourceReturnerReturnResourcesParams() : super(kVersions.last.size); | 707 _ResourceReturnerReturnResourcesParams() : super(kVersions.last.size); |
676 | 708 |
| 709 _ResourceReturnerReturnResourcesParams.init( |
| 710 List<ReturnedResource> this.resources |
| 711 ) : super(kVersions.last.size); |
| 712 |
677 static _ResourceReturnerReturnResourcesParams deserialize(bindings.Message mes
sage) { | 713 static _ResourceReturnerReturnResourcesParams deserialize(bindings.Message mes
sage) { |
678 var decoder = new bindings.Decoder(message); | 714 var decoder = new bindings.Decoder(message); |
679 var result = decode(decoder); | 715 var result = decode(decoder); |
680 if (decoder.excessHandles != null) { | 716 if (decoder.excessHandles != null) { |
681 decoder.excessHandles.forEach((h) => h.close()); | 717 decoder.excessHandles.forEach((h) => h.close()); |
682 } | 718 } |
683 return result; | 719 return result; |
684 } | 720 } |
685 | 721 |
686 static _ResourceReturnerReturnResourcesParams decode(bindings.Decoder decoder0
) { | 722 static _ResourceReturnerReturnResourcesParams decode(bindings.Decoder decoder0
) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 } | 790 } |
755 | 791 |
756 | 792 |
757 class _SurfaceGetIdNamespaceParams extends bindings.Struct { | 793 class _SurfaceGetIdNamespaceParams extends bindings.Struct { |
758 static const List<bindings.StructDataHeader> kVersions = const [ | 794 static const List<bindings.StructDataHeader> kVersions = const [ |
759 const bindings.StructDataHeader(8, 0) | 795 const bindings.StructDataHeader(8, 0) |
760 ]; | 796 ]; |
761 | 797 |
762 _SurfaceGetIdNamespaceParams() : super(kVersions.last.size); | 798 _SurfaceGetIdNamespaceParams() : super(kVersions.last.size); |
763 | 799 |
| 800 _SurfaceGetIdNamespaceParams.init( |
| 801 ) : super(kVersions.last.size); |
| 802 |
764 static _SurfaceGetIdNamespaceParams deserialize(bindings.Message message) { | 803 static _SurfaceGetIdNamespaceParams deserialize(bindings.Message message) { |
765 var decoder = new bindings.Decoder(message); | 804 var decoder = new bindings.Decoder(message); |
766 var result = decode(decoder); | 805 var result = decode(decoder); |
767 if (decoder.excessHandles != null) { | 806 if (decoder.excessHandles != null) { |
768 decoder.excessHandles.forEach((h) => h.close()); | 807 decoder.excessHandles.forEach((h) => h.close()); |
769 } | 808 } |
770 return result; | 809 return result; |
771 } | 810 } |
772 | 811 |
773 static _SurfaceGetIdNamespaceParams decode(bindings.Decoder decoder0) { | 812 static _SurfaceGetIdNamespaceParams decode(bindings.Decoder decoder0) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 | 852 |
814 | 853 |
815 class SurfaceGetIdNamespaceResponseParams extends bindings.Struct { | 854 class SurfaceGetIdNamespaceResponseParams extends bindings.Struct { |
816 static const List<bindings.StructDataHeader> kVersions = const [ | 855 static const List<bindings.StructDataHeader> kVersions = const [ |
817 const bindings.StructDataHeader(16, 0) | 856 const bindings.StructDataHeader(16, 0) |
818 ]; | 857 ]; |
819 int idNamespace = 0; | 858 int idNamespace = 0; |
820 | 859 |
821 SurfaceGetIdNamespaceResponseParams() : super(kVersions.last.size); | 860 SurfaceGetIdNamespaceResponseParams() : super(kVersions.last.size); |
822 | 861 |
| 862 SurfaceGetIdNamespaceResponseParams.init( |
| 863 int this.idNamespace |
| 864 ) : super(kVersions.last.size); |
| 865 |
823 static SurfaceGetIdNamespaceResponseParams deserialize(bindings.Message messag
e) { | 866 static SurfaceGetIdNamespaceResponseParams deserialize(bindings.Message messag
e) { |
824 var decoder = new bindings.Decoder(message); | 867 var decoder = new bindings.Decoder(message); |
825 var result = decode(decoder); | 868 var result = decode(decoder); |
826 if (decoder.excessHandles != null) { | 869 if (decoder.excessHandles != null) { |
827 decoder.excessHandles.forEach((h) => h.close()); | 870 decoder.excessHandles.forEach((h) => h.close()); |
828 } | 871 } |
829 return result; | 872 return result; |
830 } | 873 } |
831 | 874 |
832 static SurfaceGetIdNamespaceResponseParams decode(bindings.Decoder decoder0) { | 875 static SurfaceGetIdNamespaceResponseParams decode(bindings.Decoder decoder0) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 928 |
886 | 929 |
887 class _SurfaceSetResourceReturnerParams extends bindings.Struct { | 930 class _SurfaceSetResourceReturnerParams extends bindings.Struct { |
888 static const List<bindings.StructDataHeader> kVersions = const [ | 931 static const List<bindings.StructDataHeader> kVersions = const [ |
889 const bindings.StructDataHeader(16, 0) | 932 const bindings.StructDataHeader(16, 0) |
890 ]; | 933 ]; |
891 ResourceReturnerInterface returner = null; | 934 ResourceReturnerInterface returner = null; |
892 | 935 |
893 _SurfaceSetResourceReturnerParams() : super(kVersions.last.size); | 936 _SurfaceSetResourceReturnerParams() : super(kVersions.last.size); |
894 | 937 |
| 938 _SurfaceSetResourceReturnerParams.init( |
| 939 ResourceReturnerInterface this.returner |
| 940 ) : super(kVersions.last.size); |
| 941 |
895 static _SurfaceSetResourceReturnerParams deserialize(bindings.Message message)
{ | 942 static _SurfaceSetResourceReturnerParams deserialize(bindings.Message message)
{ |
896 var decoder = new bindings.Decoder(message); | 943 var decoder = new bindings.Decoder(message); |
897 var result = decode(decoder); | 944 var result = decode(decoder); |
898 if (decoder.excessHandles != null) { | 945 if (decoder.excessHandles != null) { |
899 decoder.excessHandles.forEach((h) => h.close()); | 946 decoder.excessHandles.forEach((h) => h.close()); |
900 } | 947 } |
901 return result; | 948 return result; |
902 } | 949 } |
903 | 950 |
904 static _SurfaceSetResourceReturnerParams decode(bindings.Decoder decoder0) { | 951 static _SurfaceSetResourceReturnerParams decode(bindings.Decoder decoder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 | 1003 |
957 | 1004 |
958 class _SurfaceCreateSurfaceParams extends bindings.Struct { | 1005 class _SurfaceCreateSurfaceParams extends bindings.Struct { |
959 static const List<bindings.StructDataHeader> kVersions = const [ | 1006 static const List<bindings.StructDataHeader> kVersions = const [ |
960 const bindings.StructDataHeader(16, 0) | 1007 const bindings.StructDataHeader(16, 0) |
961 ]; | 1008 ]; |
962 int idLocal = 0; | 1009 int idLocal = 0; |
963 | 1010 |
964 _SurfaceCreateSurfaceParams() : super(kVersions.last.size); | 1011 _SurfaceCreateSurfaceParams() : super(kVersions.last.size); |
965 | 1012 |
| 1013 _SurfaceCreateSurfaceParams.init( |
| 1014 int this.idLocal |
| 1015 ) : super(kVersions.last.size); |
| 1016 |
966 static _SurfaceCreateSurfaceParams deserialize(bindings.Message message) { | 1017 static _SurfaceCreateSurfaceParams deserialize(bindings.Message message) { |
967 var decoder = new bindings.Decoder(message); | 1018 var decoder = new bindings.Decoder(message); |
968 var result = decode(decoder); | 1019 var result = decode(decoder); |
969 if (decoder.excessHandles != null) { | 1020 if (decoder.excessHandles != null) { |
970 decoder.excessHandles.forEach((h) => h.close()); | 1021 decoder.excessHandles.forEach((h) => h.close()); |
971 } | 1022 } |
972 return result; | 1023 return result; |
973 } | 1024 } |
974 | 1025 |
975 static _SurfaceCreateSurfaceParams decode(bindings.Decoder decoder0) { | 1026 static _SurfaceCreateSurfaceParams decode(bindings.Decoder decoder0) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 | 1080 |
1030 class _SurfaceSubmitFrameParams extends bindings.Struct { | 1081 class _SurfaceSubmitFrameParams extends bindings.Struct { |
1031 static const List<bindings.StructDataHeader> kVersions = const [ | 1082 static const List<bindings.StructDataHeader> kVersions = const [ |
1032 const bindings.StructDataHeader(24, 0) | 1083 const bindings.StructDataHeader(24, 0) |
1033 ]; | 1084 ]; |
1034 int idLocal = 0; | 1085 int idLocal = 0; |
1035 Frame frame = null; | 1086 Frame frame = null; |
1036 | 1087 |
1037 _SurfaceSubmitFrameParams() : super(kVersions.last.size); | 1088 _SurfaceSubmitFrameParams() : super(kVersions.last.size); |
1038 | 1089 |
| 1090 _SurfaceSubmitFrameParams.init( |
| 1091 int this.idLocal, |
| 1092 Frame this.frame |
| 1093 ) : super(kVersions.last.size); |
| 1094 |
1039 static _SurfaceSubmitFrameParams deserialize(bindings.Message message) { | 1095 static _SurfaceSubmitFrameParams deserialize(bindings.Message message) { |
1040 var decoder = new bindings.Decoder(message); | 1096 var decoder = new bindings.Decoder(message); |
1041 var result = decode(decoder); | 1097 var result = decode(decoder); |
1042 if (decoder.excessHandles != null) { | 1098 if (decoder.excessHandles != null) { |
1043 decoder.excessHandles.forEach((h) => h.close()); | 1099 decoder.excessHandles.forEach((h) => h.close()); |
1044 } | 1100 } |
1045 return result; | 1101 return result; |
1046 } | 1102 } |
1047 | 1103 |
1048 static _SurfaceSubmitFrameParams decode(bindings.Decoder decoder0) { | 1104 static _SurfaceSubmitFrameParams decode(bindings.Decoder decoder0) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 } | 1170 } |
1115 | 1171 |
1116 | 1172 |
1117 class SurfaceSubmitFrameResponseParams extends bindings.Struct { | 1173 class SurfaceSubmitFrameResponseParams extends bindings.Struct { |
1118 static const List<bindings.StructDataHeader> kVersions = const [ | 1174 static const List<bindings.StructDataHeader> kVersions = const [ |
1119 const bindings.StructDataHeader(8, 0) | 1175 const bindings.StructDataHeader(8, 0) |
1120 ]; | 1176 ]; |
1121 | 1177 |
1122 SurfaceSubmitFrameResponseParams() : super(kVersions.last.size); | 1178 SurfaceSubmitFrameResponseParams() : super(kVersions.last.size); |
1123 | 1179 |
| 1180 SurfaceSubmitFrameResponseParams.init( |
| 1181 ) : super(kVersions.last.size); |
| 1182 |
1124 static SurfaceSubmitFrameResponseParams deserialize(bindings.Message message)
{ | 1183 static SurfaceSubmitFrameResponseParams deserialize(bindings.Message message)
{ |
1125 var decoder = new bindings.Decoder(message); | 1184 var decoder = new bindings.Decoder(message); |
1126 var result = decode(decoder); | 1185 var result = decode(decoder); |
1127 if (decoder.excessHandles != null) { | 1186 if (decoder.excessHandles != null) { |
1128 decoder.excessHandles.forEach((h) => h.close()); | 1187 decoder.excessHandles.forEach((h) => h.close()); |
1129 } | 1188 } |
1130 return result; | 1189 return result; |
1131 } | 1190 } |
1132 | 1191 |
1133 static SurfaceSubmitFrameResponseParams decode(bindings.Decoder decoder0) { | 1192 static SurfaceSubmitFrameResponseParams decode(bindings.Decoder decoder0) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1232 |
1174 | 1233 |
1175 class _SurfaceDestroySurfaceParams extends bindings.Struct { | 1234 class _SurfaceDestroySurfaceParams extends bindings.Struct { |
1176 static const List<bindings.StructDataHeader> kVersions = const [ | 1235 static const List<bindings.StructDataHeader> kVersions = const [ |
1177 const bindings.StructDataHeader(16, 0) | 1236 const bindings.StructDataHeader(16, 0) |
1178 ]; | 1237 ]; |
1179 int idLocal = 0; | 1238 int idLocal = 0; |
1180 | 1239 |
1181 _SurfaceDestroySurfaceParams() : super(kVersions.last.size); | 1240 _SurfaceDestroySurfaceParams() : super(kVersions.last.size); |
1182 | 1241 |
| 1242 _SurfaceDestroySurfaceParams.init( |
| 1243 int this.idLocal |
| 1244 ) : super(kVersions.last.size); |
| 1245 |
1183 static _SurfaceDestroySurfaceParams deserialize(bindings.Message message) { | 1246 static _SurfaceDestroySurfaceParams deserialize(bindings.Message message) { |
1184 var decoder = new bindings.Decoder(message); | 1247 var decoder = new bindings.Decoder(message); |
1185 var result = decode(decoder); | 1248 var result = decode(decoder); |
1186 if (decoder.excessHandles != null) { | 1249 if (decoder.excessHandles != null) { |
1187 decoder.excessHandles.forEach((h) => h.close()); | 1250 decoder.excessHandles.forEach((h) => h.close()); |
1188 } | 1251 } |
1189 return result; | 1252 return result; |
1190 } | 1253 } |
1191 | 1254 |
1192 static _SurfaceDestroySurfaceParams decode(bindings.Decoder decoder0) { | 1255 static _SurfaceDestroySurfaceParams decode(bindings.Decoder decoder0) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 Map toJson() { | 1302 Map toJson() { |
1240 Map map = new Map(); | 1303 Map map = new Map(); |
1241 map["idLocal"] = idLocal; | 1304 map["idLocal"] = idLocal; |
1242 return map; | 1305 return map; |
1243 } | 1306 } |
1244 } | 1307 } |
1245 | 1308 |
1246 const int _resourceReturnerMethodReturnResourcesName = 0; | 1309 const int _resourceReturnerMethodReturnResourcesName = 0; |
1247 | 1310 |
1248 class _ResourceReturnerServiceDescription implements service_describer.ServiceDe
scription { | 1311 class _ResourceReturnerServiceDescription implements service_describer.ServiceDe
scription { |
1249 dynamic getTopLevelInterface([Function responseFactory]) => | 1312 void getTopLevelInterface(Function responder) { |
1250 responseFactory(null); | 1313 responder(null); |
| 1314 } |
1251 | 1315 |
1252 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1316 void getTypeDefinition(String typeKey, Function responder) { |
1253 responseFactory(null); | 1317 responder(null); |
| 1318 } |
1254 | 1319 |
1255 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1320 void getAllTypeDefinitions(Function responder) { |
1256 responseFactory(null); | 1321 responder(null); |
| 1322 } |
1257 } | 1323 } |
1258 | 1324 |
1259 abstract class ResourceReturner { | 1325 abstract class ResourceReturner { |
1260 static const String serviceName = null; | 1326 static const String serviceName = null; |
1261 | 1327 |
1262 static service_describer.ServiceDescription _cachedServiceDescription; | 1328 static service_describer.ServiceDescription _cachedServiceDescription; |
1263 static service_describer.ServiceDescription get serviceDescription { | 1329 static service_describer.ServiceDescription get serviceDescription { |
1264 if (_cachedServiceDescription == null) { | 1330 if (_cachedServiceDescription == null) { |
1265 _cachedServiceDescription = new _ResourceReturnerServiceDescription(); | 1331 _cachedServiceDescription = new _ResourceReturnerServiceDescription(); |
1266 } | 1332 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 : super.fromHandle(handle, autoBegin: impl != null) { | 1462 : super.fromHandle(handle, autoBegin: impl != null) { |
1397 _impl = impl; | 1463 _impl = impl; |
1398 } | 1464 } |
1399 | 1465 |
1400 _ResourceReturnerStubControl.unbound([this._impl]) : super.unbound(); | 1466 _ResourceReturnerStubControl.unbound([this._impl]) : super.unbound(); |
1401 | 1467 |
1402 String get serviceName => ResourceReturner.serviceName; | 1468 String get serviceName => ResourceReturner.serviceName; |
1403 | 1469 |
1404 | 1470 |
1405 | 1471 |
1406 dynamic handleMessage(bindings.ServiceMessage message) { | 1472 void handleMessage(bindings.ServiceMessage message) { |
1407 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1473 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1408 return bindings.ControlMessageHandler.handleMessage(this, | 1474 bindings.ControlMessageHandler.handleMessage( |
1409 0, | 1475 this, 0, message); |
1410 message); | 1476 return; |
1411 } | 1477 } |
1412 if (_impl == null) { | 1478 if (_impl == null) { |
1413 throw new core.MojoApiError("$this has no implementation set"); | 1479 throw new core.MojoApiError("$this has no implementation set"); |
1414 } | 1480 } |
1415 switch (message.header.type) { | 1481 switch (message.header.type) { |
1416 case _resourceReturnerMethodReturnResourcesName: | 1482 case _resourceReturnerMethodReturnResourcesName: |
1417 var params = _ResourceReturnerReturnResourcesParams.deserialize( | 1483 var params = _ResourceReturnerReturnResourcesParams.deserialize( |
1418 message.payload); | 1484 message.payload); |
1419 _impl.returnResources(params.resources); | 1485 _impl.returnResources(params.resources); |
1420 break; | 1486 break; |
1421 default: | 1487 default: |
1422 throw new bindings.MojoCodecError("Unexpected message name"); | 1488 throw new bindings.MojoCodecError("Unexpected message name"); |
1423 break; | 1489 break; |
1424 } | 1490 } |
1425 return null; | |
1426 } | 1491 } |
1427 | 1492 |
1428 ResourceReturner get impl => _impl; | 1493 ResourceReturner get impl => _impl; |
1429 set impl(ResourceReturner d) { | 1494 set impl(ResourceReturner d) { |
1430 if (d == null) { | 1495 if (d == null) { |
1431 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1496 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
1432 } | 1497 } |
1433 if (isBound && (_impl == null)) { | 1498 if (isBound && (_impl == null)) { |
1434 beginHandlingEvents(); | 1499 beginHandlingEvents(); |
1435 } | 1500 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 } | 1546 } |
1482 } | 1547 } |
1483 | 1548 |
1484 const int _surfaceMethodGetIdNamespaceName = 0; | 1549 const int _surfaceMethodGetIdNamespaceName = 0; |
1485 const int _surfaceMethodSetResourceReturnerName = 1; | 1550 const int _surfaceMethodSetResourceReturnerName = 1; |
1486 const int _surfaceMethodCreateSurfaceName = 2; | 1551 const int _surfaceMethodCreateSurfaceName = 2; |
1487 const int _surfaceMethodSubmitFrameName = 3; | 1552 const int _surfaceMethodSubmitFrameName = 3; |
1488 const int _surfaceMethodDestroySurfaceName = 4; | 1553 const int _surfaceMethodDestroySurfaceName = 4; |
1489 | 1554 |
1490 class _SurfaceServiceDescription implements service_describer.ServiceDescription
{ | 1555 class _SurfaceServiceDescription implements service_describer.ServiceDescription
{ |
1491 dynamic getTopLevelInterface([Function responseFactory]) => | 1556 void getTopLevelInterface(Function responder) { |
1492 responseFactory(null); | 1557 responder(null); |
| 1558 } |
1493 | 1559 |
1494 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1560 void getTypeDefinition(String typeKey, Function responder) { |
1495 responseFactory(null); | 1561 responder(null); |
| 1562 } |
1496 | 1563 |
1497 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1564 void getAllTypeDefinitions(Function responder) { |
1498 responseFactory(null); | 1565 responder(null); |
| 1566 } |
1499 } | 1567 } |
1500 | 1568 |
1501 abstract class Surface { | 1569 abstract class Surface { |
1502 static const String serviceName = "mojo::Surface"; | 1570 static const String serviceName = "mojo::Surface"; |
1503 | 1571 |
1504 static service_describer.ServiceDescription _cachedServiceDescription; | 1572 static service_describer.ServiceDescription _cachedServiceDescription; |
1505 static service_describer.ServiceDescription get serviceDescription { | 1573 static service_describer.ServiceDescription get serviceDescription { |
1506 if (_cachedServiceDescription == null) { | 1574 if (_cachedServiceDescription == null) { |
1507 _cachedServiceDescription = new _SurfaceServiceDescription(); | 1575 _cachedServiceDescription = new _SurfaceServiceDescription(); |
1508 } | 1576 } |
1509 return _cachedServiceDescription; | 1577 return _cachedServiceDescription; |
1510 } | 1578 } |
1511 | 1579 |
1512 static SurfaceProxy connectToService( | 1580 static SurfaceProxy connectToService( |
1513 bindings.ServiceConnector s, String url, [String serviceName]) { | 1581 bindings.ServiceConnector s, String url, [String serviceName]) { |
1514 SurfaceProxy p = new SurfaceProxy.unbound(); | 1582 SurfaceProxy p = new SurfaceProxy.unbound(); |
1515 String name = serviceName ?? Surface.serviceName; | 1583 String name = serviceName ?? Surface.serviceName; |
1516 if ((name == null) || name.isEmpty) { | 1584 if ((name == null) || name.isEmpty) { |
1517 throw new core.MojoApiError( | 1585 throw new core.MojoApiError( |
1518 "If an interface has no ServiceName, then one must be provided."); | 1586 "If an interface has no ServiceName, then one must be provided."); |
1519 } | 1587 } |
1520 s.connectToService(url, p, name); | 1588 s.connectToService(url, p, name); |
1521 return p; | 1589 return p; |
1522 } | 1590 } |
1523 dynamic getIdNamespace([Function responseFactory = null]); | 1591 void getIdNamespace(void callback(int idNamespace)); |
1524 void setResourceReturner(ResourceReturnerInterface returner); | 1592 void setResourceReturner(ResourceReturnerInterface returner); |
1525 void createSurface(int idLocal); | 1593 void createSurface(int idLocal); |
1526 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
; | 1594 void submitFrame(int idLocal,Frame frame,void callback()); |
1527 void destroySurface(int idLocal); | 1595 void destroySurface(int idLocal); |
1528 } | 1596 } |
1529 | 1597 |
1530 abstract class SurfaceInterface | 1598 abstract class SurfaceInterface |
1531 implements bindings.MojoInterface<Surface>, | 1599 implements bindings.MojoInterface<Surface>, |
1532 Surface { | 1600 Surface { |
1533 factory SurfaceInterface([Surface impl]) => | 1601 factory SurfaceInterface([Surface impl]) => |
1534 new SurfaceStub.unbound(impl); | 1602 new SurfaceStub.unbound(impl); |
1535 | 1603 |
1536 factory SurfaceInterface.fromEndpoint( | 1604 factory SurfaceInterface.fromEndpoint( |
(...skipping 30 matching lines...) Expand all Loading... |
1567 | 1635 |
1568 void handleResponse(bindings.ServiceMessage message) { | 1636 void handleResponse(bindings.ServiceMessage message) { |
1569 switch (message.header.type) { | 1637 switch (message.header.type) { |
1570 case _surfaceMethodGetIdNamespaceName: | 1638 case _surfaceMethodGetIdNamespaceName: |
1571 var r = SurfaceGetIdNamespaceResponseParams.deserialize( | 1639 var r = SurfaceGetIdNamespaceResponseParams.deserialize( |
1572 message.payload); | 1640 message.payload); |
1573 if (!message.header.hasRequestId) { | 1641 if (!message.header.hasRequestId) { |
1574 proxyError("Expected a message with a valid request Id."); | 1642 proxyError("Expected a message with a valid request Id."); |
1575 return; | 1643 return; |
1576 } | 1644 } |
1577 Completer c = completerMap[message.header.requestId]; | 1645 Function callback = callbackMap[message.header.requestId]; |
1578 if (c == null) { | 1646 if (callback == null) { |
1579 proxyError( | 1647 proxyError( |
1580 "Message had unknown request Id: ${message.header.requestId}"); | 1648 "Message had unknown request Id: ${message.header.requestId}"); |
1581 return; | 1649 return; |
1582 } | 1650 } |
1583 completerMap.remove(message.header.requestId); | 1651 callbackMap.remove(message.header.requestId); |
1584 if (c.isCompleted) { | 1652 callback(r.idNamespace ); |
1585 proxyError("Response completer already completed"); | |
1586 return; | |
1587 } | |
1588 c.complete(r); | |
1589 break; | 1653 break; |
1590 case _surfaceMethodSubmitFrameName: | 1654 case _surfaceMethodSubmitFrameName: |
1591 var r = SurfaceSubmitFrameResponseParams.deserialize( | 1655 var r = SurfaceSubmitFrameResponseParams.deserialize( |
1592 message.payload); | 1656 message.payload); |
1593 if (!message.header.hasRequestId) { | 1657 if (!message.header.hasRequestId) { |
1594 proxyError("Expected a message with a valid request Id."); | 1658 proxyError("Expected a message with a valid request Id."); |
1595 return; | 1659 return; |
1596 } | 1660 } |
1597 Completer c = completerMap[message.header.requestId]; | 1661 Function callback = callbackMap[message.header.requestId]; |
1598 if (c == null) { | 1662 if (callback == null) { |
1599 proxyError( | 1663 proxyError( |
1600 "Message had unknown request Id: ${message.header.requestId}"); | 1664 "Message had unknown request Id: ${message.header.requestId}"); |
1601 return; | 1665 return; |
1602 } | 1666 } |
1603 completerMap.remove(message.header.requestId); | 1667 callbackMap.remove(message.header.requestId); |
1604 if (c.isCompleted) { | 1668 callback(); |
1605 proxyError("Response completer already completed"); | |
1606 return; | |
1607 } | |
1608 c.complete(r); | |
1609 break; | 1669 break; |
1610 default: | 1670 default: |
1611 proxyError("Unexpected message type: ${message.header.type}"); | 1671 proxyError("Unexpected message type: ${message.header.type}"); |
1612 close(immediate: true); | 1672 close(immediate: true); |
1613 break; | 1673 break; |
1614 } | 1674 } |
1615 } | 1675 } |
1616 | 1676 |
1617 @override | 1677 @override |
1618 String toString() { | 1678 String toString() { |
(...skipping 24 matching lines...) Expand all Loading... |
1643 return newMockedProxy; | 1703 return newMockedProxy; |
1644 } | 1704 } |
1645 | 1705 |
1646 static SurfaceProxy newFromEndpoint( | 1706 static SurfaceProxy newFromEndpoint( |
1647 core.MojoMessagePipeEndpoint endpoint) { | 1707 core.MojoMessagePipeEndpoint endpoint) { |
1648 assert(endpoint.setDescription("For SurfaceProxy")); | 1708 assert(endpoint.setDescription("For SurfaceProxy")); |
1649 return new SurfaceProxy.fromEndpoint(endpoint); | 1709 return new SurfaceProxy.fromEndpoint(endpoint); |
1650 } | 1710 } |
1651 | 1711 |
1652 | 1712 |
1653 dynamic getIdNamespace([Function responseFactory = null]) { | 1713 void getIdNamespace(void callback(int idNamespace)) { |
1654 if (impl != null) { | 1714 if (impl != null) { |
1655 return new Future(() => impl.getIdNamespace(_SurfaceStubControl._surfaceGe
tIdNamespaceResponseParamsFactory)); | 1715 impl.getIdNamespace(callback); |
| 1716 return; |
1656 } | 1717 } |
1657 var params = new _SurfaceGetIdNamespaceParams(); | 1718 var params = new _SurfaceGetIdNamespaceParams(); |
1658 return ctrl.sendMessageWithRequestId( | 1719 ctrl.sendMessageWithRequestId( |
1659 params, | 1720 params, |
1660 _surfaceMethodGetIdNamespaceName, | 1721 _surfaceMethodGetIdNamespaceName, |
1661 -1, | 1722 -1, |
1662 bindings.MessageHeader.kMessageExpectsResponse); | 1723 bindings.MessageHeader.kMessageExpectsResponse, |
| 1724 callback); |
1663 } | 1725 } |
1664 void setResourceReturner(ResourceReturnerInterface returner) { | 1726 void setResourceReturner(ResourceReturnerInterface returner) { |
1665 if (impl != null) { | 1727 if (impl != null) { |
1666 impl.setResourceReturner(returner); | 1728 impl.setResourceReturner(returner); |
1667 return; | 1729 return; |
1668 } | 1730 } |
1669 if (!ctrl.isBound) { | 1731 if (!ctrl.isBound) { |
1670 ctrl.proxyError("The Proxy is closed."); | 1732 ctrl.proxyError("The Proxy is closed."); |
1671 return; | 1733 return; |
1672 } | 1734 } |
1673 var params = new _SurfaceSetResourceReturnerParams(); | 1735 var params = new _SurfaceSetResourceReturnerParams(); |
1674 params.returner = returner; | 1736 params.returner = returner; |
1675 ctrl.sendMessage(params, | 1737 ctrl.sendMessage(params, |
1676 _surfaceMethodSetResourceReturnerName); | 1738 _surfaceMethodSetResourceReturnerName); |
1677 } | 1739 } |
1678 void createSurface(int idLocal) { | 1740 void createSurface(int idLocal) { |
1679 if (impl != null) { | 1741 if (impl != null) { |
1680 impl.createSurface(idLocal); | 1742 impl.createSurface(idLocal); |
1681 return; | 1743 return; |
1682 } | 1744 } |
1683 if (!ctrl.isBound) { | 1745 if (!ctrl.isBound) { |
1684 ctrl.proxyError("The Proxy is closed."); | 1746 ctrl.proxyError("The Proxy is closed."); |
1685 return; | 1747 return; |
1686 } | 1748 } |
1687 var params = new _SurfaceCreateSurfaceParams(); | 1749 var params = new _SurfaceCreateSurfaceParams(); |
1688 params.idLocal = idLocal; | 1750 params.idLocal = idLocal; |
1689 ctrl.sendMessage(params, | 1751 ctrl.sendMessage(params, |
1690 _surfaceMethodCreateSurfaceName); | 1752 _surfaceMethodCreateSurfaceName); |
1691 } | 1753 } |
1692 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
{ | 1754 void submitFrame(int idLocal,Frame frame,void callback()) { |
1693 if (impl != null) { | 1755 if (impl != null) { |
1694 return new Future(() => impl.submitFrame(idLocal,frame,_SurfaceStubControl
._surfaceSubmitFrameResponseParamsFactory)); | 1756 impl.submitFrame(idLocal,frame,callback); |
| 1757 return; |
1695 } | 1758 } |
1696 var params = new _SurfaceSubmitFrameParams(); | 1759 var params = new _SurfaceSubmitFrameParams(); |
1697 params.idLocal = idLocal; | 1760 params.idLocal = idLocal; |
1698 params.frame = frame; | 1761 params.frame = frame; |
1699 return ctrl.sendMessageWithRequestId( | 1762 ctrl.sendMessageWithRequestId( |
1700 params, | 1763 params, |
1701 _surfaceMethodSubmitFrameName, | 1764 _surfaceMethodSubmitFrameName, |
1702 -1, | 1765 -1, |
1703 bindings.MessageHeader.kMessageExpectsResponse); | 1766 bindings.MessageHeader.kMessageExpectsResponse, |
| 1767 callback); |
1704 } | 1768 } |
1705 void destroySurface(int idLocal) { | 1769 void destroySurface(int idLocal) { |
1706 if (impl != null) { | 1770 if (impl != null) { |
1707 impl.destroySurface(idLocal); | 1771 impl.destroySurface(idLocal); |
1708 return; | 1772 return; |
1709 } | 1773 } |
1710 if (!ctrl.isBound) { | 1774 if (!ctrl.isBound) { |
1711 ctrl.proxyError("The Proxy is closed."); | 1775 ctrl.proxyError("The Proxy is closed."); |
1712 return; | 1776 return; |
1713 } | 1777 } |
(...skipping 19 matching lines...) Expand all Loading... |
1733 core.MojoHandle handle, [Surface impl]) | 1797 core.MojoHandle handle, [Surface impl]) |
1734 : super.fromHandle(handle, autoBegin: impl != null) { | 1798 : super.fromHandle(handle, autoBegin: impl != null) { |
1735 _impl = impl; | 1799 _impl = impl; |
1736 } | 1800 } |
1737 | 1801 |
1738 _SurfaceStubControl.unbound([this._impl]) : super.unbound(); | 1802 _SurfaceStubControl.unbound([this._impl]) : super.unbound(); |
1739 | 1803 |
1740 String get serviceName => Surface.serviceName; | 1804 String get serviceName => Surface.serviceName; |
1741 | 1805 |
1742 | 1806 |
1743 static SurfaceGetIdNamespaceResponseParams _surfaceGetIdNamespaceResponseParam
sFactory(int idNamespace) { | 1807 Function _surfaceGetIdNamespaceResponseParamsResponder( |
1744 var result = new SurfaceGetIdNamespaceResponseParams(); | 1808 int requestId) { |
1745 result.idNamespace = idNamespace; | 1809 return (int idNamespace) { |
1746 return result; | 1810 var result = new SurfaceGetIdNamespaceResponseParams(); |
| 1811 result.idNamespace = idNamespace; |
| 1812 sendResponse(buildResponseWithId( |
| 1813 result, |
| 1814 _surfaceMethodGetIdNamespaceName, |
| 1815 requestId, |
| 1816 bindings.MessageHeader.kMessageIsResponse)); |
| 1817 }; |
1747 } | 1818 } |
1748 static SurfaceSubmitFrameResponseParams _surfaceSubmitFrameResponseParamsFacto
ry() { | 1819 Function _surfaceSubmitFrameResponseParamsResponder( |
1749 var result = new SurfaceSubmitFrameResponseParams(); | 1820 int requestId) { |
1750 return result; | 1821 return () { |
| 1822 var result = new SurfaceSubmitFrameResponseParams(); |
| 1823 sendResponse(buildResponseWithId( |
| 1824 result, |
| 1825 _surfaceMethodSubmitFrameName, |
| 1826 requestId, |
| 1827 bindings.MessageHeader.kMessageIsResponse)); |
| 1828 }; |
1751 } | 1829 } |
1752 | 1830 |
1753 dynamic handleMessage(bindings.ServiceMessage message) { | 1831 void handleMessage(bindings.ServiceMessage message) { |
1754 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1832 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1755 return bindings.ControlMessageHandler.handleMessage(this, | 1833 bindings.ControlMessageHandler.handleMessage( |
1756 0, | 1834 this, 0, message); |
1757 message); | 1835 return; |
1758 } | 1836 } |
1759 if (_impl == null) { | 1837 if (_impl == null) { |
1760 throw new core.MojoApiError("$this has no implementation set"); | 1838 throw new core.MojoApiError("$this has no implementation set"); |
1761 } | 1839 } |
1762 switch (message.header.type) { | 1840 switch (message.header.type) { |
1763 case _surfaceMethodGetIdNamespaceName: | 1841 case _surfaceMethodGetIdNamespaceName: |
1764 var response = _impl.getIdNamespace(_surfaceGetIdNamespaceResponseParams
Factory); | 1842 _impl.getIdNamespace(_surfaceGetIdNamespaceResponseParamsResponder(messa
ge.header.requestId)); |
1765 if (response is Future) { | |
1766 return response.then((response) { | |
1767 if (response != null) { | |
1768 return buildResponseWithId( | |
1769 response, | |
1770 _surfaceMethodGetIdNamespaceName, | |
1771 message.header.requestId, | |
1772 bindings.MessageHeader.kMessageIsResponse); | |
1773 } | |
1774 }); | |
1775 } else if (response != null) { | |
1776 return buildResponseWithId( | |
1777 response, | |
1778 _surfaceMethodGetIdNamespaceName, | |
1779 message.header.requestId, | |
1780 bindings.MessageHeader.kMessageIsResponse); | |
1781 } | |
1782 break; | 1843 break; |
1783 case _surfaceMethodSetResourceReturnerName: | 1844 case _surfaceMethodSetResourceReturnerName: |
1784 var params = _SurfaceSetResourceReturnerParams.deserialize( | 1845 var params = _SurfaceSetResourceReturnerParams.deserialize( |
1785 message.payload); | 1846 message.payload); |
1786 _impl.setResourceReturner(params.returner); | 1847 _impl.setResourceReturner(params.returner); |
1787 break; | 1848 break; |
1788 case _surfaceMethodCreateSurfaceName: | 1849 case _surfaceMethodCreateSurfaceName: |
1789 var params = _SurfaceCreateSurfaceParams.deserialize( | 1850 var params = _SurfaceCreateSurfaceParams.deserialize( |
1790 message.payload); | 1851 message.payload); |
1791 _impl.createSurface(params.idLocal); | 1852 _impl.createSurface(params.idLocal); |
1792 break; | 1853 break; |
1793 case _surfaceMethodSubmitFrameName: | 1854 case _surfaceMethodSubmitFrameName: |
1794 var params = _SurfaceSubmitFrameParams.deserialize( | 1855 var params = _SurfaceSubmitFrameParams.deserialize( |
1795 message.payload); | 1856 message.payload); |
1796 var response = _impl.submitFrame(params.idLocal,params.frame,_surfaceSub
mitFrameResponseParamsFactory); | 1857 _impl.submitFrame(params.idLocal, params.frame, _surfaceSubmitFrameRespo
nseParamsResponder(message.header.requestId)); |
1797 if (response is Future) { | |
1798 return response.then((response) { | |
1799 if (response != null) { | |
1800 return buildResponseWithId( | |
1801 response, | |
1802 _surfaceMethodSubmitFrameName, | |
1803 message.header.requestId, | |
1804 bindings.MessageHeader.kMessageIsResponse); | |
1805 } | |
1806 }); | |
1807 } else if (response != null) { | |
1808 return buildResponseWithId( | |
1809 response, | |
1810 _surfaceMethodSubmitFrameName, | |
1811 message.header.requestId, | |
1812 bindings.MessageHeader.kMessageIsResponse); | |
1813 } | |
1814 break; | 1858 break; |
1815 case _surfaceMethodDestroySurfaceName: | 1859 case _surfaceMethodDestroySurfaceName: |
1816 var params = _SurfaceDestroySurfaceParams.deserialize( | 1860 var params = _SurfaceDestroySurfaceParams.deserialize( |
1817 message.payload); | 1861 message.payload); |
1818 _impl.destroySurface(params.idLocal); | 1862 _impl.destroySurface(params.idLocal); |
1819 break; | 1863 break; |
1820 default: | 1864 default: |
1821 throw new bindings.MojoCodecError("Unexpected message name"); | 1865 throw new bindings.MojoCodecError("Unexpected message name"); |
1822 break; | 1866 break; |
1823 } | 1867 } |
1824 return null; | |
1825 } | 1868 } |
1826 | 1869 |
1827 Surface get impl => _impl; | 1870 Surface get impl => _impl; |
1828 set impl(Surface d) { | 1871 set impl(Surface d) { |
1829 if (d == null) { | 1872 if (d == null) { |
1830 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1873 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
1831 } | 1874 } |
1832 if (isBound && (_impl == null)) { | 1875 if (isBound && (_impl == null)) { |
1833 beginHandlingEvents(); | 1876 beginHandlingEvents(); |
1834 } | 1877 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 core.MojoHandle handle, [Surface impl]) | 1911 core.MojoHandle handle, [Surface impl]) |
1869 : super(new _SurfaceStubControl.fromHandle(handle, impl)); | 1912 : super(new _SurfaceStubControl.fromHandle(handle, impl)); |
1870 | 1913 |
1871 static SurfaceStub newFromEndpoint( | 1914 static SurfaceStub newFromEndpoint( |
1872 core.MojoMessagePipeEndpoint endpoint) { | 1915 core.MojoMessagePipeEndpoint endpoint) { |
1873 assert(endpoint.setDescription("For SurfaceStub")); | 1916 assert(endpoint.setDescription("For SurfaceStub")); |
1874 return new SurfaceStub.fromEndpoint(endpoint); | 1917 return new SurfaceStub.fromEndpoint(endpoint); |
1875 } | 1918 } |
1876 | 1919 |
1877 | 1920 |
1878 dynamic getIdNamespace([Function responseFactory = null]) { | 1921 void getIdNamespace(void callback(int idNamespace)) { |
1879 return impl.getIdNamespace(responseFactory); | 1922 return impl.getIdNamespace(callback); |
1880 } | 1923 } |
1881 void setResourceReturner(ResourceReturnerInterface returner) { | 1924 void setResourceReturner(ResourceReturnerInterface returner) { |
1882 return impl.setResourceReturner(returner); | 1925 return impl.setResourceReturner(returner); |
1883 } | 1926 } |
1884 void createSurface(int idLocal) { | 1927 void createSurface(int idLocal) { |
1885 return impl.createSurface(idLocal); | 1928 return impl.createSurface(idLocal); |
1886 } | 1929 } |
1887 dynamic submitFrame(int idLocal,Frame frame,[Function responseFactory = null])
{ | 1930 void submitFrame(int idLocal,Frame frame,void callback()) { |
1888 return impl.submitFrame(idLocal,frame,responseFactory); | 1931 return impl.submitFrame(idLocal,frame,callback); |
1889 } | 1932 } |
1890 void destroySurface(int idLocal) { | 1933 void destroySurface(int idLocal) { |
1891 return impl.destroySurface(idLocal); | 1934 return impl.destroySurface(idLocal); |
1892 } | 1935 } |
1893 } | 1936 } |
1894 | 1937 |
1895 | 1938 |
1896 | 1939 |
OLD | NEW |