| OLD | NEW |
| 1 // WARNING: DO NOT EDIT. This file was generated by a program. | 1 // WARNING: DO NOT EDIT. This file was generated by a program. |
| 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. | 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. |
| 3 | 3 |
| 4 library service_registry_mojom; | 4 library service_registry_mojom; |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:mojo/bindings.dart' as bindings; | 6 import 'package:mojo/bindings.dart' as bindings; |
| 7 import 'package:mojo/core.dart' as core; | 7 import 'package:mojo/core.dart' as core; |
| 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 9 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; | 9 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; |
| 10 | 10 |
| 11 | 11 |
| 12 | 12 |
| 13 class _ServiceRegistryAddServicesParams extends bindings.Struct { | 13 class _ServiceRegistryAddServicesParams extends bindings.Struct { |
| 14 static const List<bindings.StructDataHeader> kVersions = const [ | 14 static const List<bindings.StructDataHeader> kVersions = const [ |
| 15 const bindings.StructDataHeader(24, 0) | 15 const bindings.StructDataHeader(24, 0) |
| 16 ]; | 16 ]; |
| 17 List<String> interfaceNames = null; | 17 List<String> interfaceNames = null; |
| 18 service_provider_mojom.ServiceProviderInterface serviceProvider = null; | 18 service_provider_mojom.ServiceProviderInterface serviceProvider = null; |
| 19 | 19 |
| 20 _ServiceRegistryAddServicesParams() : super(kVersions.last.size); | 20 _ServiceRegistryAddServicesParams() : super(kVersions.last.size); |
| 21 | 21 |
| 22 _ServiceRegistryAddServicesParams.init( |
| 23 List<String> this.interfaceNames, |
| 24 service_provider_mojom.ServiceProviderInterface this.serviceProvider |
| 25 ) : super(kVersions.last.size); |
| 26 |
| 22 static _ServiceRegistryAddServicesParams deserialize(bindings.Message message)
{ | 27 static _ServiceRegistryAddServicesParams deserialize(bindings.Message message)
{ |
| 23 var decoder = new bindings.Decoder(message); | 28 var decoder = new bindings.Decoder(message); |
| 24 var result = decode(decoder); | 29 var result = decode(decoder); |
| 25 if (decoder.excessHandles != null) { | 30 if (decoder.excessHandles != null) { |
| 26 decoder.excessHandles.forEach((h) => h.close()); | 31 decoder.excessHandles.forEach((h) => h.close()); |
| 27 } | 32 } |
| 28 return result; | 33 return result; |
| 29 } | 34 } |
| 30 | 35 |
| 31 static _ServiceRegistryAddServicesParams decode(bindings.Decoder decoder0) { | 36 static _ServiceRegistryAddServicesParams decode(bindings.Decoder decoder0) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 109 |
| 105 Map toJson() { | 110 Map toJson() { |
| 106 throw new bindings.MojoCodecError( | 111 throw new bindings.MojoCodecError( |
| 107 'Object containing handles cannot be encoded to JSON.'); | 112 'Object containing handles cannot be encoded to JSON.'); |
| 108 } | 113 } |
| 109 } | 114 } |
| 110 | 115 |
| 111 const int _serviceRegistryMethodAddServicesName = 0; | 116 const int _serviceRegistryMethodAddServicesName = 0; |
| 112 | 117 |
| 113 class _ServiceRegistryServiceDescription implements service_describer.ServiceDes
cription { | 118 class _ServiceRegistryServiceDescription implements service_describer.ServiceDes
cription { |
| 114 dynamic getTopLevelInterface([Function responseFactory]) => | 119 void getTopLevelInterface(Function responder) { |
| 115 responseFactory(null); | 120 responder(null); |
| 121 } |
| 116 | 122 |
| 117 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 123 void getTypeDefinition(String typeKey, Function responder) { |
| 118 responseFactory(null); | 124 responder(null); |
| 125 } |
| 119 | 126 |
| 120 dynamic getAllTypeDefinitions([Function responseFactory]) => | 127 void getAllTypeDefinitions(Function responder) { |
| 121 responseFactory(null); | 128 responder(null); |
| 129 } |
| 122 } | 130 } |
| 123 | 131 |
| 124 abstract class ServiceRegistry { | 132 abstract class ServiceRegistry { |
| 125 static const String serviceName = "mojo::ServiceRegistry"; | 133 static const String serviceName = "mojo::ServiceRegistry"; |
| 126 | 134 |
| 127 static service_describer.ServiceDescription _cachedServiceDescription; | 135 static service_describer.ServiceDescription _cachedServiceDescription; |
| 128 static service_describer.ServiceDescription get serviceDescription { | 136 static service_describer.ServiceDescription get serviceDescription { |
| 129 if (_cachedServiceDescription == null) { | 137 if (_cachedServiceDescription == null) { |
| 130 _cachedServiceDescription = new _ServiceRegistryServiceDescription(); | 138 _cachedServiceDescription = new _ServiceRegistryServiceDescription(); |
| 131 } | 139 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 : super.fromHandle(handle, autoBegin: impl != null) { | 270 : super.fromHandle(handle, autoBegin: impl != null) { |
| 263 _impl = impl; | 271 _impl = impl; |
| 264 } | 272 } |
| 265 | 273 |
| 266 _ServiceRegistryStubControl.unbound([this._impl]) : super.unbound(); | 274 _ServiceRegistryStubControl.unbound([this._impl]) : super.unbound(); |
| 267 | 275 |
| 268 String get serviceName => ServiceRegistry.serviceName; | 276 String get serviceName => ServiceRegistry.serviceName; |
| 269 | 277 |
| 270 | 278 |
| 271 | 279 |
| 272 dynamic handleMessage(bindings.ServiceMessage message) { | 280 void handleMessage(bindings.ServiceMessage message) { |
| 273 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 281 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 274 return bindings.ControlMessageHandler.handleMessage(this, | 282 bindings.ControlMessageHandler.handleMessage( |
| 275 0, | 283 this, 0, message); |
| 276 message); | 284 return; |
| 277 } | 285 } |
| 278 if (_impl == null) { | 286 if (_impl == null) { |
| 279 throw new core.MojoApiError("$this has no implementation set"); | 287 throw new core.MojoApiError("$this has no implementation set"); |
| 280 } | 288 } |
| 281 switch (message.header.type) { | 289 switch (message.header.type) { |
| 282 case _serviceRegistryMethodAddServicesName: | 290 case _serviceRegistryMethodAddServicesName: |
| 283 var params = _ServiceRegistryAddServicesParams.deserialize( | 291 var params = _ServiceRegistryAddServicesParams.deserialize( |
| 284 message.payload); | 292 message.payload); |
| 285 _impl.addServices(params.interfaceNames, params.serviceProvider); | 293 _impl.addServices(params.interfaceNames, params.serviceProvider); |
| 286 break; | 294 break; |
| 287 default: | 295 default: |
| 288 throw new bindings.MojoCodecError("Unexpected message name"); | 296 throw new bindings.MojoCodecError("Unexpected message name"); |
| 289 break; | 297 break; |
| 290 } | 298 } |
| 291 return null; | |
| 292 } | 299 } |
| 293 | 300 |
| 294 ServiceRegistry get impl => _impl; | 301 ServiceRegistry get impl => _impl; |
| 295 set impl(ServiceRegistry d) { | 302 set impl(ServiceRegistry d) { |
| 296 if (d == null) { | 303 if (d == null) { |
| 297 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 304 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 298 } | 305 } |
| 299 if (isBound && (_impl == null)) { | 306 if (isBound && (_impl == null)) { |
| 300 beginHandlingEvents(); | 307 beginHandlingEvents(); |
| 301 } | 308 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 349 } |
| 343 | 350 |
| 344 | 351 |
| 345 void addServices(List<String> interfaceNames, service_provider_mojom.ServicePr
oviderInterface serviceProvider) { | 352 void addServices(List<String> interfaceNames, service_provider_mojom.ServicePr
oviderInterface serviceProvider) { |
| 346 return impl.addServices(interfaceNames, serviceProvider); | 353 return impl.addServices(interfaceNames, serviceProvider); |
| 347 } | 354 } |
| 348 } | 355 } |
| 349 | 356 |
| 350 | 357 |
| 351 | 358 |
| OLD | NEW |