| Index: mojo/dart/packages/mojo_services/lib/mojo/media/media_factory.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/media/media_factory.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/media/media_factory.mojom.dart
|
| index 7bd89a7a979ede3674d2fea66da8b0a18c3cf788..7a6763f68e2a5c332fdbc82958e766c0a460dd82 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/media/media_factory.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/media/media_factory.mojom.dart
|
| @@ -758,14 +758,19 @@ class MediaFactoryProxy implements bindings.ProxyBase {
|
|
|
|
|
| class MediaFactoryStub extends bindings.Stub {
|
| - MediaFactory _impl = null;
|
| + MediaFactory _impl;
|
|
|
| MediaFactoryStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [MediaFactory impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - MediaFactoryStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + MediaFactoryStub.fromHandle(
|
| + core.MojoHandle handle, [MediaFactory impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| MediaFactoryStub.unbound() : super.unbound();
|
|
|
| @@ -783,7 +788,9 @@ class MediaFactoryStub 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 _mediaFactoryMethodCreatePlayerName:
|
| var params = _MediaFactoryCreatePlayerParams.deserialize(
|
| @@ -824,10 +831,23 @@ class MediaFactoryStub extends bindings.Stub {
|
|
|
| MediaFactory get impl => _impl;
|
| set impl(MediaFactory 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 "MediaFactoryStub($superString)";
|
|
|