| Index: mojo/dart/packages/mojo_services/lib/mojo/network_service.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/network_service.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/network_service.mojom.dart
|
| index bf262e3beeaf6d625f6df3bbe0743371ca504d84..1edda501733b8637cee15430cc76ef464d0324bd 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/network_service.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/network_service.mojom.dart
|
| @@ -1273,14 +1273,19 @@ class NetworkServiceProxy implements bindings.ProxyBase {
|
|
|
|
|
| class NetworkServiceStub extends bindings.Stub {
|
| - NetworkService _impl = null;
|
| + NetworkService _impl;
|
|
|
| NetworkServiceStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [NetworkService impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - NetworkServiceStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + NetworkServiceStub.fromHandle(
|
| + core.MojoHandle handle, [NetworkService impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| NetworkServiceStub.unbound() : super.unbound();
|
|
|
| @@ -1316,7 +1321,9 @@ class NetworkServiceStub 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 _networkServiceMethodCreateUrlLoaderName:
|
| var params = _NetworkServiceCreateUrlLoaderParams.deserialize(
|
| @@ -1423,10 +1430,23 @@ class NetworkServiceStub extends bindings.Stub {
|
|
|
| NetworkService get impl => _impl;
|
| set impl(NetworkService 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 "NetworkServiceStub($superString)";
|
|
|