| Index: mojo/dart/packages/mojo_services/lib/mojo/tcp_server_socket.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/tcp_server_socket.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/tcp_server_socket.mojom.dart
|
| index d5281d870b9b1b787556bbeb1c56e52ede2aa3f4..5f003db5ad8e0ed3f0da2f8cdcff16e2b5f3f55c 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/tcp_server_socket.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/tcp_server_socket.mojom.dart
|
| @@ -348,14 +348,19 @@ class TcpServerSocketProxy implements bindings.ProxyBase {
|
|
|
|
|
| class TcpServerSocketStub extends bindings.Stub {
|
| - TcpServerSocket _impl = null;
|
| + TcpServerSocket _impl;
|
|
|
| TcpServerSocketStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [TcpServerSocket impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - TcpServerSocketStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + TcpServerSocketStub.fromHandle(
|
| + core.MojoHandle handle, [TcpServerSocket impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| TcpServerSocketStub.unbound() : super.unbound();
|
|
|
| @@ -379,7 +384,9 @@ class TcpServerSocketStub 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 _tcpServerSocketMethodAcceptName:
|
| var params = _TcpServerSocketAcceptParams.deserialize(
|
| @@ -412,10 +419,23 @@ class TcpServerSocketStub extends bindings.Stub {
|
|
|
| TcpServerSocket get impl => _impl;
|
| set impl(TcpServerSocket 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 "TcpServerSocketStub($superString)";
|
|
|