| 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 sensors_mojom; | 5 library sensors_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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return map; | 424 return map; |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 | 427 |
| 428 | 428 |
| 429 class _SensorServiceAddListenerParams extends bindings.Struct { | 429 class _SensorServiceAddListenerParams extends bindings.Struct { |
| 430 static const List<bindings.StructDataHeader> kVersions = const [ | 430 static const List<bindings.StructDataHeader> kVersions = const [ |
| 431 const bindings.StructDataHeader(24, 0) | 431 const bindings.StructDataHeader(24, 0) |
| 432 ]; | 432 ]; |
| 433 SensorType type = null; | 433 SensorType type = null; |
| 434 Object listener = null; | 434 SensorListenerInterface listener = null; |
| 435 | 435 |
| 436 _SensorServiceAddListenerParams() : super(kVersions.last.size); | 436 _SensorServiceAddListenerParams() : super(kVersions.last.size); |
| 437 | 437 |
| 438 static _SensorServiceAddListenerParams deserialize(bindings.Message message) { | 438 static _SensorServiceAddListenerParams deserialize(bindings.Message message) { |
| 439 var decoder = new bindings.Decoder(message); | 439 var decoder = new bindings.Decoder(message); |
| 440 var result = decode(decoder); | 440 var result = decode(decoder); |
| 441 if (decoder.excessHandles != null) { | 441 if (decoder.excessHandles != null) { |
| 442 decoder.excessHandles.forEach((h) => h.close()); | 442 decoder.excessHandles.forEach((h) => h.close()); |
| 443 } | 443 } |
| 444 return result; | 444 return result; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 522 |
| 523 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 523 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 524 responseFactory(null); | 524 responseFactory(null); |
| 525 | 525 |
| 526 dynamic getAllTypeDefinitions([Function responseFactory]) => | 526 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 527 responseFactory(null); | 527 responseFactory(null); |
| 528 } | 528 } |
| 529 | 529 |
| 530 abstract class SensorListener { | 530 abstract class SensorListener { |
| 531 static const String serviceName = null; | 531 static const String serviceName = null; |
| 532 |
| 533 static service_describer.ServiceDescription _cachedServiceDescription; |
| 534 static service_describer.ServiceDescription get serviceDescription { |
| 535 if (_cachedServiceDescription == null) { |
| 536 _cachedServiceDescription = new _SensorListenerServiceDescription(); |
| 537 } |
| 538 return _cachedServiceDescription; |
| 539 } |
| 540 |
| 541 static SensorListenerProxy connectToService( |
| 542 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 543 SensorListenerProxy p = new SensorListenerProxy.unbound(); |
| 544 String name = serviceName ?? SensorListener.serviceName; |
| 545 if ((name == null) || name.isEmpty) { |
| 546 throw new core.MojoApiError( |
| 547 "If an interface has no ServiceName, then one must be provided."); |
| 548 } |
| 549 s.connectToService(url, p, name); |
| 550 return p; |
| 551 } |
| 532 void onAccuracyChanged(int accuracy); | 552 void onAccuracyChanged(int accuracy); |
| 533 void onSensorChanged(SensorData data); | 553 void onSensorChanged(SensorData data); |
| 534 } | 554 } |
| 535 | 555 |
| 556 abstract class SensorListenerInterface |
| 557 implements bindings.MojoInterface<SensorListener>, |
| 558 SensorListener { |
| 559 factory SensorListenerInterface([SensorListener impl]) => |
| 560 new SensorListenerStub.unbound(impl); |
| 561 factory SensorListenerInterface.fromEndpoint( |
| 562 core.MojoMessagePipeEndpoint endpoint, |
| 563 [SensorListener impl]) => |
| 564 new SensorListenerStub.fromEndpoint(endpoint, impl); |
| 565 } |
| 566 |
| 567 abstract class SensorListenerInterfaceRequest |
| 568 implements bindings.MojoInterface<SensorListener>, |
| 569 SensorListener { |
| 570 factory SensorListenerInterfaceRequest() => |
| 571 new SensorListenerProxy.unbound(); |
| 572 } |
| 573 |
| 536 class _SensorListenerProxyControl | 574 class _SensorListenerProxyControl |
| 537 extends bindings.ProxyMessageHandler | 575 extends bindings.ProxyMessageHandler |
| 538 implements bindings.ProxyControl { | 576 implements bindings.ProxyControl<SensorListener> { |
| 539 _SensorListenerProxyControl.fromEndpoint( | 577 _SensorListenerProxyControl.fromEndpoint( |
| 540 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 578 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 541 | 579 |
| 542 _SensorListenerProxyControl.fromHandle( | 580 _SensorListenerProxyControl.fromHandle( |
| 543 core.MojoHandle handle) : super.fromHandle(handle); | 581 core.MojoHandle handle) : super.fromHandle(handle); |
| 544 | 582 |
| 545 _SensorListenerProxyControl.unbound() : super.unbound(); | 583 _SensorListenerProxyControl.unbound() : super.unbound(); |
| 546 | 584 |
| 547 service_describer.ServiceDescription get serviceDescription => | |
| 548 new _SensorListenerServiceDescription(); | |
| 549 | |
| 550 String get serviceName => SensorListener.serviceName; | 585 String get serviceName => SensorListener.serviceName; |
| 551 | 586 |
| 552 void handleResponse(bindings.ServiceMessage message) { | 587 void handleResponse(bindings.ServiceMessage message) { |
| 553 switch (message.header.type) { | 588 switch (message.header.type) { |
| 554 default: | 589 default: |
| 555 proxyError("Unexpected message type: ${message.header.type}"); | 590 proxyError("Unexpected message type: ${message.header.type}"); |
| 556 close(immediate: true); | 591 close(immediate: true); |
| 557 break; | 592 break; |
| 558 } | 593 } |
| 559 } | 594 } |
| 560 | 595 |
| 596 SensorListener get impl => null; |
| 597 set impl(SensorListener _) { |
| 598 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 599 } |
| 600 |
| 561 @override | 601 @override |
| 562 String toString() { | 602 String toString() { |
| 563 var superString = super.toString(); | 603 var superString = super.toString(); |
| 564 return "_SensorListenerProxyControl($superString)"; | 604 return "_SensorListenerProxyControl($superString)"; |
| 565 } | 605 } |
| 566 } | 606 } |
| 567 | 607 |
| 568 class SensorListenerProxy | 608 class SensorListenerProxy |
| 569 extends bindings.Proxy | 609 extends bindings.Proxy<SensorListener> |
| 570 implements SensorListener { | 610 implements SensorListener, |
| 611 SensorListenerInterface, |
| 612 SensorListenerInterfaceRequest { |
| 571 SensorListenerProxy.fromEndpoint( | 613 SensorListenerProxy.fromEndpoint( |
| 572 core.MojoMessagePipeEndpoint endpoint) | 614 core.MojoMessagePipeEndpoint endpoint) |
| 573 : super(new _SensorListenerProxyControl.fromEndpoint(endpoint)); | 615 : super(new _SensorListenerProxyControl.fromEndpoint(endpoint)); |
| 574 | 616 |
| 575 SensorListenerProxy.fromHandle(core.MojoHandle handle) | 617 SensorListenerProxy.fromHandle(core.MojoHandle handle) |
| 576 : super(new _SensorListenerProxyControl.fromHandle(handle)); | 618 : super(new _SensorListenerProxyControl.fromHandle(handle)); |
| 577 | 619 |
| 578 SensorListenerProxy.unbound() | 620 SensorListenerProxy.unbound() |
| 579 : super(new _SensorListenerProxyControl.unbound()); | 621 : super(new _SensorListenerProxyControl.unbound()); |
| 580 | 622 |
| 581 static SensorListenerProxy newFromEndpoint( | 623 static SensorListenerProxy newFromEndpoint( |
| 582 core.MojoMessagePipeEndpoint endpoint) { | 624 core.MojoMessagePipeEndpoint endpoint) { |
| 583 assert(endpoint.setDescription("For SensorListenerProxy")); | 625 assert(endpoint.setDescription("For SensorListenerProxy")); |
| 584 return new SensorListenerProxy.fromEndpoint(endpoint); | 626 return new SensorListenerProxy.fromEndpoint(endpoint); |
| 585 } | 627 } |
| 586 | 628 |
| 587 factory SensorListenerProxy.connectToService( | |
| 588 bindings.ServiceConnector s, String url, [String serviceName]) { | |
| 589 SensorListenerProxy p = new SensorListenerProxy.unbound(); | |
| 590 s.connectToService(url, p, serviceName); | |
| 591 return p; | |
| 592 } | |
| 593 | |
| 594 | 629 |
| 595 void onAccuracyChanged(int accuracy) { | 630 void onAccuracyChanged(int accuracy) { |
| 596 if (!ctrl.isBound) { | 631 if (!ctrl.isBound) { |
| 597 ctrl.proxyError("The Proxy is closed."); | 632 ctrl.proxyError("The Proxy is closed."); |
| 598 return; | 633 return; |
| 599 } | 634 } |
| 600 var params = new _SensorListenerOnAccuracyChangedParams(); | 635 var params = new _SensorListenerOnAccuracyChangedParams(); |
| 601 params.accuracy = accuracy; | 636 params.accuracy = accuracy; |
| 602 ctrl.sendMessage(params, | 637 ctrl.sendMessage(params, |
| 603 _sensorListenerMethodOnAccuracyChangedName); | 638 _sensorListenerMethodOnAccuracyChangedName); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 626 } | 661 } |
| 627 | 662 |
| 628 _SensorListenerStubControl.fromHandle( | 663 _SensorListenerStubControl.fromHandle( |
| 629 core.MojoHandle handle, [SensorListener impl]) | 664 core.MojoHandle handle, [SensorListener impl]) |
| 630 : super.fromHandle(handle, autoBegin: impl != null) { | 665 : super.fromHandle(handle, autoBegin: impl != null) { |
| 631 _impl = impl; | 666 _impl = impl; |
| 632 } | 667 } |
| 633 | 668 |
| 634 _SensorListenerStubControl.unbound([this._impl]) : super.unbound(); | 669 _SensorListenerStubControl.unbound([this._impl]) : super.unbound(); |
| 635 | 670 |
| 671 String get serviceName => SensorListener.serviceName; |
| 672 |
| 636 | 673 |
| 637 | 674 |
| 638 dynamic handleMessage(bindings.ServiceMessage message) { | 675 dynamic handleMessage(bindings.ServiceMessage message) { |
| 639 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 676 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 640 return bindings.ControlMessageHandler.handleMessage(this, | 677 return bindings.ControlMessageHandler.handleMessage(this, |
| 641 0, | 678 0, |
| 642 message); | 679 message); |
| 643 } | 680 } |
| 644 if (_impl == null) { | 681 if (_impl == null) { |
| 645 throw new core.MojoApiError("$this has no implementation set"); | 682 throw new core.MojoApiError("$this has no implementation set"); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 } | 718 } |
| 682 } | 719 } |
| 683 | 720 |
| 684 @override | 721 @override |
| 685 String toString() { | 722 String toString() { |
| 686 var superString = super.toString(); | 723 var superString = super.toString(); |
| 687 return "_SensorListenerStubControl($superString)"; | 724 return "_SensorListenerStubControl($superString)"; |
| 688 } | 725 } |
| 689 | 726 |
| 690 int get version => 0; | 727 int get version => 0; |
| 691 | |
| 692 static service_describer.ServiceDescription _cachedServiceDescription; | |
| 693 static service_describer.ServiceDescription get serviceDescription { | |
| 694 if (_cachedServiceDescription == null) { | |
| 695 _cachedServiceDescription = new _SensorListenerServiceDescription(); | |
| 696 } | |
| 697 return _cachedServiceDescription; | |
| 698 } | |
| 699 } | 728 } |
| 700 | 729 |
| 701 class SensorListenerStub | 730 class SensorListenerStub |
| 702 extends bindings.Stub<SensorListener> | 731 extends bindings.Stub<SensorListener> |
| 703 implements SensorListener { | 732 implements SensorListener, |
| 733 SensorListenerInterface, |
| 734 SensorListenerInterfaceRequest { |
| 735 SensorListenerStub.unbound([SensorListener impl]) |
| 736 : super(new _SensorListenerStubControl.unbound(impl)); |
| 737 |
| 704 SensorListenerStub.fromEndpoint( | 738 SensorListenerStub.fromEndpoint( |
| 705 core.MojoMessagePipeEndpoint endpoint, [SensorListener impl]) | 739 core.MojoMessagePipeEndpoint endpoint, [SensorListener impl]) |
| 706 : super(new _SensorListenerStubControl.fromEndpoint(endpoint, impl)); | 740 : super(new _SensorListenerStubControl.fromEndpoint(endpoint, impl)); |
| 707 | 741 |
| 708 SensorListenerStub.fromHandle( | 742 SensorListenerStub.fromHandle( |
| 709 core.MojoHandle handle, [SensorListener impl]) | 743 core.MojoHandle handle, [SensorListener impl]) |
| 710 : super(new _SensorListenerStubControl.fromHandle(handle, impl)); | 744 : super(new _SensorListenerStubControl.fromHandle(handle, impl)); |
| 711 | 745 |
| 712 SensorListenerStub.unbound([SensorListener impl]) | |
| 713 : super(new _SensorListenerStubControl.unbound(impl)); | |
| 714 | |
| 715 static SensorListenerStub newFromEndpoint( | 746 static SensorListenerStub newFromEndpoint( |
| 716 core.MojoMessagePipeEndpoint endpoint) { | 747 core.MojoMessagePipeEndpoint endpoint) { |
| 717 assert(endpoint.setDescription("For SensorListenerStub")); | 748 assert(endpoint.setDescription("For SensorListenerStub")); |
| 718 return new SensorListenerStub.fromEndpoint(endpoint); | 749 return new SensorListenerStub.fromEndpoint(endpoint); |
| 719 } | 750 } |
| 720 | 751 |
| 721 static service_describer.ServiceDescription get serviceDescription => | |
| 722 _SensorListenerStubControl.serviceDescription; | |
| 723 | |
| 724 | 752 |
| 725 void onAccuracyChanged(int accuracy) { | 753 void onAccuracyChanged(int accuracy) { |
| 726 return impl.onAccuracyChanged(accuracy); | 754 return impl.onAccuracyChanged(accuracy); |
| 727 } | 755 } |
| 728 void onSensorChanged(SensorData data) { | 756 void onSensorChanged(SensorData data) { |
| 729 return impl.onSensorChanged(data); | 757 return impl.onSensorChanged(data); |
| 730 } | 758 } |
| 731 } | 759 } |
| 732 | 760 |
| 733 const int _sensorServiceMethodAddListenerName = 0; | 761 const int _sensorServiceMethodAddListenerName = 0; |
| 734 | 762 |
| 735 class _SensorServiceServiceDescription implements service_describer.ServiceDescr
iption { | 763 class _SensorServiceServiceDescription implements service_describer.ServiceDescr
iption { |
| 736 dynamic getTopLevelInterface([Function responseFactory]) => | 764 dynamic getTopLevelInterface([Function responseFactory]) => |
| 737 responseFactory(null); | 765 responseFactory(null); |
| 738 | 766 |
| 739 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 767 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 740 responseFactory(null); | 768 responseFactory(null); |
| 741 | 769 |
| 742 dynamic getAllTypeDefinitions([Function responseFactory]) => | 770 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 743 responseFactory(null); | 771 responseFactory(null); |
| 744 } | 772 } |
| 745 | 773 |
| 746 abstract class SensorService { | 774 abstract class SensorService { |
| 747 static const String serviceName = "sensors::SensorService"; | 775 static const String serviceName = "sensors::SensorService"; |
| 748 void addListener(SensorType type, Object listener); | 776 |
| 777 static service_describer.ServiceDescription _cachedServiceDescription; |
| 778 static service_describer.ServiceDescription get serviceDescription { |
| 779 if (_cachedServiceDescription == null) { |
| 780 _cachedServiceDescription = new _SensorServiceServiceDescription(); |
| 781 } |
| 782 return _cachedServiceDescription; |
| 783 } |
| 784 |
| 785 static SensorServiceProxy connectToService( |
| 786 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 787 SensorServiceProxy p = new SensorServiceProxy.unbound(); |
| 788 String name = serviceName ?? SensorService.serviceName; |
| 789 if ((name == null) || name.isEmpty) { |
| 790 throw new core.MojoApiError( |
| 791 "If an interface has no ServiceName, then one must be provided."); |
| 792 } |
| 793 s.connectToService(url, p, name); |
| 794 return p; |
| 795 } |
| 796 void addListener(SensorType type, SensorListenerInterface listener); |
| 797 } |
| 798 |
| 799 abstract class SensorServiceInterface |
| 800 implements bindings.MojoInterface<SensorService>, |
| 801 SensorService { |
| 802 factory SensorServiceInterface([SensorService impl]) => |
| 803 new SensorServiceStub.unbound(impl); |
| 804 factory SensorServiceInterface.fromEndpoint( |
| 805 core.MojoMessagePipeEndpoint endpoint, |
| 806 [SensorService impl]) => |
| 807 new SensorServiceStub.fromEndpoint(endpoint, impl); |
| 808 } |
| 809 |
| 810 abstract class SensorServiceInterfaceRequest |
| 811 implements bindings.MojoInterface<SensorService>, |
| 812 SensorService { |
| 813 factory SensorServiceInterfaceRequest() => |
| 814 new SensorServiceProxy.unbound(); |
| 749 } | 815 } |
| 750 | 816 |
| 751 class _SensorServiceProxyControl | 817 class _SensorServiceProxyControl |
| 752 extends bindings.ProxyMessageHandler | 818 extends bindings.ProxyMessageHandler |
| 753 implements bindings.ProxyControl { | 819 implements bindings.ProxyControl<SensorService> { |
| 754 _SensorServiceProxyControl.fromEndpoint( | 820 _SensorServiceProxyControl.fromEndpoint( |
| 755 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 821 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 756 | 822 |
| 757 _SensorServiceProxyControl.fromHandle( | 823 _SensorServiceProxyControl.fromHandle( |
| 758 core.MojoHandle handle) : super.fromHandle(handle); | 824 core.MojoHandle handle) : super.fromHandle(handle); |
| 759 | 825 |
| 760 _SensorServiceProxyControl.unbound() : super.unbound(); | 826 _SensorServiceProxyControl.unbound() : super.unbound(); |
| 761 | 827 |
| 762 service_describer.ServiceDescription get serviceDescription => | |
| 763 new _SensorServiceServiceDescription(); | |
| 764 | |
| 765 String get serviceName => SensorService.serviceName; | 828 String get serviceName => SensorService.serviceName; |
| 766 | 829 |
| 767 void handleResponse(bindings.ServiceMessage message) { | 830 void handleResponse(bindings.ServiceMessage message) { |
| 768 switch (message.header.type) { | 831 switch (message.header.type) { |
| 769 default: | 832 default: |
| 770 proxyError("Unexpected message type: ${message.header.type}"); | 833 proxyError("Unexpected message type: ${message.header.type}"); |
| 771 close(immediate: true); | 834 close(immediate: true); |
| 772 break; | 835 break; |
| 773 } | 836 } |
| 774 } | 837 } |
| 775 | 838 |
| 839 SensorService get impl => null; |
| 840 set impl(SensorService _) { |
| 841 throw new core.MojoApiError("The impl of a Proxy cannot be set."); |
| 842 } |
| 843 |
| 776 @override | 844 @override |
| 777 String toString() { | 845 String toString() { |
| 778 var superString = super.toString(); | 846 var superString = super.toString(); |
| 779 return "_SensorServiceProxyControl($superString)"; | 847 return "_SensorServiceProxyControl($superString)"; |
| 780 } | 848 } |
| 781 } | 849 } |
| 782 | 850 |
| 783 class SensorServiceProxy | 851 class SensorServiceProxy |
| 784 extends bindings.Proxy | 852 extends bindings.Proxy<SensorService> |
| 785 implements SensorService { | 853 implements SensorService, |
| 854 SensorServiceInterface, |
| 855 SensorServiceInterfaceRequest { |
| 786 SensorServiceProxy.fromEndpoint( | 856 SensorServiceProxy.fromEndpoint( |
| 787 core.MojoMessagePipeEndpoint endpoint) | 857 core.MojoMessagePipeEndpoint endpoint) |
| 788 : super(new _SensorServiceProxyControl.fromEndpoint(endpoint)); | 858 : super(new _SensorServiceProxyControl.fromEndpoint(endpoint)); |
| 789 | 859 |
| 790 SensorServiceProxy.fromHandle(core.MojoHandle handle) | 860 SensorServiceProxy.fromHandle(core.MojoHandle handle) |
| 791 : super(new _SensorServiceProxyControl.fromHandle(handle)); | 861 : super(new _SensorServiceProxyControl.fromHandle(handle)); |
| 792 | 862 |
| 793 SensorServiceProxy.unbound() | 863 SensorServiceProxy.unbound() |
| 794 : super(new _SensorServiceProxyControl.unbound()); | 864 : super(new _SensorServiceProxyControl.unbound()); |
| 795 | 865 |
| 796 static SensorServiceProxy newFromEndpoint( | 866 static SensorServiceProxy newFromEndpoint( |
| 797 core.MojoMessagePipeEndpoint endpoint) { | 867 core.MojoMessagePipeEndpoint endpoint) { |
| 798 assert(endpoint.setDescription("For SensorServiceProxy")); | 868 assert(endpoint.setDescription("For SensorServiceProxy")); |
| 799 return new SensorServiceProxy.fromEndpoint(endpoint); | 869 return new SensorServiceProxy.fromEndpoint(endpoint); |
| 800 } | 870 } |
| 801 | 871 |
| 802 factory SensorServiceProxy.connectToService( | |
| 803 bindings.ServiceConnector s, String url, [String serviceName]) { | |
| 804 SensorServiceProxy p = new SensorServiceProxy.unbound(); | |
| 805 s.connectToService(url, p, serviceName); | |
| 806 return p; | |
| 807 } | |
| 808 | 872 |
| 809 | 873 void addListener(SensorType type, SensorListenerInterface listener) { |
| 810 void addListener(SensorType type, Object listener) { | |
| 811 if (!ctrl.isBound) { | 874 if (!ctrl.isBound) { |
| 812 ctrl.proxyError("The Proxy is closed."); | 875 ctrl.proxyError("The Proxy is closed."); |
| 813 return; | 876 return; |
| 814 } | 877 } |
| 815 var params = new _SensorServiceAddListenerParams(); | 878 var params = new _SensorServiceAddListenerParams(); |
| 816 params.type = type; | 879 params.type = type; |
| 817 params.listener = listener; | 880 params.listener = listener; |
| 818 ctrl.sendMessage(params, | 881 ctrl.sendMessage(params, |
| 819 _sensorServiceMethodAddListenerName); | 882 _sensorServiceMethodAddListenerName); |
| 820 } | 883 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 832 } | 895 } |
| 833 | 896 |
| 834 _SensorServiceStubControl.fromHandle( | 897 _SensorServiceStubControl.fromHandle( |
| 835 core.MojoHandle handle, [SensorService impl]) | 898 core.MojoHandle handle, [SensorService impl]) |
| 836 : super.fromHandle(handle, autoBegin: impl != null) { | 899 : super.fromHandle(handle, autoBegin: impl != null) { |
| 837 _impl = impl; | 900 _impl = impl; |
| 838 } | 901 } |
| 839 | 902 |
| 840 _SensorServiceStubControl.unbound([this._impl]) : super.unbound(); | 903 _SensorServiceStubControl.unbound([this._impl]) : super.unbound(); |
| 841 | 904 |
| 905 String get serviceName => SensorService.serviceName; |
| 906 |
| 842 | 907 |
| 843 | 908 |
| 844 dynamic handleMessage(bindings.ServiceMessage message) { | 909 dynamic handleMessage(bindings.ServiceMessage message) { |
| 845 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 910 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 846 return bindings.ControlMessageHandler.handleMessage(this, | 911 return bindings.ControlMessageHandler.handleMessage(this, |
| 847 0, | 912 0, |
| 848 message); | 913 message); |
| 849 } | 914 } |
| 850 if (_impl == null) { | 915 if (_impl == null) { |
| 851 throw new core.MojoApiError("$this has no implementation set"); | 916 throw new core.MojoApiError("$this has no implementation set"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 882 } | 947 } |
| 883 } | 948 } |
| 884 | 949 |
| 885 @override | 950 @override |
| 886 String toString() { | 951 String toString() { |
| 887 var superString = super.toString(); | 952 var superString = super.toString(); |
| 888 return "_SensorServiceStubControl($superString)"; | 953 return "_SensorServiceStubControl($superString)"; |
| 889 } | 954 } |
| 890 | 955 |
| 891 int get version => 0; | 956 int get version => 0; |
| 892 | |
| 893 static service_describer.ServiceDescription _cachedServiceDescription; | |
| 894 static service_describer.ServiceDescription get serviceDescription { | |
| 895 if (_cachedServiceDescription == null) { | |
| 896 _cachedServiceDescription = new _SensorServiceServiceDescription(); | |
| 897 } | |
| 898 return _cachedServiceDescription; | |
| 899 } | |
| 900 } | 957 } |
| 901 | 958 |
| 902 class SensorServiceStub | 959 class SensorServiceStub |
| 903 extends bindings.Stub<SensorService> | 960 extends bindings.Stub<SensorService> |
| 904 implements SensorService { | 961 implements SensorService, |
| 962 SensorServiceInterface, |
| 963 SensorServiceInterfaceRequest { |
| 964 SensorServiceStub.unbound([SensorService impl]) |
| 965 : super(new _SensorServiceStubControl.unbound(impl)); |
| 966 |
| 905 SensorServiceStub.fromEndpoint( | 967 SensorServiceStub.fromEndpoint( |
| 906 core.MojoMessagePipeEndpoint endpoint, [SensorService impl]) | 968 core.MojoMessagePipeEndpoint endpoint, [SensorService impl]) |
| 907 : super(new _SensorServiceStubControl.fromEndpoint(endpoint, impl)); | 969 : super(new _SensorServiceStubControl.fromEndpoint(endpoint, impl)); |
| 908 | 970 |
| 909 SensorServiceStub.fromHandle( | 971 SensorServiceStub.fromHandle( |
| 910 core.MojoHandle handle, [SensorService impl]) | 972 core.MojoHandle handle, [SensorService impl]) |
| 911 : super(new _SensorServiceStubControl.fromHandle(handle, impl)); | 973 : super(new _SensorServiceStubControl.fromHandle(handle, impl)); |
| 912 | 974 |
| 913 SensorServiceStub.unbound([SensorService impl]) | |
| 914 : super(new _SensorServiceStubControl.unbound(impl)); | |
| 915 | |
| 916 static SensorServiceStub newFromEndpoint( | 975 static SensorServiceStub newFromEndpoint( |
| 917 core.MojoMessagePipeEndpoint endpoint) { | 976 core.MojoMessagePipeEndpoint endpoint) { |
| 918 assert(endpoint.setDescription("For SensorServiceStub")); | 977 assert(endpoint.setDescription("For SensorServiceStub")); |
| 919 return new SensorServiceStub.fromEndpoint(endpoint); | 978 return new SensorServiceStub.fromEndpoint(endpoint); |
| 920 } | 979 } |
| 921 | 980 |
| 922 static service_describer.ServiceDescription get serviceDescription => | |
| 923 _SensorServiceStubControl.serviceDescription; | |
| 924 | 981 |
| 925 | 982 void addListener(SensorType type, SensorListenerInterface listener) { |
| 926 void addListener(SensorType type, Object listener) { | |
| 927 return impl.addListener(type, listener); | 983 return impl.addListener(type, listener); |
| 928 } | 984 } |
| 929 } | 985 } |
| 930 | 986 |
| 931 | 987 |
| 932 | 988 |
| OLD | NEW |