| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 506 class _NotificationClientProxyImpl extends bindings.Proxy { | 506 class _NotificationClientProxyControl extends bindings.ProxyMessageHandler |
| 507 _NotificationClientProxyImpl.fromEndpoint( | 507 implements bindings.ProxyControl { |
| 508 _NotificationClientProxyControl.fromEndpoint( |
| 508 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 509 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 509 | 510 |
| 510 _NotificationClientProxyImpl.fromHandle(core.MojoHandle handle) : | 511 _NotificationClientProxyControl.fromHandle( |
| 511 super.fromHandle(handle); | 512 core.MojoHandle handle) : super.fromHandle(handle); |
| 512 | 513 |
| 513 _NotificationClientProxyImpl.unbound() : super.unbound(); | 514 _NotificationClientProxyControl.unbound() : super.unbound(); |
| 514 | |
| 515 static _NotificationClientProxyImpl newFromEndpoint( | |
| 516 core.MojoMessagePipeEndpoint endpoint) { | |
| 517 assert(endpoint.setDescription("For _NotificationClientProxyImpl")); | |
| 518 return new _NotificationClientProxyImpl.fromEndpoint(endpoint); | |
| 519 } | |
| 520 | 515 |
| 521 service_describer.ServiceDescription get serviceDescription => | 516 service_describer.ServiceDescription get serviceDescription => |
| 522 new _NotificationClientServiceDescription(); | 517 new _NotificationClientServiceDescription(); |
| 523 | 518 |
| 519 String get serviceName => NotificationClient.serviceName; |
| 520 |
| 521 @override |
| 524 void handleResponse(bindings.ServiceMessage message) { | 522 void handleResponse(bindings.ServiceMessage message) { |
| 525 switch (message.header.type) { | 523 switch (message.header.type) { |
| 526 default: | 524 default: |
| 527 proxyError("Unexpected message type: ${message.header.type}"); | 525 proxyError("Unexpected message type: ${message.header.type}"); |
| 528 close(immediate: true); | 526 close(immediate: true); |
| 529 break; | 527 break; |
| 530 } | 528 } |
| 531 } | 529 } |
| 532 | 530 |
| 531 @override |
| 533 String toString() { | 532 String toString() { |
| 534 var superString = super.toString(); | 533 var superString = super.toString(); |
| 535 return "_NotificationClientProxyImpl($superString)"; | 534 return "_NotificationClientProxyControl($superString)"; |
| 536 } | 535 } |
| 537 } | 536 } |
| 538 | 537 |
| 539 | 538 |
| 540 class _NotificationClientProxyCalls implements NotificationClient { | 539 class NotificationClientProxy extends bindings.Proxy |
| 541 _NotificationClientProxyImpl _proxyImpl; | 540 implements NotificationClient { |
| 541 NotificationClientProxy.fromEndpoint( |
| 542 core.MojoMessagePipeEndpoint endpoint) |
| 543 : super(new _NotificationClientProxyControl.fromEndpoint(endpoint)); |
| 542 | 544 |
| 543 _NotificationClientProxyCalls(this._proxyImpl); | 545 NotificationClientProxy.fromHandle(core.MojoHandle handle) |
| 544 void onSelected() { | 546 : super(new _NotificationClientProxyControl.fromHandle(handle)); |
| 545 if (!_proxyImpl.isBound) { | |
| 546 _proxyImpl.proxyError("The Proxy is closed."); | |
| 547 return; | |
| 548 } | |
| 549 var params = new _NotificationClientOnSelectedParams(); | |
| 550 _proxyImpl.sendMessage(params, _notificationClientMethodOnSelectedName); | |
| 551 } | |
| 552 void onDismissed() { | |
| 553 if (!_proxyImpl.isBound) { | |
| 554 _proxyImpl.proxyError("The Proxy is closed."); | |
| 555 return; | |
| 556 } | |
| 557 var params = new _NotificationClientOnDismissedParams(); | |
| 558 _proxyImpl.sendMessage(params, _notificationClientMethodOnDismissedName); | |
| 559 } | |
| 560 } | |
| 561 | 547 |
| 548 NotificationClientProxy.unbound() |
| 549 : super(new _NotificationClientProxyControl.unbound()); |
| 562 | 550 |
| 563 class NotificationClientProxy implements bindings.ProxyBase { | 551 static NotificationClientProxy newFromEndpoint( |
| 564 final bindings.Proxy impl; | 552 core.MojoMessagePipeEndpoint endpoint) { |
| 565 NotificationClient ptr; | 553 assert(endpoint.setDescription("For NotificationClientProxy")); |
| 566 | 554 return new NotificationClientProxy.fromEndpoint(endpoint); |
| 567 NotificationClientProxy(_NotificationClientProxyImpl proxyImpl) : | |
| 568 impl = proxyImpl, | |
| 569 ptr = new _NotificationClientProxyCalls(proxyImpl); | |
| 570 | |
| 571 NotificationClientProxy.fromEndpoint( | |
| 572 core.MojoMessagePipeEndpoint endpoint) : | |
| 573 impl = new _NotificationClientProxyImpl.fromEndpoint(endpoint) { | |
| 574 ptr = new _NotificationClientProxyCalls(impl); | |
| 575 } | |
| 576 | |
| 577 NotificationClientProxy.fromHandle(core.MojoHandle handle) : | |
| 578 impl = new _NotificationClientProxyImpl.fromHandle(handle) { | |
| 579 ptr = new _NotificationClientProxyCalls(impl); | |
| 580 } | |
| 581 | |
| 582 NotificationClientProxy.unbound() : | |
| 583 impl = new _NotificationClientProxyImpl.unbound() { | |
| 584 ptr = new _NotificationClientProxyCalls(impl); | |
| 585 } | 555 } |
| 586 | 556 |
| 587 factory NotificationClientProxy.connectToService( | 557 factory NotificationClientProxy.connectToService( |
| 588 bindings.ServiceConnector s, String url, [String serviceName]) { | 558 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 589 NotificationClientProxy p = new NotificationClientProxy.unbound(); | 559 NotificationClientProxy p = new NotificationClientProxy.unbound(); |
| 590 s.connectToService(url, p, serviceName); | 560 s.connectToService(url, p, serviceName); |
| 591 return p; | 561 return p; |
| 592 } | 562 } |
| 593 | 563 |
| 594 static NotificationClientProxy newFromEndpoint( | 564 |
| 595 core.MojoMessagePipeEndpoint endpoint) { | 565 void onSelected() { |
| 596 assert(endpoint.setDescription("For NotificationClientProxy")); | 566 if (!ctrl.isBound) { |
| 597 return new NotificationClientProxy.fromEndpoint(endpoint); | 567 ctrl.proxyError("The Proxy is closed."); |
| 568 return; |
| 569 } |
| 570 var params = new _NotificationClientOnSelectedParams(); |
| 571 ctrl.sendMessage(params, |
| 572 _notificationClientMethodOnSelectedName); |
| 598 } | 573 } |
| 599 | 574 void onDismissed() { |
| 600 String get serviceName => NotificationClient.serviceName; | 575 if (!ctrl.isBound) { |
| 601 | 576 ctrl.proxyError("The Proxy is closed."); |
| 602 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 577 return; |
| 603 | 578 } |
| 604 Future responseOrError(Future f) => impl.responseOrError(f); | 579 var params = new _NotificationClientOnDismissedParams(); |
| 605 | 580 ctrl.sendMessage(params, |
| 606 Future get errorFuture => impl.errorFuture; | 581 _notificationClientMethodOnDismissedName); |
| 607 | |
| 608 int get version => impl.version; | |
| 609 | |
| 610 Future<int> queryVersion() => impl.queryVersion(); | |
| 611 | |
| 612 void requireVersion(int requiredVersion) { | |
| 613 impl.requireVersion(requiredVersion); | |
| 614 } | |
| 615 | |
| 616 String toString() { | |
| 617 return "NotificationClientProxy($impl)"; | |
| 618 } | 582 } |
| 619 } | 583 } |
| 620 | 584 |
| 621 | 585 |
| 622 class NotificationClientStub extends bindings.Stub { | 586 class NotificationClientStub extends bindings.Stub { |
| 623 NotificationClient _impl; | 587 NotificationClient _impl; |
| 624 | 588 |
| 625 NotificationClientStub.fromEndpoint( | 589 NotificationClientStub.fromEndpoint( |
| 626 core.MojoMessagePipeEndpoint endpoint, [NotificationClient impl]) | 590 core.MojoMessagePipeEndpoint endpoint, [NotificationClient impl]) |
| 627 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 591 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 responseFactory(null); | 680 responseFactory(null); |
| 717 } | 681 } |
| 718 | 682 |
| 719 abstract class Notification { | 683 abstract class Notification { |
| 720 static const String serviceName = null; | 684 static const String serviceName = null; |
| 721 void update(NotificationData notificationData); | 685 void update(NotificationData notificationData); |
| 722 void cancel(); | 686 void cancel(); |
| 723 } | 687 } |
| 724 | 688 |
| 725 | 689 |
| 726 class _NotificationProxyImpl extends bindings.Proxy { | 690 class _NotificationProxyControl extends bindings.ProxyMessageHandler |
| 727 _NotificationProxyImpl.fromEndpoint( | 691 implements bindings.ProxyControl { |
| 692 _NotificationProxyControl.fromEndpoint( |
| 728 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 693 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 729 | 694 |
| 730 _NotificationProxyImpl.fromHandle(core.MojoHandle handle) : | 695 _NotificationProxyControl.fromHandle( |
| 731 super.fromHandle(handle); | 696 core.MojoHandle handle) : super.fromHandle(handle); |
| 732 | 697 |
| 733 _NotificationProxyImpl.unbound() : super.unbound(); | 698 _NotificationProxyControl.unbound() : super.unbound(); |
| 734 | |
| 735 static _NotificationProxyImpl newFromEndpoint( | |
| 736 core.MojoMessagePipeEndpoint endpoint) { | |
| 737 assert(endpoint.setDescription("For _NotificationProxyImpl")); | |
| 738 return new _NotificationProxyImpl.fromEndpoint(endpoint); | |
| 739 } | |
| 740 | 699 |
| 741 service_describer.ServiceDescription get serviceDescription => | 700 service_describer.ServiceDescription get serviceDescription => |
| 742 new _NotificationServiceDescription(); | 701 new _NotificationServiceDescription(); |
| 743 | 702 |
| 703 String get serviceName => Notification.serviceName; |
| 704 |
| 705 @override |
| 744 void handleResponse(bindings.ServiceMessage message) { | 706 void handleResponse(bindings.ServiceMessage message) { |
| 745 switch (message.header.type) { | 707 switch (message.header.type) { |
| 746 default: | 708 default: |
| 747 proxyError("Unexpected message type: ${message.header.type}"); | 709 proxyError("Unexpected message type: ${message.header.type}"); |
| 748 close(immediate: true); | 710 close(immediate: true); |
| 749 break; | 711 break; |
| 750 } | 712 } |
| 751 } | 713 } |
| 752 | 714 |
| 715 @override |
| 753 String toString() { | 716 String toString() { |
| 754 var superString = super.toString(); | 717 var superString = super.toString(); |
| 755 return "_NotificationProxyImpl($superString)"; | 718 return "_NotificationProxyControl($superString)"; |
| 756 } | 719 } |
| 757 } | 720 } |
| 758 | 721 |
| 759 | 722 |
| 760 class _NotificationProxyCalls implements Notification { | 723 class NotificationProxy extends bindings.Proxy |
| 761 _NotificationProxyImpl _proxyImpl; | 724 implements Notification { |
| 725 NotificationProxy.fromEndpoint( |
| 726 core.MojoMessagePipeEndpoint endpoint) |
| 727 : super(new _NotificationProxyControl.fromEndpoint(endpoint)); |
| 762 | 728 |
| 763 _NotificationProxyCalls(this._proxyImpl); | 729 NotificationProxy.fromHandle(core.MojoHandle handle) |
| 764 void update(NotificationData notificationData) { | 730 : super(new _NotificationProxyControl.fromHandle(handle)); |
| 765 if (!_proxyImpl.isBound) { | |
| 766 _proxyImpl.proxyError("The Proxy is closed."); | |
| 767 return; | |
| 768 } | |
| 769 var params = new _NotificationUpdateParams(); | |
| 770 params.notificationData = notificationData; | |
| 771 _proxyImpl.sendMessage(params, _notificationMethodUpdateName); | |
| 772 } | |
| 773 void cancel() { | |
| 774 if (!_proxyImpl.isBound) { | |
| 775 _proxyImpl.proxyError("The Proxy is closed."); | |
| 776 return; | |
| 777 } | |
| 778 var params = new _NotificationCancelParams(); | |
| 779 _proxyImpl.sendMessage(params, _notificationMethodCancelName); | |
| 780 } | |
| 781 } | |
| 782 | 731 |
| 732 NotificationProxy.unbound() |
| 733 : super(new _NotificationProxyControl.unbound()); |
| 783 | 734 |
| 784 class NotificationProxy implements bindings.ProxyBase { | 735 static NotificationProxy newFromEndpoint( |
| 785 final bindings.Proxy impl; | 736 core.MojoMessagePipeEndpoint endpoint) { |
| 786 Notification ptr; | 737 assert(endpoint.setDescription("For NotificationProxy")); |
| 787 | 738 return new NotificationProxy.fromEndpoint(endpoint); |
| 788 NotificationProxy(_NotificationProxyImpl proxyImpl) : | |
| 789 impl = proxyImpl, | |
| 790 ptr = new _NotificationProxyCalls(proxyImpl); | |
| 791 | |
| 792 NotificationProxy.fromEndpoint( | |
| 793 core.MojoMessagePipeEndpoint endpoint) : | |
| 794 impl = new _NotificationProxyImpl.fromEndpoint(endpoint) { | |
| 795 ptr = new _NotificationProxyCalls(impl); | |
| 796 } | |
| 797 | |
| 798 NotificationProxy.fromHandle(core.MojoHandle handle) : | |
| 799 impl = new _NotificationProxyImpl.fromHandle(handle) { | |
| 800 ptr = new _NotificationProxyCalls(impl); | |
| 801 } | |
| 802 | |
| 803 NotificationProxy.unbound() : | |
| 804 impl = new _NotificationProxyImpl.unbound() { | |
| 805 ptr = new _NotificationProxyCalls(impl); | |
| 806 } | 739 } |
| 807 | 740 |
| 808 factory NotificationProxy.connectToService( | 741 factory NotificationProxy.connectToService( |
| 809 bindings.ServiceConnector s, String url, [String serviceName]) { | 742 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 810 NotificationProxy p = new NotificationProxy.unbound(); | 743 NotificationProxy p = new NotificationProxy.unbound(); |
| 811 s.connectToService(url, p, serviceName); | 744 s.connectToService(url, p, serviceName); |
| 812 return p; | 745 return p; |
| 813 } | 746 } |
| 814 | 747 |
| 815 static NotificationProxy newFromEndpoint( | 748 |
| 816 core.MojoMessagePipeEndpoint endpoint) { | 749 void update(NotificationData notificationData) { |
| 817 assert(endpoint.setDescription("For NotificationProxy")); | 750 if (!ctrl.isBound) { |
| 818 return new NotificationProxy.fromEndpoint(endpoint); | 751 ctrl.proxyError("The Proxy is closed."); |
| 752 return; |
| 753 } |
| 754 var params = new _NotificationUpdateParams(); |
| 755 params.notificationData = notificationData; |
| 756 ctrl.sendMessage(params, |
| 757 _notificationMethodUpdateName); |
| 819 } | 758 } |
| 820 | 759 void cancel() { |
| 821 String get serviceName => Notification.serviceName; | 760 if (!ctrl.isBound) { |
| 822 | 761 ctrl.proxyError("The Proxy is closed."); |
| 823 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 762 return; |
| 824 | 763 } |
| 825 Future responseOrError(Future f) => impl.responseOrError(f); | 764 var params = new _NotificationCancelParams(); |
| 826 | 765 ctrl.sendMessage(params, |
| 827 Future get errorFuture => impl.errorFuture; | 766 _notificationMethodCancelName); |
| 828 | |
| 829 int get version => impl.version; | |
| 830 | |
| 831 Future<int> queryVersion() => impl.queryVersion(); | |
| 832 | |
| 833 void requireVersion(int requiredVersion) { | |
| 834 impl.requireVersion(requiredVersion); | |
| 835 } | |
| 836 | |
| 837 String toString() { | |
| 838 return "NotificationProxy($impl)"; | |
| 839 } | 767 } |
| 840 } | 768 } |
| 841 | 769 |
| 842 | 770 |
| 843 class NotificationStub extends bindings.Stub { | 771 class NotificationStub extends bindings.Stub { |
| 844 Notification _impl; | 772 Notification _impl; |
| 845 | 773 |
| 846 NotificationStub.fromEndpoint( | 774 NotificationStub.fromEndpoint( |
| 847 core.MojoMessagePipeEndpoint endpoint, [Notification impl]) | 775 core.MojoMessagePipeEndpoint endpoint, [Notification impl]) |
| 848 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 776 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 dynamic getAllTypeDefinitions([Function responseFactory]) => | 865 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 938 responseFactory(null); | 866 responseFactory(null); |
| 939 } | 867 } |
| 940 | 868 |
| 941 abstract class NotificationService { | 869 abstract class NotificationService { |
| 942 static const String serviceName = "notifications::NotificationService"; | 870 static const String serviceName = "notifications::NotificationService"; |
| 943 void post(NotificationData notificationData, Object client, Object notificatio
n); | 871 void post(NotificationData notificationData, Object client, Object notificatio
n); |
| 944 } | 872 } |
| 945 | 873 |
| 946 | 874 |
| 947 class _NotificationServiceProxyImpl extends bindings.Proxy { | 875 class _NotificationServiceProxyControl extends bindings.ProxyMessageHandler |
| 948 _NotificationServiceProxyImpl.fromEndpoint( | 876 implements bindings.ProxyControl { |
| 877 _NotificationServiceProxyControl.fromEndpoint( |
| 949 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 878 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 950 | 879 |
| 951 _NotificationServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 880 _NotificationServiceProxyControl.fromHandle( |
| 952 super.fromHandle(handle); | 881 core.MojoHandle handle) : super.fromHandle(handle); |
| 953 | 882 |
| 954 _NotificationServiceProxyImpl.unbound() : super.unbound(); | 883 _NotificationServiceProxyControl.unbound() : super.unbound(); |
| 955 | |
| 956 static _NotificationServiceProxyImpl newFromEndpoint( | |
| 957 core.MojoMessagePipeEndpoint endpoint) { | |
| 958 assert(endpoint.setDescription("For _NotificationServiceProxyImpl")); | |
| 959 return new _NotificationServiceProxyImpl.fromEndpoint(endpoint); | |
| 960 } | |
| 961 | 884 |
| 962 service_describer.ServiceDescription get serviceDescription => | 885 service_describer.ServiceDescription get serviceDescription => |
| 963 new _NotificationServiceServiceDescription(); | 886 new _NotificationServiceServiceDescription(); |
| 964 | 887 |
| 888 String get serviceName => NotificationService.serviceName; |
| 889 |
| 890 @override |
| 965 void handleResponse(bindings.ServiceMessage message) { | 891 void handleResponse(bindings.ServiceMessage message) { |
| 966 switch (message.header.type) { | 892 switch (message.header.type) { |
| 967 default: | 893 default: |
| 968 proxyError("Unexpected message type: ${message.header.type}"); | 894 proxyError("Unexpected message type: ${message.header.type}"); |
| 969 close(immediate: true); | 895 close(immediate: true); |
| 970 break; | 896 break; |
| 971 } | 897 } |
| 972 } | 898 } |
| 973 | 899 |
| 900 @override |
| 974 String toString() { | 901 String toString() { |
| 975 var superString = super.toString(); | 902 var superString = super.toString(); |
| 976 return "_NotificationServiceProxyImpl($superString)"; | 903 return "_NotificationServiceProxyControl($superString)"; |
| 977 } | 904 } |
| 978 } | 905 } |
| 979 | 906 |
| 980 | 907 |
| 981 class _NotificationServiceProxyCalls implements NotificationService { | 908 class NotificationServiceProxy extends bindings.Proxy |
| 982 _NotificationServiceProxyImpl _proxyImpl; | 909 implements NotificationService { |
| 910 NotificationServiceProxy.fromEndpoint( |
| 911 core.MojoMessagePipeEndpoint endpoint) |
| 912 : super(new _NotificationServiceProxyControl.fromEndpoint(endpoint)); |
| 983 | 913 |
| 984 _NotificationServiceProxyCalls(this._proxyImpl); | 914 NotificationServiceProxy.fromHandle(core.MojoHandle handle) |
| 985 void post(NotificationData notificationData, Object client, Object notificat
ion) { | 915 : super(new _NotificationServiceProxyControl.fromHandle(handle)); |
| 986 if (!_proxyImpl.isBound) { | |
| 987 _proxyImpl.proxyError("The Proxy is closed."); | |
| 988 return; | |
| 989 } | |
| 990 var params = new _NotificationServicePostParams(); | |
| 991 params.notificationData = notificationData; | |
| 992 params.client = client; | |
| 993 params.notification = notification; | |
| 994 _proxyImpl.sendMessage(params, _notificationServiceMethodPostName); | |
| 995 } | |
| 996 } | |
| 997 | 916 |
| 917 NotificationServiceProxy.unbound() |
| 918 : super(new _NotificationServiceProxyControl.unbound()); |
| 998 | 919 |
| 999 class NotificationServiceProxy implements bindings.ProxyBase { | 920 static NotificationServiceProxy newFromEndpoint( |
| 1000 final bindings.Proxy impl; | 921 core.MojoMessagePipeEndpoint endpoint) { |
| 1001 NotificationService ptr; | 922 assert(endpoint.setDescription("For NotificationServiceProxy")); |
| 1002 | 923 return new NotificationServiceProxy.fromEndpoint(endpoint); |
| 1003 NotificationServiceProxy(_NotificationServiceProxyImpl proxyImpl) : | |
| 1004 impl = proxyImpl, | |
| 1005 ptr = new _NotificationServiceProxyCalls(proxyImpl); | |
| 1006 | |
| 1007 NotificationServiceProxy.fromEndpoint( | |
| 1008 core.MojoMessagePipeEndpoint endpoint) : | |
| 1009 impl = new _NotificationServiceProxyImpl.fromEndpoint(endpoint) { | |
| 1010 ptr = new _NotificationServiceProxyCalls(impl); | |
| 1011 } | |
| 1012 | |
| 1013 NotificationServiceProxy.fromHandle(core.MojoHandle handle) : | |
| 1014 impl = new _NotificationServiceProxyImpl.fromHandle(handle) { | |
| 1015 ptr = new _NotificationServiceProxyCalls(impl); | |
| 1016 } | |
| 1017 | |
| 1018 NotificationServiceProxy.unbound() : | |
| 1019 impl = new _NotificationServiceProxyImpl.unbound() { | |
| 1020 ptr = new _NotificationServiceProxyCalls(impl); | |
| 1021 } | 924 } |
| 1022 | 925 |
| 1023 factory NotificationServiceProxy.connectToService( | 926 factory NotificationServiceProxy.connectToService( |
| 1024 bindings.ServiceConnector s, String url, [String serviceName]) { | 927 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 1025 NotificationServiceProxy p = new NotificationServiceProxy.unbound(); | 928 NotificationServiceProxy p = new NotificationServiceProxy.unbound(); |
| 1026 s.connectToService(url, p, serviceName); | 929 s.connectToService(url, p, serviceName); |
| 1027 return p; | 930 return p; |
| 1028 } | 931 } |
| 1029 | 932 |
| 1030 static NotificationServiceProxy newFromEndpoint( | |
| 1031 core.MojoMessagePipeEndpoint endpoint) { | |
| 1032 assert(endpoint.setDescription("For NotificationServiceProxy")); | |
| 1033 return new NotificationServiceProxy.fromEndpoint(endpoint); | |
| 1034 } | |
| 1035 | 933 |
| 1036 String get serviceName => NotificationService.serviceName; | 934 void post(NotificationData notificationData, Object client, Object notificatio
n) { |
| 1037 | 935 if (!ctrl.isBound) { |
| 1038 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 936 ctrl.proxyError("The Proxy is closed."); |
| 1039 | 937 return; |
| 1040 Future responseOrError(Future f) => impl.responseOrError(f); | 938 } |
| 1041 | 939 var params = new _NotificationServicePostParams(); |
| 1042 Future get errorFuture => impl.errorFuture; | 940 params.notificationData = notificationData; |
| 1043 | 941 params.client = client; |
| 1044 int get version => impl.version; | 942 params.notification = notification; |
| 1045 | 943 ctrl.sendMessage(params, |
| 1046 Future<int> queryVersion() => impl.queryVersion(); | 944 _notificationServiceMethodPostName); |
| 1047 | |
| 1048 void requireVersion(int requiredVersion) { | |
| 1049 impl.requireVersion(requiredVersion); | |
| 1050 } | |
| 1051 | |
| 1052 String toString() { | |
| 1053 return "NotificationServiceProxy($impl)"; | |
| 1054 } | 945 } |
| 1055 } | 946 } |
| 1056 | 947 |
| 1057 | 948 |
| 1058 class NotificationServiceStub extends bindings.Stub { | 949 class NotificationServiceStub extends bindings.Stub { |
| 1059 NotificationService _impl; | 950 NotificationService _impl; |
| 1060 | 951 |
| 1061 NotificationServiceStub.fromEndpoint( | 952 NotificationServiceStub.fromEndpoint( |
| 1062 core.MojoMessagePipeEndpoint endpoint, [NotificationService impl]) | 953 core.MojoMessagePipeEndpoint endpoint, [NotificationService impl]) |
| 1063 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 954 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 static service_describer.ServiceDescription get serviceDescription { | 1023 static service_describer.ServiceDescription get serviceDescription { |
| 1133 if (_cachedServiceDescription == null) { | 1024 if (_cachedServiceDescription == null) { |
| 1134 _cachedServiceDescription = new _NotificationServiceServiceDescription(); | 1025 _cachedServiceDescription = new _NotificationServiceServiceDescription(); |
| 1135 } | 1026 } |
| 1136 return _cachedServiceDescription; | 1027 return _cachedServiceDescription; |
| 1137 } | 1028 } |
| 1138 } | 1029 } |
| 1139 | 1030 |
| 1140 | 1031 |
| 1141 | 1032 |
| OLD | NEW |