| Index: mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| index 02b8d64fe2f6e4ca34c3dcd49750b86883a9d660..8d9fcc2317a3eee36078c8779313da17dfc2ec81 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| @@ -210,14 +210,19 @@ class AudioServerProxy implements bindings.ProxyBase {
|
|
|
|
|
| class AudioServerStub extends bindings.Stub {
|
| - AudioServer _impl = null;
|
| + AudioServer _impl;
|
|
|
| AudioServerStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [AudioServer impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - AudioServerStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + AudioServerStub.fromHandle(
|
| + core.MojoHandle handle, [AudioServer impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| AudioServerStub.unbound() : super.unbound();
|
|
|
| @@ -235,7 +240,9 @@ class AudioServerStub 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 _audioServerMethodCreateTrackName:
|
| var params = _AudioServerCreateTrackParams.deserialize(
|
| @@ -251,10 +258,23 @@ class AudioServerStub extends bindings.Stub {
|
|
|
| AudioServer get impl => _impl;
|
| set impl(AudioServer 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 "AudioServerStub($superString)";
|
|
|