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 timeline_controller_mojom; | 4 library timeline_controller_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/timelines.mojom.dart' as timelines_mojom; | 9 import 'package:mojo_services/mojo/timelines.mojom.dart' as timelines_mojom; |
10 | 10 |
11 | 11 |
12 | 12 |
13 class MediaTimelineControlSiteStatus extends bindings.Struct { | 13 class MediaTimelineControlSiteStatus extends bindings.Struct { |
14 static const List<bindings.StructDataHeader> kVersions = const [ | 14 static const List<bindings.StructDataHeader> kVersions = const [ |
15 const bindings.StructDataHeader(24, 0) | 15 const bindings.StructDataHeader(24, 0) |
16 ]; | 16 ]; |
17 timelines_mojom.TimelineTransform timelineTransform = null; | 17 timelines_mojom.TimelineTransform timelineTransform = null; |
18 bool endOfStream = false; | 18 bool endOfStream = false; |
19 | 19 |
20 MediaTimelineControlSiteStatus() : super(kVersions.last.size); | 20 MediaTimelineControlSiteStatus() : super(kVersions.last.size); |
21 | 21 |
| 22 MediaTimelineControlSiteStatus.init( |
| 23 timelines_mojom.TimelineTransform this.timelineTransform, |
| 24 bool this.endOfStream |
| 25 ) : super(kVersions.last.size); |
| 26 |
22 static MediaTimelineControlSiteStatus deserialize(bindings.Message message) { | 27 static MediaTimelineControlSiteStatus deserialize(bindings.Message message) { |
23 var decoder = new bindings.Decoder(message); | 28 var decoder = new bindings.Decoder(message); |
24 var result = decode(decoder); | 29 var result = decode(decoder); |
25 if (decoder.excessHandles != null) { | 30 if (decoder.excessHandles != null) { |
26 decoder.excessHandles.forEach((h) => h.close()); | 31 decoder.excessHandles.forEach((h) => h.close()); |
27 } | 32 } |
28 return result; | 33 return result; |
29 } | 34 } |
30 | 35 |
31 static MediaTimelineControlSiteStatus decode(bindings.Decoder decoder0) { | 36 static MediaTimelineControlSiteStatus decode(bindings.Decoder decoder0) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 103 |
99 | 104 |
100 class _MediaTimelineControllerAddControlSiteParams extends bindings.Struct { | 105 class _MediaTimelineControllerAddControlSiteParams extends bindings.Struct { |
101 static const List<bindings.StructDataHeader> kVersions = const [ | 106 static const List<bindings.StructDataHeader> kVersions = const [ |
102 const bindings.StructDataHeader(16, 0) | 107 const bindings.StructDataHeader(16, 0) |
103 ]; | 108 ]; |
104 MediaTimelineControlSiteInterface controlSite = null; | 109 MediaTimelineControlSiteInterface controlSite = null; |
105 | 110 |
106 _MediaTimelineControllerAddControlSiteParams() : super(kVersions.last.size); | 111 _MediaTimelineControllerAddControlSiteParams() : super(kVersions.last.size); |
107 | 112 |
| 113 _MediaTimelineControllerAddControlSiteParams.init( |
| 114 MediaTimelineControlSiteInterface this.controlSite |
| 115 ) : super(kVersions.last.size); |
| 116 |
108 static _MediaTimelineControllerAddControlSiteParams deserialize(bindings.Messa
ge message) { | 117 static _MediaTimelineControllerAddControlSiteParams deserialize(bindings.Messa
ge message) { |
109 var decoder = new bindings.Decoder(message); | 118 var decoder = new bindings.Decoder(message); |
110 var result = decode(decoder); | 119 var result = decode(decoder); |
111 if (decoder.excessHandles != null) { | 120 if (decoder.excessHandles != null) { |
112 decoder.excessHandles.forEach((h) => h.close()); | 121 decoder.excessHandles.forEach((h) => h.close()); |
113 } | 122 } |
114 return result; | 123 return result; |
115 } | 124 } |
116 | 125 |
117 static _MediaTimelineControllerAddControlSiteParams decode(bindings.Decoder de
coder0) { | 126 static _MediaTimelineControllerAddControlSiteParams decode(bindings.Decoder de
coder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 178 |
170 | 179 |
171 class _MediaTimelineControllerGetControlSiteParams extends bindings.Struct { | 180 class _MediaTimelineControllerGetControlSiteParams extends bindings.Struct { |
172 static const List<bindings.StructDataHeader> kVersions = const [ | 181 static const List<bindings.StructDataHeader> kVersions = const [ |
173 const bindings.StructDataHeader(16, 0) | 182 const bindings.StructDataHeader(16, 0) |
174 ]; | 183 ]; |
175 MediaTimelineControlSiteInterfaceRequest controlSite = null; | 184 MediaTimelineControlSiteInterfaceRequest controlSite = null; |
176 | 185 |
177 _MediaTimelineControllerGetControlSiteParams() : super(kVersions.last.size); | 186 _MediaTimelineControllerGetControlSiteParams() : super(kVersions.last.size); |
178 | 187 |
| 188 _MediaTimelineControllerGetControlSiteParams.init( |
| 189 MediaTimelineControlSiteInterfaceRequest this.controlSite |
| 190 ) : super(kVersions.last.size); |
| 191 |
179 static _MediaTimelineControllerGetControlSiteParams deserialize(bindings.Messa
ge message) { | 192 static _MediaTimelineControllerGetControlSiteParams deserialize(bindings.Messa
ge message) { |
180 var decoder = new bindings.Decoder(message); | 193 var decoder = new bindings.Decoder(message); |
181 var result = decode(decoder); | 194 var result = decode(decoder); |
182 if (decoder.excessHandles != null) { | 195 if (decoder.excessHandles != null) { |
183 decoder.excessHandles.forEach((h) => h.close()); | 196 decoder.excessHandles.forEach((h) => h.close()); |
184 } | 197 } |
185 return result; | 198 return result; |
186 } | 199 } |
187 | 200 |
188 static _MediaTimelineControllerGetControlSiteParams decode(bindings.Decoder de
coder0) { | 201 static _MediaTimelineControllerGetControlSiteParams decode(bindings.Decoder de
coder0) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 253 |
241 | 254 |
242 class _MediaTimelineControlSiteGetStatusParams extends bindings.Struct { | 255 class _MediaTimelineControlSiteGetStatusParams extends bindings.Struct { |
243 static const List<bindings.StructDataHeader> kVersions = const [ | 256 static const List<bindings.StructDataHeader> kVersions = const [ |
244 const bindings.StructDataHeader(16, 0) | 257 const bindings.StructDataHeader(16, 0) |
245 ]; | 258 ]; |
246 int versionLastSeen = 0; | 259 int versionLastSeen = 0; |
247 | 260 |
248 _MediaTimelineControlSiteGetStatusParams() : super(kVersions.last.size); | 261 _MediaTimelineControlSiteGetStatusParams() : super(kVersions.last.size); |
249 | 262 |
| 263 _MediaTimelineControlSiteGetStatusParams.init( |
| 264 int this.versionLastSeen |
| 265 ) : super(kVersions.last.size); |
| 266 |
250 static _MediaTimelineControlSiteGetStatusParams deserialize(bindings.Message m
essage) { | 267 static _MediaTimelineControlSiteGetStatusParams deserialize(bindings.Message m
essage) { |
251 var decoder = new bindings.Decoder(message); | 268 var decoder = new bindings.Decoder(message); |
252 var result = decode(decoder); | 269 var result = decode(decoder); |
253 if (decoder.excessHandles != null) { | 270 if (decoder.excessHandles != null) { |
254 decoder.excessHandles.forEach((h) => h.close()); | 271 decoder.excessHandles.forEach((h) => h.close()); |
255 } | 272 } |
256 return result; | 273 return result; |
257 } | 274 } |
258 | 275 |
259 static _MediaTimelineControlSiteGetStatusParams decode(bindings.Decoder decode
r0) { | 276 static _MediaTimelineControlSiteGetStatusParams decode(bindings.Decoder decode
r0) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 330 |
314 class MediaTimelineControlSiteGetStatusResponseParams extends bindings.Struct { | 331 class MediaTimelineControlSiteGetStatusResponseParams extends bindings.Struct { |
315 static const List<bindings.StructDataHeader> kVersions = const [ | 332 static const List<bindings.StructDataHeader> kVersions = const [ |
316 const bindings.StructDataHeader(24, 0) | 333 const bindings.StructDataHeader(24, 0) |
317 ]; | 334 ]; |
318 int version = 0; | 335 int version = 0; |
319 MediaTimelineControlSiteStatus status = null; | 336 MediaTimelineControlSiteStatus status = null; |
320 | 337 |
321 MediaTimelineControlSiteGetStatusResponseParams() : super(kVersions.last.size)
; | 338 MediaTimelineControlSiteGetStatusResponseParams() : super(kVersions.last.size)
; |
322 | 339 |
| 340 MediaTimelineControlSiteGetStatusResponseParams.init( |
| 341 int this.version, |
| 342 MediaTimelineControlSiteStatus this.status |
| 343 ) : super(kVersions.last.size); |
| 344 |
323 static MediaTimelineControlSiteGetStatusResponseParams deserialize(bindings.Me
ssage message) { | 345 static MediaTimelineControlSiteGetStatusResponseParams deserialize(bindings.Me
ssage message) { |
324 var decoder = new bindings.Decoder(message); | 346 var decoder = new bindings.Decoder(message); |
325 var result = decode(decoder); | 347 var result = decode(decoder); |
326 if (decoder.excessHandles != null) { | 348 if (decoder.excessHandles != null) { |
327 decoder.excessHandles.forEach((h) => h.close()); | 349 decoder.excessHandles.forEach((h) => h.close()); |
328 } | 350 } |
329 return result; | 351 return result; |
330 } | 352 } |
331 | 353 |
332 static MediaTimelineControlSiteGetStatusResponseParams decode(bindings.Decoder
decoder0) { | 354 static MediaTimelineControlSiteGetStatusResponseParams decode(bindings.Decoder
decoder0) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 421 |
400 | 422 |
401 class _MediaTimelineControlSiteGetTimelineConsumerParams extends bindings.Struct
{ | 423 class _MediaTimelineControlSiteGetTimelineConsumerParams extends bindings.Struct
{ |
402 static const List<bindings.StructDataHeader> kVersions = const [ | 424 static const List<bindings.StructDataHeader> kVersions = const [ |
403 const bindings.StructDataHeader(16, 0) | 425 const bindings.StructDataHeader(16, 0) |
404 ]; | 426 ]; |
405 timelines_mojom.TimelineConsumerInterfaceRequest timelineConsumer = null; | 427 timelines_mojom.TimelineConsumerInterfaceRequest timelineConsumer = null; |
406 | 428 |
407 _MediaTimelineControlSiteGetTimelineConsumerParams() : super(kVersions.last.si
ze); | 429 _MediaTimelineControlSiteGetTimelineConsumerParams() : super(kVersions.last.si
ze); |
408 | 430 |
| 431 _MediaTimelineControlSiteGetTimelineConsumerParams.init( |
| 432 timelines_mojom.TimelineConsumerInterfaceRequest this.timelineConsumer |
| 433 ) : super(kVersions.last.size); |
| 434 |
409 static _MediaTimelineControlSiteGetTimelineConsumerParams deserialize(bindings
.Message message) { | 435 static _MediaTimelineControlSiteGetTimelineConsumerParams deserialize(bindings
.Message message) { |
410 var decoder = new bindings.Decoder(message); | 436 var decoder = new bindings.Decoder(message); |
411 var result = decode(decoder); | 437 var result = decode(decoder); |
412 if (decoder.excessHandles != null) { | 438 if (decoder.excessHandles != null) { |
413 decoder.excessHandles.forEach((h) => h.close()); | 439 decoder.excessHandles.forEach((h) => h.close()); |
414 } | 440 } |
415 return result; | 441 return result; |
416 } | 442 } |
417 | 443 |
418 static _MediaTimelineControlSiteGetTimelineConsumerParams decode(bindings.Deco
der decoder0) { | 444 static _MediaTimelineControlSiteGetTimelineConsumerParams decode(bindings.Deco
der decoder0) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 Map toJson() { | 491 Map toJson() { |
466 throw new bindings.MojoCodecError( | 492 throw new bindings.MojoCodecError( |
467 'Object containing handles cannot be encoded to JSON.'); | 493 'Object containing handles cannot be encoded to JSON.'); |
468 } | 494 } |
469 } | 495 } |
470 | 496 |
471 const int _mediaTimelineControllerMethodAddControlSiteName = 0; | 497 const int _mediaTimelineControllerMethodAddControlSiteName = 0; |
472 const int _mediaTimelineControllerMethodGetControlSiteName = 1; | 498 const int _mediaTimelineControllerMethodGetControlSiteName = 1; |
473 | 499 |
474 class _MediaTimelineControllerServiceDescription implements service_describer.Se
rviceDescription { | 500 class _MediaTimelineControllerServiceDescription implements service_describer.Se
rviceDescription { |
475 dynamic getTopLevelInterface([Function responseFactory]) => | 501 void getTopLevelInterface(Function responder) { |
476 responseFactory(null); | 502 responder(null); |
| 503 } |
477 | 504 |
478 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 505 void getTypeDefinition(String typeKey, Function responder) { |
479 responseFactory(null); | 506 responder(null); |
| 507 } |
480 | 508 |
481 dynamic getAllTypeDefinitions([Function responseFactory]) => | 509 void getAllTypeDefinitions(Function responder) { |
482 responseFactory(null); | 510 responder(null); |
| 511 } |
483 } | 512 } |
484 | 513 |
485 abstract class MediaTimelineController { | 514 abstract class MediaTimelineController { |
486 static const String serviceName = null; | 515 static const String serviceName = null; |
487 | 516 |
488 static service_describer.ServiceDescription _cachedServiceDescription; | 517 static service_describer.ServiceDescription _cachedServiceDescription; |
489 static service_describer.ServiceDescription get serviceDescription { | 518 static service_describer.ServiceDescription get serviceDescription { |
490 if (_cachedServiceDescription == null) { | 519 if (_cachedServiceDescription == null) { |
491 _cachedServiceDescription = new _MediaTimelineControllerServiceDescription
(); | 520 _cachedServiceDescription = new _MediaTimelineControllerServiceDescription
(); |
492 } | 521 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 : super.fromHandle(handle, autoBegin: impl != null) { | 666 : super.fromHandle(handle, autoBegin: impl != null) { |
638 _impl = impl; | 667 _impl = impl; |
639 } | 668 } |
640 | 669 |
641 _MediaTimelineControllerStubControl.unbound([this._impl]) : super.unbound(); | 670 _MediaTimelineControllerStubControl.unbound([this._impl]) : super.unbound(); |
642 | 671 |
643 String get serviceName => MediaTimelineController.serviceName; | 672 String get serviceName => MediaTimelineController.serviceName; |
644 | 673 |
645 | 674 |
646 | 675 |
647 dynamic handleMessage(bindings.ServiceMessage message) { | 676 void handleMessage(bindings.ServiceMessage message) { |
648 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 677 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
649 return bindings.ControlMessageHandler.handleMessage(this, | 678 bindings.ControlMessageHandler.handleMessage( |
650 0, | 679 this, 0, message); |
651 message); | 680 return; |
652 } | 681 } |
653 if (_impl == null) { | 682 if (_impl == null) { |
654 throw new core.MojoApiError("$this has no implementation set"); | 683 throw new core.MojoApiError("$this has no implementation set"); |
655 } | 684 } |
656 switch (message.header.type) { | 685 switch (message.header.type) { |
657 case _mediaTimelineControllerMethodAddControlSiteName: | 686 case _mediaTimelineControllerMethodAddControlSiteName: |
658 var params = _MediaTimelineControllerAddControlSiteParams.deserialize( | 687 var params = _MediaTimelineControllerAddControlSiteParams.deserialize( |
659 message.payload); | 688 message.payload); |
660 _impl.addControlSite(params.controlSite); | 689 _impl.addControlSite(params.controlSite); |
661 break; | 690 break; |
662 case _mediaTimelineControllerMethodGetControlSiteName: | 691 case _mediaTimelineControllerMethodGetControlSiteName: |
663 var params = _MediaTimelineControllerGetControlSiteParams.deserialize( | 692 var params = _MediaTimelineControllerGetControlSiteParams.deserialize( |
664 message.payload); | 693 message.payload); |
665 _impl.getControlSite(params.controlSite); | 694 _impl.getControlSite(params.controlSite); |
666 break; | 695 break; |
667 default: | 696 default: |
668 throw new bindings.MojoCodecError("Unexpected message name"); | 697 throw new bindings.MojoCodecError("Unexpected message name"); |
669 break; | 698 break; |
670 } | 699 } |
671 return null; | |
672 } | 700 } |
673 | 701 |
674 MediaTimelineController get impl => _impl; | 702 MediaTimelineController get impl => _impl; |
675 set impl(MediaTimelineController d) { | 703 set impl(MediaTimelineController d) { |
676 if (d == null) { | 704 if (d == null) { |
677 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 705 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
678 } | 706 } |
679 if (isBound && (_impl == null)) { | 707 if (isBound && (_impl == null)) { |
680 beginHandlingEvents(); | 708 beginHandlingEvents(); |
681 } | 709 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 } | 755 } |
728 void getControlSite(MediaTimelineControlSiteInterfaceRequest controlSite) { | 756 void getControlSite(MediaTimelineControlSiteInterfaceRequest controlSite) { |
729 return impl.getControlSite(controlSite); | 757 return impl.getControlSite(controlSite); |
730 } | 758 } |
731 } | 759 } |
732 | 760 |
733 const int _mediaTimelineControlSiteMethodGetStatusName = 0; | 761 const int _mediaTimelineControlSiteMethodGetStatusName = 0; |
734 const int _mediaTimelineControlSiteMethodGetTimelineConsumerName = 1; | 762 const int _mediaTimelineControlSiteMethodGetTimelineConsumerName = 1; |
735 | 763 |
736 class _MediaTimelineControlSiteServiceDescription implements service_describer.S
erviceDescription { | 764 class _MediaTimelineControlSiteServiceDescription implements service_describer.S
erviceDescription { |
737 dynamic getTopLevelInterface([Function responseFactory]) => | 765 void getTopLevelInterface(Function responder) { |
738 responseFactory(null); | 766 responder(null); |
| 767 } |
739 | 768 |
740 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 769 void getTypeDefinition(String typeKey, Function responder) { |
741 responseFactory(null); | 770 responder(null); |
| 771 } |
742 | 772 |
743 dynamic getAllTypeDefinitions([Function responseFactory]) => | 773 void getAllTypeDefinitions(Function responder) { |
744 responseFactory(null); | 774 responder(null); |
| 775 } |
745 } | 776 } |
746 | 777 |
747 abstract class MediaTimelineControlSite { | 778 abstract class MediaTimelineControlSite { |
748 static const String serviceName = null; | 779 static const String serviceName = null; |
749 | 780 |
750 static service_describer.ServiceDescription _cachedServiceDescription; | 781 static service_describer.ServiceDescription _cachedServiceDescription; |
751 static service_describer.ServiceDescription get serviceDescription { | 782 static service_describer.ServiceDescription get serviceDescription { |
752 if (_cachedServiceDescription == null) { | 783 if (_cachedServiceDescription == null) { |
753 _cachedServiceDescription = new _MediaTimelineControlSiteServiceDescriptio
n(); | 784 _cachedServiceDescription = new _MediaTimelineControlSiteServiceDescriptio
n(); |
754 } | 785 } |
755 return _cachedServiceDescription; | 786 return _cachedServiceDescription; |
756 } | 787 } |
757 | 788 |
758 static MediaTimelineControlSiteProxy connectToService( | 789 static MediaTimelineControlSiteProxy connectToService( |
759 bindings.ServiceConnector s, String url, [String serviceName]) { | 790 bindings.ServiceConnector s, String url, [String serviceName]) { |
760 MediaTimelineControlSiteProxy p = new MediaTimelineControlSiteProxy.unbound(
); | 791 MediaTimelineControlSiteProxy p = new MediaTimelineControlSiteProxy.unbound(
); |
761 String name = serviceName ?? MediaTimelineControlSite.serviceName; | 792 String name = serviceName ?? MediaTimelineControlSite.serviceName; |
762 if ((name == null) || name.isEmpty) { | 793 if ((name == null) || name.isEmpty) { |
763 throw new core.MojoApiError( | 794 throw new core.MojoApiError( |
764 "If an interface has no ServiceName, then one must be provided."); | 795 "If an interface has no ServiceName, then one must be provided."); |
765 } | 796 } |
766 s.connectToService(url, p, name); | 797 s.connectToService(url, p, name); |
767 return p; | 798 return p; |
768 } | 799 } |
769 dynamic getStatus(int versionLastSeen,[Function responseFactory = null]); | 800 void getStatus(int versionLastSeen,void callback(int version, MediaTimelineCon
trolSiteStatus status)); |
770 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer); | 801 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer); |
771 static const int kInitialStatus = 0; | 802 static const int kInitialStatus = 0; |
772 } | 803 } |
773 | 804 |
774 abstract class MediaTimelineControlSiteInterface | 805 abstract class MediaTimelineControlSiteInterface |
775 implements bindings.MojoInterface<MediaTimelineControlSite>, | 806 implements bindings.MojoInterface<MediaTimelineControlSite>, |
776 MediaTimelineControlSite { | 807 MediaTimelineControlSite { |
777 factory MediaTimelineControlSiteInterface([MediaTimelineControlSite impl]) => | 808 factory MediaTimelineControlSiteInterface([MediaTimelineControlSite impl]) => |
778 new MediaTimelineControlSiteStub.unbound(impl); | 809 new MediaTimelineControlSiteStub.unbound(impl); |
779 | 810 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 842 |
812 void handleResponse(bindings.ServiceMessage message) { | 843 void handleResponse(bindings.ServiceMessage message) { |
813 switch (message.header.type) { | 844 switch (message.header.type) { |
814 case _mediaTimelineControlSiteMethodGetStatusName: | 845 case _mediaTimelineControlSiteMethodGetStatusName: |
815 var r = MediaTimelineControlSiteGetStatusResponseParams.deserialize( | 846 var r = MediaTimelineControlSiteGetStatusResponseParams.deserialize( |
816 message.payload); | 847 message.payload); |
817 if (!message.header.hasRequestId) { | 848 if (!message.header.hasRequestId) { |
818 proxyError("Expected a message with a valid request Id."); | 849 proxyError("Expected a message with a valid request Id."); |
819 return; | 850 return; |
820 } | 851 } |
821 Completer c = completerMap[message.header.requestId]; | 852 Function callback = callbackMap[message.header.requestId]; |
822 if (c == null) { | 853 if (callback == null) { |
823 proxyError( | 854 proxyError( |
824 "Message had unknown request Id: ${message.header.requestId}"); | 855 "Message had unknown request Id: ${message.header.requestId}"); |
825 return; | 856 return; |
826 } | 857 } |
827 completerMap.remove(message.header.requestId); | 858 callbackMap.remove(message.header.requestId); |
828 if (c.isCompleted) { | 859 callback(r.version , r.status ); |
829 proxyError("Response completer already completed"); | |
830 return; | |
831 } | |
832 c.complete(r); | |
833 break; | 860 break; |
834 default: | 861 default: |
835 proxyError("Unexpected message type: ${message.header.type}"); | 862 proxyError("Unexpected message type: ${message.header.type}"); |
836 close(immediate: true); | 863 close(immediate: true); |
837 break; | 864 break; |
838 } | 865 } |
839 } | 866 } |
840 | 867 |
841 @override | 868 @override |
842 String toString() { | 869 String toString() { |
(...skipping 24 matching lines...) Expand all Loading... |
867 return newMockedProxy; | 894 return newMockedProxy; |
868 } | 895 } |
869 | 896 |
870 static MediaTimelineControlSiteProxy newFromEndpoint( | 897 static MediaTimelineControlSiteProxy newFromEndpoint( |
871 core.MojoMessagePipeEndpoint endpoint) { | 898 core.MojoMessagePipeEndpoint endpoint) { |
872 assert(endpoint.setDescription("For MediaTimelineControlSiteProxy")); | 899 assert(endpoint.setDescription("For MediaTimelineControlSiteProxy")); |
873 return new MediaTimelineControlSiteProxy.fromEndpoint(endpoint); | 900 return new MediaTimelineControlSiteProxy.fromEndpoint(endpoint); |
874 } | 901 } |
875 | 902 |
876 | 903 |
877 dynamic getStatus(int versionLastSeen,[Function responseFactory = null]) { | 904 void getStatus(int versionLastSeen,void callback(int version, MediaTimelineCon
trolSiteStatus status)) { |
878 if (impl != null) { | 905 if (impl != null) { |
879 return new Future(() => impl.getStatus(versionLastSeen,_MediaTimelineContr
olSiteStubControl._mediaTimelineControlSiteGetStatusResponseParamsFactory)); | 906 impl.getStatus(versionLastSeen,callback); |
| 907 return; |
880 } | 908 } |
881 var params = new _MediaTimelineControlSiteGetStatusParams(); | 909 var params = new _MediaTimelineControlSiteGetStatusParams(); |
882 params.versionLastSeen = versionLastSeen; | 910 params.versionLastSeen = versionLastSeen; |
883 return ctrl.sendMessageWithRequestId( | 911 ctrl.sendMessageWithRequestId( |
884 params, | 912 params, |
885 _mediaTimelineControlSiteMethodGetStatusName, | 913 _mediaTimelineControlSiteMethodGetStatusName, |
886 -1, | 914 -1, |
887 bindings.MessageHeader.kMessageExpectsResponse); | 915 bindings.MessageHeader.kMessageExpectsResponse, |
| 916 callback); |
888 } | 917 } |
889 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer) { | 918 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer) { |
890 if (impl != null) { | 919 if (impl != null) { |
891 impl.getTimelineConsumer(timelineConsumer); | 920 impl.getTimelineConsumer(timelineConsumer); |
892 return; | 921 return; |
893 } | 922 } |
894 if (!ctrl.isBound) { | 923 if (!ctrl.isBound) { |
895 ctrl.proxyError("The Proxy is closed."); | 924 ctrl.proxyError("The Proxy is closed."); |
896 return; | 925 return; |
897 } | 926 } |
(...skipping 19 matching lines...) Expand all Loading... |
917 core.MojoHandle handle, [MediaTimelineControlSite impl]) | 946 core.MojoHandle handle, [MediaTimelineControlSite impl]) |
918 : super.fromHandle(handle, autoBegin: impl != null) { | 947 : super.fromHandle(handle, autoBegin: impl != null) { |
919 _impl = impl; | 948 _impl = impl; |
920 } | 949 } |
921 | 950 |
922 _MediaTimelineControlSiteStubControl.unbound([this._impl]) : super.unbound(); | 951 _MediaTimelineControlSiteStubControl.unbound([this._impl]) : super.unbound(); |
923 | 952 |
924 String get serviceName => MediaTimelineControlSite.serviceName; | 953 String get serviceName => MediaTimelineControlSite.serviceName; |
925 | 954 |
926 | 955 |
927 static MediaTimelineControlSiteGetStatusResponseParams _mediaTimelineControlSi
teGetStatusResponseParamsFactory(int version, MediaTimelineControlSiteStatus sta
tus) { | 956 Function _mediaTimelineControlSiteGetStatusResponseParamsResponder( |
928 var result = new MediaTimelineControlSiteGetStatusResponseParams(); | 957 int requestId) { |
929 result.version = version; | 958 return (int version, MediaTimelineControlSiteStatus status) { |
930 result.status = status; | 959 var result = new MediaTimelineControlSiteGetStatusResponseParams(); |
931 return result; | 960 result.version = version; |
| 961 result.status = status; |
| 962 sendResponse(buildResponseWithId( |
| 963 result, |
| 964 _mediaTimelineControlSiteMethodGetStatusName, |
| 965 requestId, |
| 966 bindings.MessageHeader.kMessageIsResponse)); |
| 967 }; |
932 } | 968 } |
933 | 969 |
934 dynamic handleMessage(bindings.ServiceMessage message) { | 970 void handleMessage(bindings.ServiceMessage message) { |
935 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 971 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
936 return bindings.ControlMessageHandler.handleMessage(this, | 972 bindings.ControlMessageHandler.handleMessage( |
937 0, | 973 this, 0, message); |
938 message); | 974 return; |
939 } | 975 } |
940 if (_impl == null) { | 976 if (_impl == null) { |
941 throw new core.MojoApiError("$this has no implementation set"); | 977 throw new core.MojoApiError("$this has no implementation set"); |
942 } | 978 } |
943 switch (message.header.type) { | 979 switch (message.header.type) { |
944 case _mediaTimelineControlSiteMethodGetStatusName: | 980 case _mediaTimelineControlSiteMethodGetStatusName: |
945 var params = _MediaTimelineControlSiteGetStatusParams.deserialize( | 981 var params = _MediaTimelineControlSiteGetStatusParams.deserialize( |
946 message.payload); | 982 message.payload); |
947 var response = _impl.getStatus(params.versionLastSeen,_mediaTimelineCont
rolSiteGetStatusResponseParamsFactory); | 983 _impl.getStatus(params.versionLastSeen, _mediaTimelineControlSiteGetStat
usResponseParamsResponder(message.header.requestId)); |
948 if (response is Future) { | |
949 return response.then((response) { | |
950 if (response != null) { | |
951 return buildResponseWithId( | |
952 response, | |
953 _mediaTimelineControlSiteMethodGetStatusName, | |
954 message.header.requestId, | |
955 bindings.MessageHeader.kMessageIsResponse); | |
956 } | |
957 }); | |
958 } else if (response != null) { | |
959 return buildResponseWithId( | |
960 response, | |
961 _mediaTimelineControlSiteMethodGetStatusName, | |
962 message.header.requestId, | |
963 bindings.MessageHeader.kMessageIsResponse); | |
964 } | |
965 break; | 984 break; |
966 case _mediaTimelineControlSiteMethodGetTimelineConsumerName: | 985 case _mediaTimelineControlSiteMethodGetTimelineConsumerName: |
967 var params = _MediaTimelineControlSiteGetTimelineConsumerParams.deserial
ize( | 986 var params = _MediaTimelineControlSiteGetTimelineConsumerParams.deserial
ize( |
968 message.payload); | 987 message.payload); |
969 _impl.getTimelineConsumer(params.timelineConsumer); | 988 _impl.getTimelineConsumer(params.timelineConsumer); |
970 break; | 989 break; |
971 default: | 990 default: |
972 throw new bindings.MojoCodecError("Unexpected message name"); | 991 throw new bindings.MojoCodecError("Unexpected message name"); |
973 break; | 992 break; |
974 } | 993 } |
975 return null; | |
976 } | 994 } |
977 | 995 |
978 MediaTimelineControlSite get impl => _impl; | 996 MediaTimelineControlSite get impl => _impl; |
979 set impl(MediaTimelineControlSite d) { | 997 set impl(MediaTimelineControlSite d) { |
980 if (d == null) { | 998 if (d == null) { |
981 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 999 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
982 } | 1000 } |
983 if (isBound && (_impl == null)) { | 1001 if (isBound && (_impl == null)) { |
984 beginHandlingEvents(); | 1002 beginHandlingEvents(); |
985 } | 1003 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 core.MojoHandle handle, [MediaTimelineControlSite impl]) | 1037 core.MojoHandle handle, [MediaTimelineControlSite impl]) |
1020 : super(new _MediaTimelineControlSiteStubControl.fromHandle(handle, impl))
; | 1038 : super(new _MediaTimelineControlSiteStubControl.fromHandle(handle, impl))
; |
1021 | 1039 |
1022 static MediaTimelineControlSiteStub newFromEndpoint( | 1040 static MediaTimelineControlSiteStub newFromEndpoint( |
1023 core.MojoMessagePipeEndpoint endpoint) { | 1041 core.MojoMessagePipeEndpoint endpoint) { |
1024 assert(endpoint.setDescription("For MediaTimelineControlSiteStub")); | 1042 assert(endpoint.setDescription("For MediaTimelineControlSiteStub")); |
1025 return new MediaTimelineControlSiteStub.fromEndpoint(endpoint); | 1043 return new MediaTimelineControlSiteStub.fromEndpoint(endpoint); |
1026 } | 1044 } |
1027 | 1045 |
1028 | 1046 |
1029 dynamic getStatus(int versionLastSeen,[Function responseFactory = null]) { | 1047 void getStatus(int versionLastSeen,void callback(int version, MediaTimelineCon
trolSiteStatus status)) { |
1030 return impl.getStatus(versionLastSeen,responseFactory); | 1048 return impl.getStatus(versionLastSeen,callback); |
1031 } | 1049 } |
1032 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer) { | 1050 void getTimelineConsumer(timelines_mojom.TimelineConsumerInterfaceRequest time
lineConsumer) { |
1033 return impl.getTimelineConsumer(timelineConsumer); | 1051 return impl.getTimelineConsumer(timelineConsumer); |
1034 } | 1052 } |
1035 } | 1053 } |
1036 | 1054 |
1037 | 1055 |
1038 | 1056 |
OLD | NEW |