| 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 notifications_mojom; | 5 library notifications_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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 dynamic getAllTypeDefinitions([Function responseFactory]) => | 495 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 496 responseFactory(null); | 496 responseFactory(null); |
| 497 } | 497 } |
| 498 | 498 |
| 499 abstract class NotificationClient { | 499 abstract class NotificationClient { |
| 500 static const String serviceName = null; | 500 static const String serviceName = null; |
| 501 void onSelected(); | 501 void onSelected(); |
| 502 void onDismissed(); | 502 void onDismissed(); |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 class _NotificationClientProxyControl |
| 506 class _NotificationClientProxyControl extends bindings.ProxyMessageHandler | 506 extends bindings.ProxyMessageHandler |
| 507 implements bindings.ProxyControl { | 507 implements bindings.ProxyControl { |
| 508 _NotificationClientProxyControl.fromEndpoint( | 508 _NotificationClientProxyControl.fromEndpoint( |
| 509 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 509 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 510 | 510 |
| 511 _NotificationClientProxyControl.fromHandle( | 511 _NotificationClientProxyControl.fromHandle( |
| 512 core.MojoHandle handle) : super.fromHandle(handle); | 512 core.MojoHandle handle) : super.fromHandle(handle); |
| 513 | 513 |
| 514 _NotificationClientProxyControl.unbound() : super.unbound(); | 514 _NotificationClientProxyControl.unbound() : super.unbound(); |
| 515 | 515 |
| 516 service_describer.ServiceDescription get serviceDescription => | 516 service_describer.ServiceDescription get serviceDescription => |
| 517 new _NotificationClientServiceDescription(); | 517 new _NotificationClientServiceDescription(); |
| 518 | 518 |
| 519 String get serviceName => NotificationClient.serviceName; | 519 String get serviceName => NotificationClient.serviceName; |
| 520 | 520 |
| 521 @override | |
| 522 void handleResponse(bindings.ServiceMessage message) { | 521 void handleResponse(bindings.ServiceMessage message) { |
| 523 switch (message.header.type) { | 522 switch (message.header.type) { |
| 524 default: | 523 default: |
| 525 proxyError("Unexpected message type: ${message.header.type}"); | 524 proxyError("Unexpected message type: ${message.header.type}"); |
| 526 close(immediate: true); | 525 close(immediate: true); |
| 527 break; | 526 break; |
| 528 } | 527 } |
| 529 } | 528 } |
| 530 | 529 |
| 531 @override | 530 @override |
| 532 String toString() { | 531 String toString() { |
| 533 var superString = super.toString(); | 532 var superString = super.toString(); |
| 534 return "_NotificationClientProxyControl($superString)"; | 533 return "_NotificationClientProxyControl($superString)"; |
| 535 } | 534 } |
| 536 } | 535 } |
| 537 | 536 |
| 538 | 537 class NotificationClientProxy |
| 539 class NotificationClientProxy extends bindings.Proxy | 538 extends bindings.Proxy |
| 540 implements NotificationClient { | 539 implements NotificationClient { |
| 541 NotificationClientProxy.fromEndpoint( | 540 NotificationClientProxy.fromEndpoint( |
| 542 core.MojoMessagePipeEndpoint endpoint) | 541 core.MojoMessagePipeEndpoint endpoint) |
| 543 : super(new _NotificationClientProxyControl.fromEndpoint(endpoint)); | 542 : super(new _NotificationClientProxyControl.fromEndpoint(endpoint)); |
| 544 | 543 |
| 545 NotificationClientProxy.fromHandle(core.MojoHandle handle) | 544 NotificationClientProxy.fromHandle(core.MojoHandle handle) |
| 546 : super(new _NotificationClientProxyControl.fromHandle(handle)); | 545 : super(new _NotificationClientProxyControl.fromHandle(handle)); |
| 547 | 546 |
| 548 NotificationClientProxy.unbound() | 547 NotificationClientProxy.unbound() |
| 549 : super(new _NotificationClientProxyControl.unbound()); | 548 : super(new _NotificationClientProxyControl.unbound()); |
| 550 | 549 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 575 if (!ctrl.isBound) { | 574 if (!ctrl.isBound) { |
| 576 ctrl.proxyError("The Proxy is closed."); | 575 ctrl.proxyError("The Proxy is closed."); |
| 577 return; | 576 return; |
| 578 } | 577 } |
| 579 var params = new _NotificationClientOnDismissedParams(); | 578 var params = new _NotificationClientOnDismissedParams(); |
| 580 ctrl.sendMessage(params, | 579 ctrl.sendMessage(params, |
| 581 _notificationClientMethodOnDismissedName); | 580 _notificationClientMethodOnDismissedName); |
| 582 } | 581 } |
| 583 } | 582 } |
| 584 | 583 |
| 585 | 584 class _NotificationClientStubControl |
| 586 class NotificationClientStub extends bindings.Stub { | 585 extends bindings.StubMessageHandler |
| 586 implements bindings.StubControl<NotificationClient> { |
| 587 NotificationClient _impl; | 587 NotificationClient _impl; |
| 588 | 588 |
| 589 NotificationClientStub.fromEndpoint( | 589 _NotificationClientStubControl.fromEndpoint( |
| 590 core.MojoMessagePipeEndpoint endpoint, [NotificationClient impl]) | 590 core.MojoMessagePipeEndpoint endpoint, [NotificationClient impl]) |
| 591 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 591 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 592 _impl = impl; | 592 _impl = impl; |
| 593 } | 593 } |
| 594 | 594 |
| 595 NotificationClientStub.fromHandle( | 595 _NotificationClientStubControl.fromHandle( |
| 596 core.MojoHandle handle, [NotificationClient impl]) | 596 core.MojoHandle handle, [NotificationClient impl]) |
| 597 : super.fromHandle(handle, autoBegin: impl != null) { | 597 : super.fromHandle(handle, autoBegin: impl != null) { |
| 598 _impl = impl; | 598 _impl = impl; |
| 599 } | 599 } |
| 600 | 600 |
| 601 NotificationClientStub.unbound([this._impl]) : super.unbound(); | 601 _NotificationClientStubControl.unbound([this._impl]) : super.unbound(); |
| 602 | |
| 603 static NotificationClientStub newFromEndpoint( | |
| 604 core.MojoMessagePipeEndpoint endpoint) { | |
| 605 assert(endpoint.setDescription("For NotificationClientStub")); | |
| 606 return new NotificationClientStub.fromEndpoint(endpoint); | |
| 607 } | |
| 608 | 602 |
| 609 | 603 |
| 610 | 604 |
| 611 dynamic handleMessage(bindings.ServiceMessage message) { | 605 dynamic handleMessage(bindings.ServiceMessage message) { |
| 612 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 606 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 613 return bindings.ControlMessageHandler.handleMessage(this, | 607 return bindings.ControlMessageHandler.handleMessage(this, |
| 614 0, | 608 0, |
| 615 message); | 609 message); |
| 616 } | 610 } |
| 617 if (_impl == null) { | 611 if (_impl == null) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 643 } | 637 } |
| 644 | 638 |
| 645 @override | 639 @override |
| 646 void bind(core.MojoMessagePipeEndpoint endpoint) { | 640 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 647 super.bind(endpoint); | 641 super.bind(endpoint); |
| 648 if (!isOpen && (_impl != null)) { | 642 if (!isOpen && (_impl != null)) { |
| 649 beginHandlingEvents(); | 643 beginHandlingEvents(); |
| 650 } | 644 } |
| 651 } | 645 } |
| 652 | 646 |
| 647 @override |
| 653 String toString() { | 648 String toString() { |
| 654 var superString = super.toString(); | 649 var superString = super.toString(); |
| 655 return "NotificationClientStub($superString)"; | 650 return "_NotificationClientStubControl($superString)"; |
| 656 } | 651 } |
| 657 | 652 |
| 658 int get version => 0; | 653 int get version => 0; |
| 659 | 654 |
| 660 static service_describer.ServiceDescription _cachedServiceDescription; | 655 static service_describer.ServiceDescription _cachedServiceDescription; |
| 661 static service_describer.ServiceDescription get serviceDescription { | 656 static service_describer.ServiceDescription get serviceDescription { |
| 662 if (_cachedServiceDescription == null) { | 657 if (_cachedServiceDescription == null) { |
| 663 _cachedServiceDescription = new _NotificationClientServiceDescription(); | 658 _cachedServiceDescription = new _NotificationClientServiceDescription(); |
| 664 } | 659 } |
| 665 return _cachedServiceDescription; | 660 return _cachedServiceDescription; |
| 666 } | 661 } |
| 667 } | 662 } |
| 668 | 663 |
| 664 class NotificationClientStub |
| 665 extends bindings.Stub<NotificationClient> |
| 666 implements NotificationClient { |
| 667 NotificationClientStub.fromEndpoint( |
| 668 core.MojoMessagePipeEndpoint endpoint, [NotificationClient impl]) |
| 669 : super(new _NotificationClientStubControl.fromEndpoint(endpoint, impl)); |
| 670 |
| 671 NotificationClientStub.fromHandle( |
| 672 core.MojoHandle handle, [NotificationClient impl]) |
| 673 : super(new _NotificationClientStubControl.fromHandle(handle, impl)); |
| 674 |
| 675 NotificationClientStub.unbound([NotificationClient impl]) |
| 676 : super(new _NotificationClientStubControl.unbound(impl)); |
| 677 |
| 678 static NotificationClientStub newFromEndpoint( |
| 679 core.MojoMessagePipeEndpoint endpoint) { |
| 680 assert(endpoint.setDescription("For NotificationClientStub")); |
| 681 return new NotificationClientStub.fromEndpoint(endpoint); |
| 682 } |
| 683 |
| 684 static service_describer.ServiceDescription get serviceDescription => |
| 685 _NotificationClientStubControl.serviceDescription; |
| 686 |
| 687 |
| 688 void onSelected() { |
| 689 return impl.onSelected(); |
| 690 } |
| 691 void onDismissed() { |
| 692 return impl.onDismissed(); |
| 693 } |
| 694 } |
| 695 |
| 669 const int _notificationMethodUpdateName = 0; | 696 const int _notificationMethodUpdateName = 0; |
| 670 const int _notificationMethodCancelName = 1; | 697 const int _notificationMethodCancelName = 1; |
| 671 | 698 |
| 672 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { | 699 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { |
| 673 dynamic getTopLevelInterface([Function responseFactory]) => | 700 dynamic getTopLevelInterface([Function responseFactory]) => |
| 674 responseFactory(null); | 701 responseFactory(null); |
| 675 | 702 |
| 676 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 703 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 677 responseFactory(null); | 704 responseFactory(null); |
| 678 | 705 |
| 679 dynamic getAllTypeDefinitions([Function responseFactory]) => | 706 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 680 responseFactory(null); | 707 responseFactory(null); |
| 681 } | 708 } |
| 682 | 709 |
| 683 abstract class Notification { | 710 abstract class Notification { |
| 684 static const String serviceName = null; | 711 static const String serviceName = null; |
| 685 void update(NotificationData notificationData); | 712 void update(NotificationData notificationData); |
| 686 void cancel(); | 713 void cancel(); |
| 687 } | 714 } |
| 688 | 715 |
| 689 | 716 class _NotificationProxyControl |
| 690 class _NotificationProxyControl extends bindings.ProxyMessageHandler | 717 extends bindings.ProxyMessageHandler |
| 691 implements bindings.ProxyControl { | 718 implements bindings.ProxyControl { |
| 692 _NotificationProxyControl.fromEndpoint( | 719 _NotificationProxyControl.fromEndpoint( |
| 693 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 720 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 694 | 721 |
| 695 _NotificationProxyControl.fromHandle( | 722 _NotificationProxyControl.fromHandle( |
| 696 core.MojoHandle handle) : super.fromHandle(handle); | 723 core.MojoHandle handle) : super.fromHandle(handle); |
| 697 | 724 |
| 698 _NotificationProxyControl.unbound() : super.unbound(); | 725 _NotificationProxyControl.unbound() : super.unbound(); |
| 699 | 726 |
| 700 service_describer.ServiceDescription get serviceDescription => | 727 service_describer.ServiceDescription get serviceDescription => |
| 701 new _NotificationServiceDescription(); | 728 new _NotificationServiceDescription(); |
| 702 | 729 |
| 703 String get serviceName => Notification.serviceName; | 730 String get serviceName => Notification.serviceName; |
| 704 | 731 |
| 705 @override | |
| 706 void handleResponse(bindings.ServiceMessage message) { | 732 void handleResponse(bindings.ServiceMessage message) { |
| 707 switch (message.header.type) { | 733 switch (message.header.type) { |
| 708 default: | 734 default: |
| 709 proxyError("Unexpected message type: ${message.header.type}"); | 735 proxyError("Unexpected message type: ${message.header.type}"); |
| 710 close(immediate: true); | 736 close(immediate: true); |
| 711 break; | 737 break; |
| 712 } | 738 } |
| 713 } | 739 } |
| 714 | 740 |
| 715 @override | 741 @override |
| 716 String toString() { | 742 String toString() { |
| 717 var superString = super.toString(); | 743 var superString = super.toString(); |
| 718 return "_NotificationProxyControl($superString)"; | 744 return "_NotificationProxyControl($superString)"; |
| 719 } | 745 } |
| 720 } | 746 } |
| 721 | 747 |
| 722 | 748 class NotificationProxy |
| 723 class NotificationProxy extends bindings.Proxy | 749 extends bindings.Proxy |
| 724 implements Notification { | 750 implements Notification { |
| 725 NotificationProxy.fromEndpoint( | 751 NotificationProxy.fromEndpoint( |
| 726 core.MojoMessagePipeEndpoint endpoint) | 752 core.MojoMessagePipeEndpoint endpoint) |
| 727 : super(new _NotificationProxyControl.fromEndpoint(endpoint)); | 753 : super(new _NotificationProxyControl.fromEndpoint(endpoint)); |
| 728 | 754 |
| 729 NotificationProxy.fromHandle(core.MojoHandle handle) | 755 NotificationProxy.fromHandle(core.MojoHandle handle) |
| 730 : super(new _NotificationProxyControl.fromHandle(handle)); | 756 : super(new _NotificationProxyControl.fromHandle(handle)); |
| 731 | 757 |
| 732 NotificationProxy.unbound() | 758 NotificationProxy.unbound() |
| 733 : super(new _NotificationProxyControl.unbound()); | 759 : super(new _NotificationProxyControl.unbound()); |
| 734 | 760 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 760 if (!ctrl.isBound) { | 786 if (!ctrl.isBound) { |
| 761 ctrl.proxyError("The Proxy is closed."); | 787 ctrl.proxyError("The Proxy is closed."); |
| 762 return; | 788 return; |
| 763 } | 789 } |
| 764 var params = new _NotificationCancelParams(); | 790 var params = new _NotificationCancelParams(); |
| 765 ctrl.sendMessage(params, | 791 ctrl.sendMessage(params, |
| 766 _notificationMethodCancelName); | 792 _notificationMethodCancelName); |
| 767 } | 793 } |
| 768 } | 794 } |
| 769 | 795 |
| 770 | 796 class _NotificationStubControl |
| 771 class NotificationStub extends bindings.Stub { | 797 extends bindings.StubMessageHandler |
| 798 implements bindings.StubControl<Notification> { |
| 772 Notification _impl; | 799 Notification _impl; |
| 773 | 800 |
| 774 NotificationStub.fromEndpoint( | 801 _NotificationStubControl.fromEndpoint( |
| 775 core.MojoMessagePipeEndpoint endpoint, [Notification impl]) | 802 core.MojoMessagePipeEndpoint endpoint, [Notification impl]) |
| 776 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 803 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 777 _impl = impl; | 804 _impl = impl; |
| 778 } | 805 } |
| 779 | 806 |
| 780 NotificationStub.fromHandle( | 807 _NotificationStubControl.fromHandle( |
| 781 core.MojoHandle handle, [Notification impl]) | 808 core.MojoHandle handle, [Notification impl]) |
| 782 : super.fromHandle(handle, autoBegin: impl != null) { | 809 : super.fromHandle(handle, autoBegin: impl != null) { |
| 783 _impl = impl; | 810 _impl = impl; |
| 784 } | 811 } |
| 785 | 812 |
| 786 NotificationStub.unbound([this._impl]) : super.unbound(); | 813 _NotificationStubControl.unbound([this._impl]) : super.unbound(); |
| 787 | |
| 788 static NotificationStub newFromEndpoint( | |
| 789 core.MojoMessagePipeEndpoint endpoint) { | |
| 790 assert(endpoint.setDescription("For NotificationStub")); | |
| 791 return new NotificationStub.fromEndpoint(endpoint); | |
| 792 } | |
| 793 | 814 |
| 794 | 815 |
| 795 | 816 |
| 796 dynamic handleMessage(bindings.ServiceMessage message) { | 817 dynamic handleMessage(bindings.ServiceMessage message) { |
| 797 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 818 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 798 return bindings.ControlMessageHandler.handleMessage(this, | 819 return bindings.ControlMessageHandler.handleMessage(this, |
| 799 0, | 820 0, |
| 800 message); | 821 message); |
| 801 } | 822 } |
| 802 if (_impl == null) { | 823 if (_impl == null) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 830 } | 851 } |
| 831 | 852 |
| 832 @override | 853 @override |
| 833 void bind(core.MojoMessagePipeEndpoint endpoint) { | 854 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 834 super.bind(endpoint); | 855 super.bind(endpoint); |
| 835 if (!isOpen && (_impl != null)) { | 856 if (!isOpen && (_impl != null)) { |
| 836 beginHandlingEvents(); | 857 beginHandlingEvents(); |
| 837 } | 858 } |
| 838 } | 859 } |
| 839 | 860 |
| 861 @override |
| 840 String toString() { | 862 String toString() { |
| 841 var superString = super.toString(); | 863 var superString = super.toString(); |
| 842 return "NotificationStub($superString)"; | 864 return "_NotificationStubControl($superString)"; |
| 843 } | 865 } |
| 844 | 866 |
| 845 int get version => 0; | 867 int get version => 0; |
| 846 | 868 |
| 847 static service_describer.ServiceDescription _cachedServiceDescription; | 869 static service_describer.ServiceDescription _cachedServiceDescription; |
| 848 static service_describer.ServiceDescription get serviceDescription { | 870 static service_describer.ServiceDescription get serviceDescription { |
| 849 if (_cachedServiceDescription == null) { | 871 if (_cachedServiceDescription == null) { |
| 850 _cachedServiceDescription = new _NotificationServiceDescription(); | 872 _cachedServiceDescription = new _NotificationServiceDescription(); |
| 851 } | 873 } |
| 852 return _cachedServiceDescription; | 874 return _cachedServiceDescription; |
| 853 } | 875 } |
| 854 } | 876 } |
| 855 | 877 |
| 878 class NotificationStub |
| 879 extends bindings.Stub<Notification> |
| 880 implements Notification { |
| 881 NotificationStub.fromEndpoint( |
| 882 core.MojoMessagePipeEndpoint endpoint, [Notification impl]) |
| 883 : super(new _NotificationStubControl.fromEndpoint(endpoint, impl)); |
| 884 |
| 885 NotificationStub.fromHandle( |
| 886 core.MojoHandle handle, [Notification impl]) |
| 887 : super(new _NotificationStubControl.fromHandle(handle, impl)); |
| 888 |
| 889 NotificationStub.unbound([Notification impl]) |
| 890 : super(new _NotificationStubControl.unbound(impl)); |
| 891 |
| 892 static NotificationStub newFromEndpoint( |
| 893 core.MojoMessagePipeEndpoint endpoint) { |
| 894 assert(endpoint.setDescription("For NotificationStub")); |
| 895 return new NotificationStub.fromEndpoint(endpoint); |
| 896 } |
| 897 |
| 898 static service_describer.ServiceDescription get serviceDescription => |
| 899 _NotificationStubControl.serviceDescription; |
| 900 |
| 901 |
| 902 void update(NotificationData notificationData) { |
| 903 return impl.update(notificationData); |
| 904 } |
| 905 void cancel() { |
| 906 return impl.cancel(); |
| 907 } |
| 908 } |
| 909 |
| 856 const int _notificationServiceMethodPostName = 0; | 910 const int _notificationServiceMethodPostName = 0; |
| 857 | 911 |
| 858 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { | 912 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { |
| 859 dynamic getTopLevelInterface([Function responseFactory]) => | 913 dynamic getTopLevelInterface([Function responseFactory]) => |
| 860 responseFactory(null); | 914 responseFactory(null); |
| 861 | 915 |
| 862 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 916 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 863 responseFactory(null); | 917 responseFactory(null); |
| 864 | 918 |
| 865 dynamic getAllTypeDefinitions([Function responseFactory]) => | 919 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 866 responseFactory(null); | 920 responseFactory(null); |
| 867 } | 921 } |
| 868 | 922 |
| 869 abstract class NotificationService { | 923 abstract class NotificationService { |
| 870 static const String serviceName = "notifications::NotificationService"; | 924 static const String serviceName = "notifications::NotificationService"; |
| 871 void post(NotificationData notificationData, Object client, Object notificatio
n); | 925 void post(NotificationData notificationData, Object client, Object notificatio
n); |
| 872 } | 926 } |
| 873 | 927 |
| 874 | 928 class _NotificationServiceProxyControl |
| 875 class _NotificationServiceProxyControl extends bindings.ProxyMessageHandler | 929 extends bindings.ProxyMessageHandler |
| 876 implements bindings.ProxyControl { | 930 implements bindings.ProxyControl { |
| 877 _NotificationServiceProxyControl.fromEndpoint( | 931 _NotificationServiceProxyControl.fromEndpoint( |
| 878 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 932 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 879 | 933 |
| 880 _NotificationServiceProxyControl.fromHandle( | 934 _NotificationServiceProxyControl.fromHandle( |
| 881 core.MojoHandle handle) : super.fromHandle(handle); | 935 core.MojoHandle handle) : super.fromHandle(handle); |
| 882 | 936 |
| 883 _NotificationServiceProxyControl.unbound() : super.unbound(); | 937 _NotificationServiceProxyControl.unbound() : super.unbound(); |
| 884 | 938 |
| 885 service_describer.ServiceDescription get serviceDescription => | 939 service_describer.ServiceDescription get serviceDescription => |
| 886 new _NotificationServiceServiceDescription(); | 940 new _NotificationServiceServiceDescription(); |
| 887 | 941 |
| 888 String get serviceName => NotificationService.serviceName; | 942 String get serviceName => NotificationService.serviceName; |
| 889 | 943 |
| 890 @override | |
| 891 void handleResponse(bindings.ServiceMessage message) { | 944 void handleResponse(bindings.ServiceMessage message) { |
| 892 switch (message.header.type) { | 945 switch (message.header.type) { |
| 893 default: | 946 default: |
| 894 proxyError("Unexpected message type: ${message.header.type}"); | 947 proxyError("Unexpected message type: ${message.header.type}"); |
| 895 close(immediate: true); | 948 close(immediate: true); |
| 896 break; | 949 break; |
| 897 } | 950 } |
| 898 } | 951 } |
| 899 | 952 |
| 900 @override | 953 @override |
| 901 String toString() { | 954 String toString() { |
| 902 var superString = super.toString(); | 955 var superString = super.toString(); |
| 903 return "_NotificationServiceProxyControl($superString)"; | 956 return "_NotificationServiceProxyControl($superString)"; |
| 904 } | 957 } |
| 905 } | 958 } |
| 906 | 959 |
| 907 | 960 class NotificationServiceProxy |
| 908 class NotificationServiceProxy extends bindings.Proxy | 961 extends bindings.Proxy |
| 909 implements NotificationService { | 962 implements NotificationService { |
| 910 NotificationServiceProxy.fromEndpoint( | 963 NotificationServiceProxy.fromEndpoint( |
| 911 core.MojoMessagePipeEndpoint endpoint) | 964 core.MojoMessagePipeEndpoint endpoint) |
| 912 : super(new _NotificationServiceProxyControl.fromEndpoint(endpoint)); | 965 : super(new _NotificationServiceProxyControl.fromEndpoint(endpoint)); |
| 913 | 966 |
| 914 NotificationServiceProxy.fromHandle(core.MojoHandle handle) | 967 NotificationServiceProxy.fromHandle(core.MojoHandle handle) |
| 915 : super(new _NotificationServiceProxyControl.fromHandle(handle)); | 968 : super(new _NotificationServiceProxyControl.fromHandle(handle)); |
| 916 | 969 |
| 917 NotificationServiceProxy.unbound() | 970 NotificationServiceProxy.unbound() |
| 918 : super(new _NotificationServiceProxyControl.unbound()); | 971 : super(new _NotificationServiceProxyControl.unbound()); |
| 919 | 972 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 938 } | 991 } |
| 939 var params = new _NotificationServicePostParams(); | 992 var params = new _NotificationServicePostParams(); |
| 940 params.notificationData = notificationData; | 993 params.notificationData = notificationData; |
| 941 params.client = client; | 994 params.client = client; |
| 942 params.notification = notification; | 995 params.notification = notification; |
| 943 ctrl.sendMessage(params, | 996 ctrl.sendMessage(params, |
| 944 _notificationServiceMethodPostName); | 997 _notificationServiceMethodPostName); |
| 945 } | 998 } |
| 946 } | 999 } |
| 947 | 1000 |
| 948 | 1001 class _NotificationServiceStubControl |
| 949 class NotificationServiceStub extends bindings.Stub { | 1002 extends bindings.StubMessageHandler |
| 1003 implements bindings.StubControl<NotificationService> { |
| 950 NotificationService _impl; | 1004 NotificationService _impl; |
| 951 | 1005 |
| 952 NotificationServiceStub.fromEndpoint( | 1006 _NotificationServiceStubControl.fromEndpoint( |
| 953 core.MojoMessagePipeEndpoint endpoint, [NotificationService impl]) | 1007 core.MojoMessagePipeEndpoint endpoint, [NotificationService impl]) |
| 954 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1008 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 955 _impl = impl; | 1009 _impl = impl; |
| 956 } | 1010 } |
| 957 | 1011 |
| 958 NotificationServiceStub.fromHandle( | 1012 _NotificationServiceStubControl.fromHandle( |
| 959 core.MojoHandle handle, [NotificationService impl]) | 1013 core.MojoHandle handle, [NotificationService impl]) |
| 960 : super.fromHandle(handle, autoBegin: impl != null) { | 1014 : super.fromHandle(handle, autoBegin: impl != null) { |
| 961 _impl = impl; | 1015 _impl = impl; |
| 962 } | 1016 } |
| 963 | 1017 |
| 964 NotificationServiceStub.unbound([this._impl]) : super.unbound(); | 1018 _NotificationServiceStubControl.unbound([this._impl]) : super.unbound(); |
| 965 | |
| 966 static NotificationServiceStub newFromEndpoint( | |
| 967 core.MojoMessagePipeEndpoint endpoint) { | |
| 968 assert(endpoint.setDescription("For NotificationServiceStub")); | |
| 969 return new NotificationServiceStub.fromEndpoint(endpoint); | |
| 970 } | |
| 971 | 1019 |
| 972 | 1020 |
| 973 | 1021 |
| 974 dynamic handleMessage(bindings.ServiceMessage message) { | 1022 dynamic handleMessage(bindings.ServiceMessage message) { |
| 975 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1023 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 976 return bindings.ControlMessageHandler.handleMessage(this, | 1024 return bindings.ControlMessageHandler.handleMessage(this, |
| 977 0, | 1025 0, |
| 978 message); | 1026 message); |
| 979 } | 1027 } |
| 980 if (_impl == null) { | 1028 if (_impl == null) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1005 } | 1053 } |
| 1006 | 1054 |
| 1007 @override | 1055 @override |
| 1008 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1056 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 1009 super.bind(endpoint); | 1057 super.bind(endpoint); |
| 1010 if (!isOpen && (_impl != null)) { | 1058 if (!isOpen && (_impl != null)) { |
| 1011 beginHandlingEvents(); | 1059 beginHandlingEvents(); |
| 1012 } | 1060 } |
| 1013 } | 1061 } |
| 1014 | 1062 |
| 1063 @override |
| 1015 String toString() { | 1064 String toString() { |
| 1016 var superString = super.toString(); | 1065 var superString = super.toString(); |
| 1017 return "NotificationServiceStub($superString)"; | 1066 return "_NotificationServiceStubControl($superString)"; |
| 1018 } | 1067 } |
| 1019 | 1068 |
| 1020 int get version => 0; | 1069 int get version => 0; |
| 1021 | 1070 |
| 1022 static service_describer.ServiceDescription _cachedServiceDescription; | 1071 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1023 static service_describer.ServiceDescription get serviceDescription { | 1072 static service_describer.ServiceDescription get serviceDescription { |
| 1024 if (_cachedServiceDescription == null) { | 1073 if (_cachedServiceDescription == null) { |
| 1025 _cachedServiceDescription = new _NotificationServiceServiceDescription(); | 1074 _cachedServiceDescription = new _NotificationServiceServiceDescription(); |
| 1026 } | 1075 } |
| 1027 return _cachedServiceDescription; | 1076 return _cachedServiceDescription; |
| 1028 } | 1077 } |
| 1029 } | 1078 } |
| 1030 | 1079 |
| 1080 class NotificationServiceStub |
| 1081 extends bindings.Stub<NotificationService> |
| 1082 implements NotificationService { |
| 1083 NotificationServiceStub.fromEndpoint( |
| 1084 core.MojoMessagePipeEndpoint endpoint, [NotificationService impl]) |
| 1085 : super(new _NotificationServiceStubControl.fromEndpoint(endpoint, impl)); |
| 1086 |
| 1087 NotificationServiceStub.fromHandle( |
| 1088 core.MojoHandle handle, [NotificationService impl]) |
| 1089 : super(new _NotificationServiceStubControl.fromHandle(handle, impl)); |
| 1090 |
| 1091 NotificationServiceStub.unbound([NotificationService impl]) |
| 1092 : super(new _NotificationServiceStubControl.unbound(impl)); |
| 1093 |
| 1094 static NotificationServiceStub newFromEndpoint( |
| 1095 core.MojoMessagePipeEndpoint endpoint) { |
| 1096 assert(endpoint.setDescription("For NotificationServiceStub")); |
| 1097 return new NotificationServiceStub.fromEndpoint(endpoint); |
| 1098 } |
| 1099 |
| 1100 static service_describer.ServiceDescription get serviceDescription => |
| 1101 _NotificationServiceStubControl.serviceDescription; |
| 1102 |
| 1103 |
| 1104 void post(NotificationData notificationData, Object client, Object notificatio
n) { |
| 1105 return impl.post(notificationData, client, notification); |
| 1106 } |
| 1107 } |
| 1108 |
| 1031 | 1109 |
| 1032 | 1110 |
| OLD | NEW |