| Index: mojo/dart/packages/mojo_services/lib/mojo/service_registry.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/service_registry.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/service_registry.mojom.dart
|
| index cdd7ae8098065b84e8800f602c6ce3cc508f55db..6a4fd544c7265e76422aa838d805df1e9d77af5e 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/service_registry.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/service_registry.mojom.dart
|
| @@ -239,14 +239,19 @@ class ServiceRegistryProxy implements bindings.ProxyBase {
|
|
|
|
|
| class ServiceRegistryStub extends bindings.Stub {
|
| - ServiceRegistry _impl = null;
|
| + ServiceRegistry _impl;
|
|
|
| ServiceRegistryStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [ServiceRegistry impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - ServiceRegistryStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + ServiceRegistryStub.fromHandle(
|
| + core.MojoHandle handle, [ServiceRegistry impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| ServiceRegistryStub.unbound() : super.unbound();
|
|
|
| @@ -264,7 +269,9 @@ class ServiceRegistryStub extends bindings.Stub {
|
| 0,
|
| message);
|
| }
|
| - assert(_impl != null);
|
| + if (_impl == null) {
|
| + throw new core.MojoApiError("$this has no implementation set");
|
| + }
|
| switch (message.header.type) {
|
| case _serviceRegistryMethodAddServicesName:
|
| var params = _ServiceRegistryAddServicesParams.deserialize(
|
| @@ -280,10 +287,23 @@ class ServiceRegistryStub extends bindings.Stub {
|
|
|
| ServiceRegistry get impl => _impl;
|
| set impl(ServiceRegistry d) {
|
| - assert(_impl == null);
|
| + if (d == null) {
|
| + throw new core.MojoApiError("$this: Cannot set a null implementation");
|
| + }
|
| + if (isBound && (_impl == null)) {
|
| + beginHandlingEvents();
|
| + }
|
| _impl = d;
|
| }
|
|
|
| + @override
|
| + void bind(core.MojoMessagePipeEndpoint endpoint) {
|
| + super.bind(endpoint);
|
| + if (!isOpen && (_impl != null)) {
|
| + beginHandlingEvents();
|
| + }
|
| + }
|
| +
|
| String toString() {
|
| var superString = super.toString();
|
| return "ServiceRegistryStub($superString)";
|
|
|