| 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 contacts_mojom; | 5 library contacts_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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 } | 761 } |
| 762 | 762 |
| 763 abstract class ContactsService { | 763 abstract class ContactsService { |
| 764 static const String serviceName = "contacts::ContactsService"; | 764 static const String serviceName = "contacts::ContactsService"; |
| 765 dynamic getCount(String filter,[Function responseFactory = null]); | 765 dynamic getCount(String filter,[Function responseFactory = null]); |
| 766 dynamic get(String filter,int offset,int limit,[Function responseFactory = nul
l]); | 766 dynamic get(String filter,int offset,int limit,[Function responseFactory = nul
l]); |
| 767 dynamic getEmails(int id,[Function responseFactory = null]); | 767 dynamic getEmails(int id,[Function responseFactory = null]); |
| 768 dynamic getPhoto(int id,bool highResolution,[Function responseFactory = null])
; | 768 dynamic getPhoto(int id,bool highResolution,[Function responseFactory = null])
; |
| 769 } | 769 } |
| 770 | 770 |
| 771 | 771 class _ContactsServiceProxyControl |
| 772 class _ContactsServiceProxyControl extends bindings.ProxyMessageHandler | 772 extends bindings.ProxyMessageHandler |
| 773 implements bindings.ProxyControl { | 773 implements bindings.ProxyControl { |
| 774 _ContactsServiceProxyControl.fromEndpoint( | 774 _ContactsServiceProxyControl.fromEndpoint( |
| 775 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 775 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 776 | 776 |
| 777 _ContactsServiceProxyControl.fromHandle( | 777 _ContactsServiceProxyControl.fromHandle( |
| 778 core.MojoHandle handle) : super.fromHandle(handle); | 778 core.MojoHandle handle) : super.fromHandle(handle); |
| 779 | 779 |
| 780 _ContactsServiceProxyControl.unbound() : super.unbound(); | 780 _ContactsServiceProxyControl.unbound() : super.unbound(); |
| 781 | 781 |
| 782 service_describer.ServiceDescription get serviceDescription => | 782 service_describer.ServiceDescription get serviceDescription => |
| 783 new _ContactsServiceServiceDescription(); | 783 new _ContactsServiceServiceDescription(); |
| 784 | 784 |
| 785 String get serviceName => ContactsService.serviceName; | 785 String get serviceName => ContactsService.serviceName; |
| 786 | 786 |
| 787 @override | |
| 788 void handleResponse(bindings.ServiceMessage message) { | 787 void handleResponse(bindings.ServiceMessage message) { |
| 789 switch (message.header.type) { | 788 switch (message.header.type) { |
| 790 case _contactsServiceMethodGetCountName: | 789 case _contactsServiceMethodGetCountName: |
| 791 var r = ContactsServiceGetCountResponseParams.deserialize( | 790 var r = ContactsServiceGetCountResponseParams.deserialize( |
| 792 message.payload); | 791 message.payload); |
| 793 if (!message.header.hasRequestId) { | 792 if (!message.header.hasRequestId) { |
| 794 proxyError("Expected a message with a valid request Id."); | 793 proxyError("Expected a message with a valid request Id."); |
| 795 return; | 794 return; |
| 796 } | 795 } |
| 797 Completer c = completerMap[message.header.requestId]; | 796 Completer c = completerMap[message.header.requestId]; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 } | 873 } |
| 875 } | 874 } |
| 876 | 875 |
| 877 @override | 876 @override |
| 878 String toString() { | 877 String toString() { |
| 879 var superString = super.toString(); | 878 var superString = super.toString(); |
| 880 return "_ContactsServiceProxyControl($superString)"; | 879 return "_ContactsServiceProxyControl($superString)"; |
| 881 } | 880 } |
| 882 } | 881 } |
| 883 | 882 |
| 884 | 883 class ContactsServiceProxy |
| 885 class ContactsServiceProxy extends bindings.Proxy | 884 extends bindings.Proxy |
| 886 implements ContactsService { | 885 implements ContactsService { |
| 887 ContactsServiceProxy.fromEndpoint( | 886 ContactsServiceProxy.fromEndpoint( |
| 888 core.MojoMessagePipeEndpoint endpoint) | 887 core.MojoMessagePipeEndpoint endpoint) |
| 889 : super(new _ContactsServiceProxyControl.fromEndpoint(endpoint)); | 888 : super(new _ContactsServiceProxyControl.fromEndpoint(endpoint)); |
| 890 | 889 |
| 891 ContactsServiceProxy.fromHandle(core.MojoHandle handle) | 890 ContactsServiceProxy.fromHandle(core.MojoHandle handle) |
| 892 : super(new _ContactsServiceProxyControl.fromHandle(handle)); | 891 : super(new _ContactsServiceProxyControl.fromHandle(handle)); |
| 893 | 892 |
| 894 ContactsServiceProxy.unbound() | 893 ContactsServiceProxy.unbound() |
| 895 : super(new _ContactsServiceProxyControl.unbound()); | 894 : super(new _ContactsServiceProxyControl.unbound()); |
| 896 | 895 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 params.id = id; | 941 params.id = id; |
| 943 params.highResolution = highResolution; | 942 params.highResolution = highResolution; |
| 944 return ctrl.sendMessageWithRequestId( | 943 return ctrl.sendMessageWithRequestId( |
| 945 params, | 944 params, |
| 946 _contactsServiceMethodGetPhotoName, | 945 _contactsServiceMethodGetPhotoName, |
| 947 -1, | 946 -1, |
| 948 bindings.MessageHeader.kMessageExpectsResponse); | 947 bindings.MessageHeader.kMessageExpectsResponse); |
| 949 } | 948 } |
| 950 } | 949 } |
| 951 | 950 |
| 952 | 951 class _ContactsServiceStubControl |
| 953 class ContactsServiceStub extends bindings.Stub { | 952 extends bindings.StubMessageHandler |
| 953 implements bindings.StubControl<ContactsService> { |
| 954 ContactsService _impl; | 954 ContactsService _impl; |
| 955 | 955 |
| 956 ContactsServiceStub.fromEndpoint( | 956 _ContactsServiceStubControl.fromEndpoint( |
| 957 core.MojoMessagePipeEndpoint endpoint, [ContactsService impl]) | 957 core.MojoMessagePipeEndpoint endpoint, [ContactsService impl]) |
| 958 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 958 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 959 _impl = impl; | 959 _impl = impl; |
| 960 } | 960 } |
| 961 | 961 |
| 962 ContactsServiceStub.fromHandle( | 962 _ContactsServiceStubControl.fromHandle( |
| 963 core.MojoHandle handle, [ContactsService impl]) | 963 core.MojoHandle handle, [ContactsService impl]) |
| 964 : super.fromHandle(handle, autoBegin: impl != null) { | 964 : super.fromHandle(handle, autoBegin: impl != null) { |
| 965 _impl = impl; | 965 _impl = impl; |
| 966 } | 966 } |
| 967 | 967 |
| 968 ContactsServiceStub.unbound([this._impl]) : super.unbound(); | 968 _ContactsServiceStubControl.unbound([this._impl]) : super.unbound(); |
| 969 | |
| 970 static ContactsServiceStub newFromEndpoint( | |
| 971 core.MojoMessagePipeEndpoint endpoint) { | |
| 972 assert(endpoint.setDescription("For ContactsServiceStub")); | |
| 973 return new ContactsServiceStub.fromEndpoint(endpoint); | |
| 974 } | |
| 975 | 969 |
| 976 | 970 |
| 977 ContactsServiceGetCountResponseParams _contactsServiceGetCountResponseParamsFa
ctory(int count) { | 971 ContactsServiceGetCountResponseParams _contactsServiceGetCountResponseParamsFa
ctory(int count) { |
| 978 var result = new ContactsServiceGetCountResponseParams(); | 972 var result = new ContactsServiceGetCountResponseParams(); |
| 979 result.count = count; | 973 result.count = count; |
| 980 return result; | 974 return result; |
| 981 } | 975 } |
| 982 ContactsServiceGetResponseParams _contactsServiceGetResponseParamsFactory(List
<Contact> contacts) { | 976 ContactsServiceGetResponseParams _contactsServiceGetResponseParamsFactory(List
<Contact> contacts) { |
| 983 var result = new ContactsServiceGetResponseParams(); | 977 var result = new ContactsServiceGetResponseParams(); |
| 984 result.contacts = contacts; | 978 result.contacts = contacts; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 } | 1106 } |
| 1113 | 1107 |
| 1114 @override | 1108 @override |
| 1115 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1109 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 1116 super.bind(endpoint); | 1110 super.bind(endpoint); |
| 1117 if (!isOpen && (_impl != null)) { | 1111 if (!isOpen && (_impl != null)) { |
| 1118 beginHandlingEvents(); | 1112 beginHandlingEvents(); |
| 1119 } | 1113 } |
| 1120 } | 1114 } |
| 1121 | 1115 |
| 1116 @override |
| 1122 String toString() { | 1117 String toString() { |
| 1123 var superString = super.toString(); | 1118 var superString = super.toString(); |
| 1124 return "ContactsServiceStub($superString)"; | 1119 return "_ContactsServiceStubControl($superString)"; |
| 1125 } | 1120 } |
| 1126 | 1121 |
| 1127 int get version => 0; | 1122 int get version => 0; |
| 1128 | 1123 |
| 1129 static service_describer.ServiceDescription _cachedServiceDescription; | 1124 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1130 static service_describer.ServiceDescription get serviceDescription { | 1125 static service_describer.ServiceDescription get serviceDescription { |
| 1131 if (_cachedServiceDescription == null) { | 1126 if (_cachedServiceDescription == null) { |
| 1132 _cachedServiceDescription = new _ContactsServiceServiceDescription(); | 1127 _cachedServiceDescription = new _ContactsServiceServiceDescription(); |
| 1133 } | 1128 } |
| 1134 return _cachedServiceDescription; | 1129 return _cachedServiceDescription; |
| 1135 } | 1130 } |
| 1136 } | 1131 } |
| 1137 | 1132 |
| 1133 class ContactsServiceStub |
| 1134 extends bindings.Stub<ContactsService> |
| 1135 implements ContactsService { |
| 1136 ContactsServiceStub.fromEndpoint( |
| 1137 core.MojoMessagePipeEndpoint endpoint, [ContactsService impl]) |
| 1138 : super(new _ContactsServiceStubControl.fromEndpoint(endpoint, impl)); |
| 1139 |
| 1140 ContactsServiceStub.fromHandle( |
| 1141 core.MojoHandle handle, [ContactsService impl]) |
| 1142 : super(new _ContactsServiceStubControl.fromHandle(handle, impl)); |
| 1143 |
| 1144 ContactsServiceStub.unbound([ContactsService impl]) |
| 1145 : super(new _ContactsServiceStubControl.unbound(impl)); |
| 1146 |
| 1147 static ContactsServiceStub newFromEndpoint( |
| 1148 core.MojoMessagePipeEndpoint endpoint) { |
| 1149 assert(endpoint.setDescription("For ContactsServiceStub")); |
| 1150 return new ContactsServiceStub.fromEndpoint(endpoint); |
| 1151 } |
| 1152 |
| 1153 static service_describer.ServiceDescription get serviceDescription => |
| 1154 _ContactsServiceStubControl.serviceDescription; |
| 1155 |
| 1156 |
| 1157 dynamic getCount(String filter,[Function responseFactory = null]) { |
| 1158 return impl.getCount(filter,responseFactory); |
| 1159 } |
| 1160 dynamic get(String filter,int offset,int limit,[Function responseFactory = nul
l]) { |
| 1161 return impl.get(filter,offset,limit,responseFactory); |
| 1162 } |
| 1163 dynamic getEmails(int id,[Function responseFactory = null]) { |
| 1164 return impl.getEmails(id,responseFactory); |
| 1165 } |
| 1166 dynamic getPhoto(int id,bool highResolution,[Function responseFactory = null])
{ |
| 1167 return impl.getPhoto(id,highResolution,responseFactory); |
| 1168 } |
| 1169 } |
| 1170 |
| 1138 | 1171 |
| 1139 | 1172 |
| OLD | NEW |