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 nfc_mojom; | 5 library nfc_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 | 10 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 dynamic getAllTypeDefinitions([Function responseFactory]) => | 497 dynamic getAllTypeDefinitions([Function responseFactory]) => |
498 responseFactory(null); | 498 responseFactory(null); |
499 } | 499 } |
500 | 500 |
501 abstract class NfcTransmission { | 501 abstract class NfcTransmission { |
502 static const String serviceName = null; | 502 static const String serviceName = null; |
503 void cancel(); | 503 void cancel(); |
504 } | 504 } |
505 | 505 |
506 | 506 class _NfcTransmissionProxyControl |
507 class _NfcTransmissionProxyControl extends bindings.ProxyMessageHandler | 507 extends bindings.ProxyMessageHandler |
508 implements bindings.ProxyControl { | 508 implements bindings.ProxyControl { |
509 _NfcTransmissionProxyControl.fromEndpoint( | 509 _NfcTransmissionProxyControl.fromEndpoint( |
510 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 510 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
511 | 511 |
512 _NfcTransmissionProxyControl.fromHandle( | 512 _NfcTransmissionProxyControl.fromHandle( |
513 core.MojoHandle handle) : super.fromHandle(handle); | 513 core.MojoHandle handle) : super.fromHandle(handle); |
514 | 514 |
515 _NfcTransmissionProxyControl.unbound() : super.unbound(); | 515 _NfcTransmissionProxyControl.unbound() : super.unbound(); |
516 | 516 |
517 service_describer.ServiceDescription get serviceDescription => | 517 service_describer.ServiceDescription get serviceDescription => |
518 new _NfcTransmissionServiceDescription(); | 518 new _NfcTransmissionServiceDescription(); |
519 | 519 |
520 String get serviceName => NfcTransmission.serviceName; | 520 String get serviceName => NfcTransmission.serviceName; |
521 | 521 |
522 @override | |
523 void handleResponse(bindings.ServiceMessage message) { | 522 void handleResponse(bindings.ServiceMessage message) { |
524 switch (message.header.type) { | 523 switch (message.header.type) { |
525 default: | 524 default: |
526 proxyError("Unexpected message type: ${message.header.type}"); | 525 proxyError("Unexpected message type: ${message.header.type}"); |
527 close(immediate: true); | 526 close(immediate: true); |
528 break; | 527 break; |
529 } | 528 } |
530 } | 529 } |
531 | 530 |
532 @override | 531 @override |
533 String toString() { | 532 String toString() { |
534 var superString = super.toString(); | 533 var superString = super.toString(); |
535 return "_NfcTransmissionProxyControl($superString)"; | 534 return "_NfcTransmissionProxyControl($superString)"; |
536 } | 535 } |
537 } | 536 } |
538 | 537 |
539 | 538 class NfcTransmissionProxy |
540 class NfcTransmissionProxy extends bindings.Proxy | 539 extends bindings.Proxy |
541 implements NfcTransmission { | 540 implements NfcTransmission { |
542 NfcTransmissionProxy.fromEndpoint( | 541 NfcTransmissionProxy.fromEndpoint( |
543 core.MojoMessagePipeEndpoint endpoint) | 542 core.MojoMessagePipeEndpoint endpoint) |
544 : super(new _NfcTransmissionProxyControl.fromEndpoint(endpoint)); | 543 : super(new _NfcTransmissionProxyControl.fromEndpoint(endpoint)); |
545 | 544 |
546 NfcTransmissionProxy.fromHandle(core.MojoHandle handle) | 545 NfcTransmissionProxy.fromHandle(core.MojoHandle handle) |
547 : super(new _NfcTransmissionProxyControl.fromHandle(handle)); | 546 : super(new _NfcTransmissionProxyControl.fromHandle(handle)); |
548 | 547 |
549 NfcTransmissionProxy.unbound() | 548 NfcTransmissionProxy.unbound() |
550 : super(new _NfcTransmissionProxyControl.unbound()); | 549 : super(new _NfcTransmissionProxyControl.unbound()); |
551 | 550 |
(...skipping 15 matching lines...) Expand all Loading... |
567 if (!ctrl.isBound) { | 566 if (!ctrl.isBound) { |
568 ctrl.proxyError("The Proxy is closed."); | 567 ctrl.proxyError("The Proxy is closed."); |
569 return; | 568 return; |
570 } | 569 } |
571 var params = new _NfcTransmissionCancelParams(); | 570 var params = new _NfcTransmissionCancelParams(); |
572 ctrl.sendMessage(params, | 571 ctrl.sendMessage(params, |
573 _nfcTransmissionMethodCancelName); | 572 _nfcTransmissionMethodCancelName); |
574 } | 573 } |
575 } | 574 } |
576 | 575 |
577 | 576 class _NfcTransmissionStubControl |
578 class NfcTransmissionStub extends bindings.Stub { | 577 extends bindings.StubMessageHandler |
| 578 implements bindings.StubControl<NfcTransmission> { |
579 NfcTransmission _impl; | 579 NfcTransmission _impl; |
580 | 580 |
581 NfcTransmissionStub.fromEndpoint( | 581 _NfcTransmissionStubControl.fromEndpoint( |
582 core.MojoMessagePipeEndpoint endpoint, [NfcTransmission impl]) | 582 core.MojoMessagePipeEndpoint endpoint, [NfcTransmission impl]) |
583 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 583 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
584 _impl = impl; | 584 _impl = impl; |
585 } | 585 } |
586 | 586 |
587 NfcTransmissionStub.fromHandle( | 587 _NfcTransmissionStubControl.fromHandle( |
588 core.MojoHandle handle, [NfcTransmission impl]) | 588 core.MojoHandle handle, [NfcTransmission impl]) |
589 : super.fromHandle(handle, autoBegin: impl != null) { | 589 : super.fromHandle(handle, autoBegin: impl != null) { |
590 _impl = impl; | 590 _impl = impl; |
591 } | 591 } |
592 | 592 |
593 NfcTransmissionStub.unbound([this._impl]) : super.unbound(); | 593 _NfcTransmissionStubControl.unbound([this._impl]) : super.unbound(); |
594 | |
595 static NfcTransmissionStub newFromEndpoint( | |
596 core.MojoMessagePipeEndpoint endpoint) { | |
597 assert(endpoint.setDescription("For NfcTransmissionStub")); | |
598 return new NfcTransmissionStub.fromEndpoint(endpoint); | |
599 } | |
600 | 594 |
601 | 595 |
602 | 596 |
603 dynamic handleMessage(bindings.ServiceMessage message) { | 597 dynamic handleMessage(bindings.ServiceMessage message) { |
604 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 598 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
605 return bindings.ControlMessageHandler.handleMessage(this, | 599 return bindings.ControlMessageHandler.handleMessage(this, |
606 0, | 600 0, |
607 message); | 601 message); |
608 } | 602 } |
609 if (_impl == null) { | 603 if (_impl == null) { |
(...skipping 22 matching lines...) Expand all Loading... |
632 } | 626 } |
633 | 627 |
634 @override | 628 @override |
635 void bind(core.MojoMessagePipeEndpoint endpoint) { | 629 void bind(core.MojoMessagePipeEndpoint endpoint) { |
636 super.bind(endpoint); | 630 super.bind(endpoint); |
637 if (!isOpen && (_impl != null)) { | 631 if (!isOpen && (_impl != null)) { |
638 beginHandlingEvents(); | 632 beginHandlingEvents(); |
639 } | 633 } |
640 } | 634 } |
641 | 635 |
| 636 @override |
642 String toString() { | 637 String toString() { |
643 var superString = super.toString(); | 638 var superString = super.toString(); |
644 return "NfcTransmissionStub($superString)"; | 639 return "_NfcTransmissionStubControl($superString)"; |
645 } | 640 } |
646 | 641 |
647 int get version => 0; | 642 int get version => 0; |
648 | 643 |
649 static service_describer.ServiceDescription _cachedServiceDescription; | 644 static service_describer.ServiceDescription _cachedServiceDescription; |
650 static service_describer.ServiceDescription get serviceDescription { | 645 static service_describer.ServiceDescription get serviceDescription { |
651 if (_cachedServiceDescription == null) { | 646 if (_cachedServiceDescription == null) { |
652 _cachedServiceDescription = new _NfcTransmissionServiceDescription(); | 647 _cachedServiceDescription = new _NfcTransmissionServiceDescription(); |
653 } | 648 } |
654 return _cachedServiceDescription; | 649 return _cachedServiceDescription; |
655 } | 650 } |
656 } | 651 } |
657 | 652 |
| 653 class NfcTransmissionStub |
| 654 extends bindings.Stub<NfcTransmission> |
| 655 implements NfcTransmission { |
| 656 NfcTransmissionStub.fromEndpoint( |
| 657 core.MojoMessagePipeEndpoint endpoint, [NfcTransmission impl]) |
| 658 : super(new _NfcTransmissionStubControl.fromEndpoint(endpoint, impl)); |
| 659 |
| 660 NfcTransmissionStub.fromHandle( |
| 661 core.MojoHandle handle, [NfcTransmission impl]) |
| 662 : super(new _NfcTransmissionStubControl.fromHandle(handle, impl)); |
| 663 |
| 664 NfcTransmissionStub.unbound([NfcTransmission impl]) |
| 665 : super(new _NfcTransmissionStubControl.unbound(impl)); |
| 666 |
| 667 static NfcTransmissionStub newFromEndpoint( |
| 668 core.MojoMessagePipeEndpoint endpoint) { |
| 669 assert(endpoint.setDescription("For NfcTransmissionStub")); |
| 670 return new NfcTransmissionStub.fromEndpoint(endpoint); |
| 671 } |
| 672 |
| 673 static service_describer.ServiceDescription get serviceDescription => |
| 674 _NfcTransmissionStubControl.serviceDescription; |
| 675 |
| 676 |
| 677 void cancel() { |
| 678 return impl.cancel(); |
| 679 } |
| 680 } |
| 681 |
658 const int _nfcReceiverMethodOnReceivedNfcDataName = 0; | 682 const int _nfcReceiverMethodOnReceivedNfcDataName = 0; |
659 | 683 |
660 class _NfcReceiverServiceDescription implements service_describer.ServiceDescrip
tion { | 684 class _NfcReceiverServiceDescription implements service_describer.ServiceDescrip
tion { |
661 dynamic getTopLevelInterface([Function responseFactory]) => | 685 dynamic getTopLevelInterface([Function responseFactory]) => |
662 responseFactory(null); | 686 responseFactory(null); |
663 | 687 |
664 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 688 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
665 responseFactory(null); | 689 responseFactory(null); |
666 | 690 |
667 dynamic getAllTypeDefinitions([Function responseFactory]) => | 691 dynamic getAllTypeDefinitions([Function responseFactory]) => |
668 responseFactory(null); | 692 responseFactory(null); |
669 } | 693 } |
670 | 694 |
671 abstract class NfcReceiver { | 695 abstract class NfcReceiver { |
672 static const String serviceName = "nfc::NfcReceiver"; | 696 static const String serviceName = "nfc::NfcReceiver"; |
673 void onReceivedNfcData(NfcData nfcData); | 697 void onReceivedNfcData(NfcData nfcData); |
674 } | 698 } |
675 | 699 |
676 | 700 class _NfcReceiverProxyControl |
677 class _NfcReceiverProxyControl extends bindings.ProxyMessageHandler | 701 extends bindings.ProxyMessageHandler |
678 implements bindings.ProxyControl { | 702 implements bindings.ProxyControl { |
679 _NfcReceiverProxyControl.fromEndpoint( | 703 _NfcReceiverProxyControl.fromEndpoint( |
680 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 704 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
681 | 705 |
682 _NfcReceiverProxyControl.fromHandle( | 706 _NfcReceiverProxyControl.fromHandle( |
683 core.MojoHandle handle) : super.fromHandle(handle); | 707 core.MojoHandle handle) : super.fromHandle(handle); |
684 | 708 |
685 _NfcReceiverProxyControl.unbound() : super.unbound(); | 709 _NfcReceiverProxyControl.unbound() : super.unbound(); |
686 | 710 |
687 service_describer.ServiceDescription get serviceDescription => | 711 service_describer.ServiceDescription get serviceDescription => |
688 new _NfcReceiverServiceDescription(); | 712 new _NfcReceiverServiceDescription(); |
689 | 713 |
690 String get serviceName => NfcReceiver.serviceName; | 714 String get serviceName => NfcReceiver.serviceName; |
691 | 715 |
692 @override | |
693 void handleResponse(bindings.ServiceMessage message) { | 716 void handleResponse(bindings.ServiceMessage message) { |
694 switch (message.header.type) { | 717 switch (message.header.type) { |
695 default: | 718 default: |
696 proxyError("Unexpected message type: ${message.header.type}"); | 719 proxyError("Unexpected message type: ${message.header.type}"); |
697 close(immediate: true); | 720 close(immediate: true); |
698 break; | 721 break; |
699 } | 722 } |
700 } | 723 } |
701 | 724 |
702 @override | 725 @override |
703 String toString() { | 726 String toString() { |
704 var superString = super.toString(); | 727 var superString = super.toString(); |
705 return "_NfcReceiverProxyControl($superString)"; | 728 return "_NfcReceiverProxyControl($superString)"; |
706 } | 729 } |
707 } | 730 } |
708 | 731 |
709 | 732 class NfcReceiverProxy |
710 class NfcReceiverProxy extends bindings.Proxy | 733 extends bindings.Proxy |
711 implements NfcReceiver { | 734 implements NfcReceiver { |
712 NfcReceiverProxy.fromEndpoint( | 735 NfcReceiverProxy.fromEndpoint( |
713 core.MojoMessagePipeEndpoint endpoint) | 736 core.MojoMessagePipeEndpoint endpoint) |
714 : super(new _NfcReceiverProxyControl.fromEndpoint(endpoint)); | 737 : super(new _NfcReceiverProxyControl.fromEndpoint(endpoint)); |
715 | 738 |
716 NfcReceiverProxy.fromHandle(core.MojoHandle handle) | 739 NfcReceiverProxy.fromHandle(core.MojoHandle handle) |
717 : super(new _NfcReceiverProxyControl.fromHandle(handle)); | 740 : super(new _NfcReceiverProxyControl.fromHandle(handle)); |
718 | 741 |
719 NfcReceiverProxy.unbound() | 742 NfcReceiverProxy.unbound() |
720 : super(new _NfcReceiverProxyControl.unbound()); | 743 : super(new _NfcReceiverProxyControl.unbound()); |
721 | 744 |
(...skipping 16 matching lines...) Expand all Loading... |
738 ctrl.proxyError("The Proxy is closed."); | 761 ctrl.proxyError("The Proxy is closed."); |
739 return; | 762 return; |
740 } | 763 } |
741 var params = new _NfcReceiverOnReceivedNfcDataParams(); | 764 var params = new _NfcReceiverOnReceivedNfcDataParams(); |
742 params.nfcData = nfcData; | 765 params.nfcData = nfcData; |
743 ctrl.sendMessage(params, | 766 ctrl.sendMessage(params, |
744 _nfcReceiverMethodOnReceivedNfcDataName); | 767 _nfcReceiverMethodOnReceivedNfcDataName); |
745 } | 768 } |
746 } | 769 } |
747 | 770 |
748 | 771 class _NfcReceiverStubControl |
749 class NfcReceiverStub extends bindings.Stub { | 772 extends bindings.StubMessageHandler |
| 773 implements bindings.StubControl<NfcReceiver> { |
750 NfcReceiver _impl; | 774 NfcReceiver _impl; |
751 | 775 |
752 NfcReceiverStub.fromEndpoint( | 776 _NfcReceiverStubControl.fromEndpoint( |
753 core.MojoMessagePipeEndpoint endpoint, [NfcReceiver impl]) | 777 core.MojoMessagePipeEndpoint endpoint, [NfcReceiver impl]) |
754 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 778 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
755 _impl = impl; | 779 _impl = impl; |
756 } | 780 } |
757 | 781 |
758 NfcReceiverStub.fromHandle( | 782 _NfcReceiverStubControl.fromHandle( |
759 core.MojoHandle handle, [NfcReceiver impl]) | 783 core.MojoHandle handle, [NfcReceiver impl]) |
760 : super.fromHandle(handle, autoBegin: impl != null) { | 784 : super.fromHandle(handle, autoBegin: impl != null) { |
761 _impl = impl; | 785 _impl = impl; |
762 } | 786 } |
763 | 787 |
764 NfcReceiverStub.unbound([this._impl]) : super.unbound(); | 788 _NfcReceiverStubControl.unbound([this._impl]) : super.unbound(); |
765 | |
766 static NfcReceiverStub newFromEndpoint( | |
767 core.MojoMessagePipeEndpoint endpoint) { | |
768 assert(endpoint.setDescription("For NfcReceiverStub")); | |
769 return new NfcReceiverStub.fromEndpoint(endpoint); | |
770 } | |
771 | 789 |
772 | 790 |
773 | 791 |
774 dynamic handleMessage(bindings.ServiceMessage message) { | 792 dynamic handleMessage(bindings.ServiceMessage message) { |
775 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 793 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
776 return bindings.ControlMessageHandler.handleMessage(this, | 794 return bindings.ControlMessageHandler.handleMessage(this, |
777 0, | 795 0, |
778 message); | 796 message); |
779 } | 797 } |
780 if (_impl == null) { | 798 if (_impl == null) { |
(...skipping 24 matching lines...) Expand all Loading... |
805 } | 823 } |
806 | 824 |
807 @override | 825 @override |
808 void bind(core.MojoMessagePipeEndpoint endpoint) { | 826 void bind(core.MojoMessagePipeEndpoint endpoint) { |
809 super.bind(endpoint); | 827 super.bind(endpoint); |
810 if (!isOpen && (_impl != null)) { | 828 if (!isOpen && (_impl != null)) { |
811 beginHandlingEvents(); | 829 beginHandlingEvents(); |
812 } | 830 } |
813 } | 831 } |
814 | 832 |
| 833 @override |
815 String toString() { | 834 String toString() { |
816 var superString = super.toString(); | 835 var superString = super.toString(); |
817 return "NfcReceiverStub($superString)"; | 836 return "_NfcReceiverStubControl($superString)"; |
818 } | 837 } |
819 | 838 |
820 int get version => 0; | 839 int get version => 0; |
821 | 840 |
822 static service_describer.ServiceDescription _cachedServiceDescription; | 841 static service_describer.ServiceDescription _cachedServiceDescription; |
823 static service_describer.ServiceDescription get serviceDescription { | 842 static service_describer.ServiceDescription get serviceDescription { |
824 if (_cachedServiceDescription == null) { | 843 if (_cachedServiceDescription == null) { |
825 _cachedServiceDescription = new _NfcReceiverServiceDescription(); | 844 _cachedServiceDescription = new _NfcReceiverServiceDescription(); |
826 } | 845 } |
827 return _cachedServiceDescription; | 846 return _cachedServiceDescription; |
828 } | 847 } |
829 } | 848 } |
830 | 849 |
| 850 class NfcReceiverStub |
| 851 extends bindings.Stub<NfcReceiver> |
| 852 implements NfcReceiver { |
| 853 NfcReceiverStub.fromEndpoint( |
| 854 core.MojoMessagePipeEndpoint endpoint, [NfcReceiver impl]) |
| 855 : super(new _NfcReceiverStubControl.fromEndpoint(endpoint, impl)); |
| 856 |
| 857 NfcReceiverStub.fromHandle( |
| 858 core.MojoHandle handle, [NfcReceiver impl]) |
| 859 : super(new _NfcReceiverStubControl.fromHandle(handle, impl)); |
| 860 |
| 861 NfcReceiverStub.unbound([NfcReceiver impl]) |
| 862 : super(new _NfcReceiverStubControl.unbound(impl)); |
| 863 |
| 864 static NfcReceiverStub newFromEndpoint( |
| 865 core.MojoMessagePipeEndpoint endpoint) { |
| 866 assert(endpoint.setDescription("For NfcReceiverStub")); |
| 867 return new NfcReceiverStub.fromEndpoint(endpoint); |
| 868 } |
| 869 |
| 870 static service_describer.ServiceDescription get serviceDescription => |
| 871 _NfcReceiverStubControl.serviceDescription; |
| 872 |
| 873 |
| 874 void onReceivedNfcData(NfcData nfcData) { |
| 875 return impl.onReceivedNfcData(nfcData); |
| 876 } |
| 877 } |
| 878 |
831 const int _nfcMethodTransmitOnNextConnectionName = 0; | 879 const int _nfcMethodTransmitOnNextConnectionName = 0; |
832 const int _nfcMethodRegisterName = 1; | 880 const int _nfcMethodRegisterName = 1; |
833 const int _nfcMethodUnregisterName = 2; | 881 const int _nfcMethodUnregisterName = 2; |
834 | 882 |
835 class _NfcServiceDescription implements service_describer.ServiceDescription { | 883 class _NfcServiceDescription implements service_describer.ServiceDescription { |
836 dynamic getTopLevelInterface([Function responseFactory]) => | 884 dynamic getTopLevelInterface([Function responseFactory]) => |
837 responseFactory(null); | 885 responseFactory(null); |
838 | 886 |
839 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 887 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
840 responseFactory(null); | 888 responseFactory(null); |
841 | 889 |
842 dynamic getAllTypeDefinitions([Function responseFactory]) => | 890 dynamic getAllTypeDefinitions([Function responseFactory]) => |
843 responseFactory(null); | 891 responseFactory(null); |
844 } | 892 } |
845 | 893 |
846 abstract class Nfc { | 894 abstract class Nfc { |
847 static const String serviceName = "nfc::Nfc"; | 895 static const String serviceName = "nfc::Nfc"; |
848 dynamic transmitOnNextConnection(NfcData nfcData,Object transmission,[Function
responseFactory = null]); | 896 dynamic transmitOnNextConnection(NfcData nfcData,Object transmission,[Function
responseFactory = null]); |
849 void register(); | 897 void register(); |
850 void unregister(); | 898 void unregister(); |
851 } | 899 } |
852 | 900 |
853 | 901 class _NfcProxyControl |
854 class _NfcProxyControl extends bindings.ProxyMessageHandler | 902 extends bindings.ProxyMessageHandler |
855 implements bindings.ProxyControl { | 903 implements bindings.ProxyControl { |
856 _NfcProxyControl.fromEndpoint( | 904 _NfcProxyControl.fromEndpoint( |
857 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 905 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
858 | 906 |
859 _NfcProxyControl.fromHandle( | 907 _NfcProxyControl.fromHandle( |
860 core.MojoHandle handle) : super.fromHandle(handle); | 908 core.MojoHandle handle) : super.fromHandle(handle); |
861 | 909 |
862 _NfcProxyControl.unbound() : super.unbound(); | 910 _NfcProxyControl.unbound() : super.unbound(); |
863 | 911 |
864 service_describer.ServiceDescription get serviceDescription => | 912 service_describer.ServiceDescription get serviceDescription => |
865 new _NfcServiceDescription(); | 913 new _NfcServiceDescription(); |
866 | 914 |
867 String get serviceName => Nfc.serviceName; | 915 String get serviceName => Nfc.serviceName; |
868 | 916 |
869 @override | |
870 void handleResponse(bindings.ServiceMessage message) { | 917 void handleResponse(bindings.ServiceMessage message) { |
871 switch (message.header.type) { | 918 switch (message.header.type) { |
872 case _nfcMethodTransmitOnNextConnectionName: | 919 case _nfcMethodTransmitOnNextConnectionName: |
873 var r = NfcTransmitOnNextConnectionResponseParams.deserialize( | 920 var r = NfcTransmitOnNextConnectionResponseParams.deserialize( |
874 message.payload); | 921 message.payload); |
875 if (!message.header.hasRequestId) { | 922 if (!message.header.hasRequestId) { |
876 proxyError("Expected a message with a valid request Id."); | 923 proxyError("Expected a message with a valid request Id."); |
877 return; | 924 return; |
878 } | 925 } |
879 Completer c = completerMap[message.header.requestId]; | 926 Completer c = completerMap[message.header.requestId]; |
(...skipping 16 matching lines...) Expand all Loading... |
896 } | 943 } |
897 } | 944 } |
898 | 945 |
899 @override | 946 @override |
900 String toString() { | 947 String toString() { |
901 var superString = super.toString(); | 948 var superString = super.toString(); |
902 return "_NfcProxyControl($superString)"; | 949 return "_NfcProxyControl($superString)"; |
903 } | 950 } |
904 } | 951 } |
905 | 952 |
906 | 953 class NfcProxy |
907 class NfcProxy extends bindings.Proxy | 954 extends bindings.Proxy |
908 implements Nfc { | 955 implements Nfc { |
909 NfcProxy.fromEndpoint( | 956 NfcProxy.fromEndpoint( |
910 core.MojoMessagePipeEndpoint endpoint) | 957 core.MojoMessagePipeEndpoint endpoint) |
911 : super(new _NfcProxyControl.fromEndpoint(endpoint)); | 958 : super(new _NfcProxyControl.fromEndpoint(endpoint)); |
912 | 959 |
913 NfcProxy.fromHandle(core.MojoHandle handle) | 960 NfcProxy.fromHandle(core.MojoHandle handle) |
914 : super(new _NfcProxyControl.fromHandle(handle)); | 961 : super(new _NfcProxyControl.fromHandle(handle)); |
915 | 962 |
916 NfcProxy.unbound() | 963 NfcProxy.unbound() |
917 : super(new _NfcProxyControl.unbound()); | 964 : super(new _NfcProxyControl.unbound()); |
918 | 965 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 if (!ctrl.isBound) { | 1000 if (!ctrl.isBound) { |
954 ctrl.proxyError("The Proxy is closed."); | 1001 ctrl.proxyError("The Proxy is closed."); |
955 return; | 1002 return; |
956 } | 1003 } |
957 var params = new _NfcUnregisterParams(); | 1004 var params = new _NfcUnregisterParams(); |
958 ctrl.sendMessage(params, | 1005 ctrl.sendMessage(params, |
959 _nfcMethodUnregisterName); | 1006 _nfcMethodUnregisterName); |
960 } | 1007 } |
961 } | 1008 } |
962 | 1009 |
963 | 1010 class _NfcStubControl |
964 class NfcStub extends bindings.Stub { | 1011 extends bindings.StubMessageHandler |
| 1012 implements bindings.StubControl<Nfc> { |
965 Nfc _impl; | 1013 Nfc _impl; |
966 | 1014 |
967 NfcStub.fromEndpoint( | 1015 _NfcStubControl.fromEndpoint( |
968 core.MojoMessagePipeEndpoint endpoint, [Nfc impl]) | 1016 core.MojoMessagePipeEndpoint endpoint, [Nfc impl]) |
969 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1017 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
970 _impl = impl; | 1018 _impl = impl; |
971 } | 1019 } |
972 | 1020 |
973 NfcStub.fromHandle( | 1021 _NfcStubControl.fromHandle( |
974 core.MojoHandle handle, [Nfc impl]) | 1022 core.MojoHandle handle, [Nfc impl]) |
975 : super.fromHandle(handle, autoBegin: impl != null) { | 1023 : super.fromHandle(handle, autoBegin: impl != null) { |
976 _impl = impl; | 1024 _impl = impl; |
977 } | 1025 } |
978 | 1026 |
979 NfcStub.unbound([this._impl]) : super.unbound(); | 1027 _NfcStubControl.unbound([this._impl]) : super.unbound(); |
980 | |
981 static NfcStub newFromEndpoint( | |
982 core.MojoMessagePipeEndpoint endpoint) { | |
983 assert(endpoint.setDescription("For NfcStub")); | |
984 return new NfcStub.fromEndpoint(endpoint); | |
985 } | |
986 | 1028 |
987 | 1029 |
988 NfcTransmitOnNextConnectionResponseParams _nfcTransmitOnNextConnectionResponse
ParamsFactory(bool success) { | 1030 NfcTransmitOnNextConnectionResponseParams _nfcTransmitOnNextConnectionResponse
ParamsFactory(bool success) { |
989 var result = new NfcTransmitOnNextConnectionResponseParams(); | 1031 var result = new NfcTransmitOnNextConnectionResponseParams(); |
990 result.success = success; | 1032 result.success = success; |
991 return result; | 1033 return result; |
992 } | 1034 } |
993 | 1035 |
994 dynamic handleMessage(bindings.ServiceMessage message) { | 1036 dynamic handleMessage(bindings.ServiceMessage message) { |
995 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1037 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1090 } |
1049 | 1091 |
1050 @override | 1092 @override |
1051 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1093 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1052 super.bind(endpoint); | 1094 super.bind(endpoint); |
1053 if (!isOpen && (_impl != null)) { | 1095 if (!isOpen && (_impl != null)) { |
1054 beginHandlingEvents(); | 1096 beginHandlingEvents(); |
1055 } | 1097 } |
1056 } | 1098 } |
1057 | 1099 |
| 1100 @override |
1058 String toString() { | 1101 String toString() { |
1059 var superString = super.toString(); | 1102 var superString = super.toString(); |
1060 return "NfcStub($superString)"; | 1103 return "_NfcStubControl($superString)"; |
1061 } | 1104 } |
1062 | 1105 |
1063 int get version => 0; | 1106 int get version => 0; |
1064 | 1107 |
1065 static service_describer.ServiceDescription _cachedServiceDescription; | 1108 static service_describer.ServiceDescription _cachedServiceDescription; |
1066 static service_describer.ServiceDescription get serviceDescription { | 1109 static service_describer.ServiceDescription get serviceDescription { |
1067 if (_cachedServiceDescription == null) { | 1110 if (_cachedServiceDescription == null) { |
1068 _cachedServiceDescription = new _NfcServiceDescription(); | 1111 _cachedServiceDescription = new _NfcServiceDescription(); |
1069 } | 1112 } |
1070 return _cachedServiceDescription; | 1113 return _cachedServiceDescription; |
1071 } | 1114 } |
1072 } | 1115 } |
1073 | 1116 |
| 1117 class NfcStub |
| 1118 extends bindings.Stub<Nfc> |
| 1119 implements Nfc { |
| 1120 NfcStub.fromEndpoint( |
| 1121 core.MojoMessagePipeEndpoint endpoint, [Nfc impl]) |
| 1122 : super(new _NfcStubControl.fromEndpoint(endpoint, impl)); |
| 1123 |
| 1124 NfcStub.fromHandle( |
| 1125 core.MojoHandle handle, [Nfc impl]) |
| 1126 : super(new _NfcStubControl.fromHandle(handle, impl)); |
| 1127 |
| 1128 NfcStub.unbound([Nfc impl]) |
| 1129 : super(new _NfcStubControl.unbound(impl)); |
| 1130 |
| 1131 static NfcStub newFromEndpoint( |
| 1132 core.MojoMessagePipeEndpoint endpoint) { |
| 1133 assert(endpoint.setDescription("For NfcStub")); |
| 1134 return new NfcStub.fromEndpoint(endpoint); |
| 1135 } |
| 1136 |
| 1137 static service_describer.ServiceDescription get serviceDescription => |
| 1138 _NfcStubControl.serviceDescription; |
| 1139 |
| 1140 |
| 1141 dynamic transmitOnNextConnection(NfcData nfcData,Object transmission,[Function
responseFactory = null]) { |
| 1142 return impl.transmitOnNextConnection(nfcData,transmission,responseFactory); |
| 1143 } |
| 1144 void register() { |
| 1145 return impl.register(); |
| 1146 } |
| 1147 void unregister() { |
| 1148 return impl.unregister(); |
| 1149 } |
| 1150 } |
| 1151 |
1074 | 1152 |
1075 | 1153 |
OLD | NEW |