| Index: mojo/dart/packages/mojo_services/lib/mojo/clipboard.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/clipboard.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/clipboard.mojom.dart
|
| index ec58183ff6806dd7ed88c6dfe1f21cfb6effcd2d..a0fe65c94113276331f48b4f1ae6ac5e865a5cd5 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/clipboard.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/clipboard.mojom.dart
|
| @@ -911,14 +911,19 @@ class ClipboardProxy implements bindings.ProxyBase {
|
|
|
|
|
| class ClipboardStub extends bindings.Stub {
|
| - Clipboard _impl = null;
|
| + Clipboard _impl;
|
|
|
| ClipboardStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| - : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint, [Clipboard impl])
|
| + : super.fromEndpoint(endpoint, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| - ClipboardStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| - : super.fromHandle(handle);
|
| + ClipboardStub.fromHandle(
|
| + core.MojoHandle handle, [Clipboard impl])
|
| + : super.fromHandle(handle, autoBegin: impl != null) {
|
| + _impl = impl;
|
| + }
|
|
|
| ClipboardStub.unbound() : super.unbound();
|
|
|
| @@ -951,7 +956,9 @@ class ClipboardStub 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 _clipboardMethodGetSequenceNumberName:
|
| var params = _ClipboardGetSequenceNumberParams.deserialize(
|
| @@ -1033,10 +1040,23 @@ class ClipboardStub extends bindings.Stub {
|
|
|
| Clipboard get impl => _impl;
|
| set impl(Clipboard 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 "ClipboardStub($superString)";
|
|
|