| Index: mojo/dart/packages/mojo_services/lib/mojo/location_service.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/location_service.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/location_service.mojom.dart
|
| index 800ce02f2a6055cbb30e67dea6edc579b7126ca2..a71b3ccfab580cf5d4dff22c52d1c77b5500e3cf 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/location_service.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/location_service.mojom.dart
|
| @@ -374,14 +374,19 @@ class LocationServiceProxy implements bindings.ProxyBase {
|
|
|
|
|
| class LocationServiceStub extends bindings.Stub {
|
| - LocationService _impl = null;
|
| + LocationService _impl;
|
|
|
| LocationServiceStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [LocationService impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - LocationServiceStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + LocationServiceStub.fromHandle(
|
| + core.MojoHandle handle, [LocationService impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| LocationServiceStub.unbound() : super.unbound();
|
|
|
| @@ -404,7 +409,9 @@ class LocationServiceStub 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 _locationServiceMethodGetNextLocationName:
|
| var params = _LocationServiceGetNextLocationParams.deserialize(
|
| @@ -437,10 +444,23 @@ class LocationServiceStub extends bindings.Stub {
|
|
|
| LocationService get impl => _impl;
|
| set impl(LocationService 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 "LocationServiceStub($superString)";
|
|
|