| Index: mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/scenes.mojom.dart
|
| diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/scenes.mojom.dart
|
| similarity index 51%
|
| copy from mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
|
| copy to mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/scenes.mojom.dart
|
| index ba9d67d22c64ee12db3d9043ec0d037819accf12..30e582ecd28647b060e925adc4dba1c7b87dde66 100644
|
| --- a/mojo/dart/packages/_mojo_for_test_only/lib/test/pingpong_service.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/scenes.mojom.dart
|
| @@ -2,24 +2,33 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -library pingpong_service_mojom;
|
| +library scenes_mojom;
|
|
|
| import 'dart:async';
|
|
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| +import 'package:mojo_services/mojo/gfx/composition/nodes.mojom.dart' as nodes_mojom;
|
| +import 'package:mojo_services/mojo/gfx/composition/resources.mojom.dart' as resources_mojom;
|
| +import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as scene_token_mojom;
|
| +import 'package:mojo_services/mojo/gfx/composition/scheduling.mojom.dart' as scheduling_mojom;
|
| +const int kSceneRootNodeId = 0;
|
| +const int kSceneVersionNone = 0;
|
|
|
|
|
|
|
| -class _PingPongServiceSetClientParams extends bindings.Struct {
|
| +class SceneUpdate extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(16, 0)
|
| + const bindings.StructDataHeader(32, 0)
|
| ];
|
| - Object client = null;
|
| + bool clearResources = false;
|
| + bool clearNodes = false;
|
| + Map<int, resources_mojom.Resource> resources = null;
|
| + Map<int, nodes_mojom.Node> nodes = null;
|
|
|
| - _PingPongServiceSetClientParams() : super(kVersions.last.size);
|
| + SceneUpdate() : super(kVersions.last.size);
|
|
|
| - static _PingPongServiceSetClientParams deserialize(bindings.Message message) {
|
| + static SceneUpdate deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -28,11 +37,11 @@ class _PingPongServiceSetClientParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongServiceSetClientParams decode(bindings.Decoder decoder0) {
|
| + static SceneUpdate decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongServiceSetClientParams result = new _PingPongServiceSetClientParams();
|
| + SceneUpdate result = new SceneUpdate();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -54,73 +63,70 @@ class _PingPongServiceSetClientParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.client = decoder0.decodeServiceInterface(8, false, PingPongClientProxy.newFromEndpoint);
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - void encode(bindings.Encoder encoder) {
|
| - var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| -
|
| - encoder0.encodeInterface(client, 8, false);
|
| - }
|
| -
|
| - String toString() {
|
| - return "_PingPongServiceSetClientParams("
|
| - "client: $client" ")";
|
| - }
|
| -
|
| - Map toJson() {
|
| - throw new bindings.MojoCodecError(
|
| - 'Object containing handles cannot be encoded to JSON.');
|
| - }
|
| -}
|
| -
|
| -
|
| -class _PingPongServicePingParams extends bindings.Struct {
|
| - static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(16, 0)
|
| - ];
|
| - int pingValue = 0;
|
| -
|
| - _PingPongServicePingParams() : super(kVersions.last.size);
|
| -
|
| - static _PingPongServicePingParams deserialize(bindings.Message message) {
|
| - var decoder = new bindings.Decoder(message);
|
| - var result = decode(decoder);
|
| - if (decoder.excessHandles != null) {
|
| - decoder.excessHandles.forEach((h) => h.close());
|
| + result.clearResources = decoder0.decodeBool(8, 0);
|
| }
|
| - return result;
|
| - }
|
| -
|
| - static _PingPongServicePingParams decode(bindings.Decoder decoder0) {
|
| - if (decoder0 == null) {
|
| - return null;
|
| + if (mainDataHeader.version >= 0) {
|
| +
|
| + result.clearNodes = decoder0.decodeBool(8, 1);
|
| }
|
| - _PingPongServicePingParams result = new _PingPongServicePingParams();
|
| -
|
| - var mainDataHeader = decoder0.decodeStructDataHeader();
|
| - if (mainDataHeader.version <= kVersions.last.version) {
|
| - // Scan in reverse order to optimize for more recent versions.
|
| - for (int i = kVersions.length - 1; i >= 0; --i) {
|
| - if (mainDataHeader.version >= kVersions[i].version) {
|
| - if (mainDataHeader.size == kVersions[i].size) {
|
| - // Found a match.
|
| - break;
|
| + if (mainDataHeader.version >= 0) {
|
| +
|
| + var decoder1 = decoder0.decodePointer(16, true);
|
| + if (decoder1 == null) {
|
| + result.resources = null;
|
| + } else {
|
| + decoder1.decodeDataHeaderForMap();
|
| + List<int> keys0;
|
| + List<resources_mojom.Resource> values0;
|
| + {
|
| +
|
| + keys0 = decoder1.decodeUint32Array(bindings.ArrayDataHeader.kHeaderSize, bindings.kNothingNullable, bindings.kUnspecifiedArrayLength);
|
| + }
|
| + {
|
| +
|
| + var decoder2 = decoder1.decodePointer(bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize, false);
|
| + {
|
| + var si2 = decoder2.decodeDataHeaderForUnionArray(keys0.length);
|
| + values0 = new List<resources_mojom.Resource>(si2.numElements);
|
| + for (int i2 = 0; i2 < si2.numElements; ++i2) {
|
| +
|
| + values0[i2] = resources_mojom.Resource.decode(decoder2, bindings.ArrayDataHeader.kHeaderSize + bindings.kUnionSize * i2);
|
| + }
|
| }
|
| - throw new bindings.MojoCodecError(
|
| - 'Header size doesn\'t correspond to known version size.');
|
| }
|
| + result.resources = new Map<int, resources_mojom.Resource>.fromIterables(
|
| + keys0, values0);
|
| }
|
| - } else if (mainDataHeader.size < kVersions.last.size) {
|
| - throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.pingValue = decoder0.decodeUint16(8);
|
| + var decoder1 = decoder0.decodePointer(24, true);
|
| + if (decoder1 == null) {
|
| + result.nodes = null;
|
| + } else {
|
| + decoder1.decodeDataHeaderForMap();
|
| + List<int> keys0;
|
| + List<nodes_mojom.Node> values0;
|
| + {
|
| +
|
| + keys0 = decoder1.decodeUint32Array(bindings.ArrayDataHeader.kHeaderSize, bindings.kNothingNullable, bindings.kUnspecifiedArrayLength);
|
| + }
|
| + {
|
| +
|
| + var decoder2 = decoder1.decodePointer(bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize, false);
|
| + {
|
| + var si2 = decoder2.decodeDataHeaderForPointerArray(keys0.length);
|
| + values0 = new List<nodes_mojom.Node>(si2.numElements);
|
| + for (int i2 = 0; i2 < si2.numElements; ++i2) {
|
| +
|
| + var decoder3 = decoder2.decodePointer(bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i2, true);
|
| + values0[i2] = nodes_mojom.Node.decode(decoder3);
|
| + }
|
| + }
|
| + }
|
| + result.nodes = new Map<int, nodes_mojom.Node>.fromIterables(
|
| + keys0, values0);
|
| + }
|
| }
|
| return result;
|
| }
|
| @@ -128,32 +134,74 @@ class _PingPongServicePingParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeUint16(pingValue, 8);
|
| + encoder0.encodeBool(clearResources, 8, 0);
|
| +
|
| + encoder0.encodeBool(clearNodes, 8, 1);
|
| +
|
| + if (resources == null) {
|
| + encoder0.encodeNullPointer(16, true);
|
| + } else {
|
| + var encoder1 = encoder0.encoderForMap(16);
|
| + int size0 = resources.length;
|
| + var keys0 = resources.keys.toList();
|
| + var values0 = resources.values.toList();
|
| +
|
| + encoder1.encodeUint32Array(keys0, bindings.ArrayDataHeader.kHeaderSize, bindings.kNothingNullable, bindings.kUnspecifiedArrayLength);
|
| +
|
| + {
|
| + var encoder2 = encoder1.encodeUnionArray(values0.length, bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize, bindings.kUnspecifiedArrayLength);
|
| + for (int i1 = 0; i1 < values0.length; ++i1) {
|
| +
|
| + encoder2.encodeUnion(values0[i1], bindings.ArrayDataHeader.kHeaderSize + bindings.kUnionSize * i1, true);
|
| + }
|
| + }
|
| + }
|
| +
|
| + if (nodes == null) {
|
| + encoder0.encodeNullPointer(24, true);
|
| + } else {
|
| + var encoder1 = encoder0.encoderForMap(24);
|
| + int size0 = nodes.length;
|
| + var keys0 = nodes.keys.toList();
|
| + var values0 = nodes.values.toList();
|
| +
|
| + encoder1.encodeUint32Array(keys0, bindings.ArrayDataHeader.kHeaderSize, bindings.kNothingNullable, bindings.kUnspecifiedArrayLength);
|
| +
|
| + {
|
| + var encoder2 = encoder1.encodePointerArray(values0.length, bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize, bindings.kUnspecifiedArrayLength);
|
| + for (int i1 = 0; i1 < values0.length; ++i1) {
|
| +
|
| + encoder2.encodeStruct(values0[i1], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i1, true);
|
| + }
|
| + }
|
| + }
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongServicePingParams("
|
| - "pingValue: $pingValue" ")";
|
| + return "SceneUpdate("
|
| + "clearResources: $clearResources" ", "
|
| + "clearNodes: $clearNodes" ", "
|
| + "resources: $resources" ", "
|
| + "nodes: $nodes" ")";
|
| }
|
|
|
| Map toJson() {
|
| - Map map = new Map();
|
| - map["pingValue"] = pingValue;
|
| - return map;
|
| + throw new bindings.MojoCodecError(
|
| + 'Object containing handles cannot be encoded to JSON.');
|
| }
|
| }
|
|
|
|
|
| -class _PingPongServicePingTargetUrlParams extends bindings.Struct {
|
| +class SceneMetadata extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(24, 0)
|
| ];
|
| - String url = null;
|
| - int count = 0;
|
| + int version = 0;
|
| + int presentationTime = 0;
|
|
|
| - _PingPongServicePingTargetUrlParams() : super(kVersions.last.size);
|
| + SceneMetadata() : super(kVersions.last.size);
|
|
|
| - static _PingPongServicePingTargetUrlParams deserialize(bindings.Message message) {
|
| + static SceneMetadata deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -162,11 +210,11 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongServicePingTargetUrlParams decode(bindings.Decoder decoder0) {
|
| + static SceneMetadata decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongServicePingTargetUrlParams result = new _PingPongServicePingTargetUrlParams();
|
| + SceneMetadata result = new SceneMetadata();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -188,11 +236,11 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.url = decoder0.decodeString(8, false);
|
| + result.version = decoder0.decodeUint32(8);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.count = decoder0.decodeUint16(16);
|
| + result.presentationTime = decoder0.decodeInt64(16);
|
| }
|
| return result;
|
| }
|
| @@ -200,35 +248,35 @@ class _PingPongServicePingTargetUrlParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeString(url, 8, false);
|
| + encoder0.encodeUint32(version, 8);
|
|
|
| - encoder0.encodeUint16(count, 16);
|
| + encoder0.encodeInt64(presentationTime, 16);
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongServicePingTargetUrlParams("
|
| - "url: $url" ", "
|
| - "count: $count" ")";
|
| + return "SceneMetadata("
|
| + "version: $version" ", "
|
| + "presentationTime: $presentationTime" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| - map["url"] = url;
|
| - map["count"] = count;
|
| + map["version"] = version;
|
| + map["presentationTime"] = presentationTime;
|
| return map;
|
| }
|
| }
|
|
|
|
|
| -class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
|
| +class _SceneSetListenerParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| ];
|
| - bool ok = false;
|
| + Object listener = null;
|
|
|
| - PingPongServicePingTargetUrlResponseParams() : super(kVersions.last.size);
|
| + _SceneSetListenerParams() : super(kVersions.last.size);
|
|
|
| - static PingPongServicePingTargetUrlResponseParams deserialize(bindings.Message message) {
|
| + static _SceneSetListenerParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -237,11 +285,11 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static PingPongServicePingTargetUrlResponseParams decode(bindings.Decoder decoder0) {
|
| + static _SceneSetListenerParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - PingPongServicePingTargetUrlResponseParams result = new PingPongServicePingTargetUrlResponseParams();
|
| + _SceneSetListenerParams result = new _SceneSetListenerParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -263,7 +311,7 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.ok = decoder0.decodeBool(8, 0);
|
| + result.listener = decoder0.decodeServiceInterface(8, true, SceneListenerProxy.newFromEndpoint);
|
| }
|
| return result;
|
| }
|
| @@ -271,32 +319,30 @@ class PingPongServicePingTargetUrlResponseParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeBool(ok, 8, 0);
|
| + encoder0.encodeInterface(listener, 8, true);
|
| }
|
|
|
| String toString() {
|
| - return "PingPongServicePingTargetUrlResponseParams("
|
| - "ok: $ok" ")";
|
| + return "_SceneSetListenerParams("
|
| + "listener: $listener" ")";
|
| }
|
|
|
| Map toJson() {
|
| - Map map = new Map();
|
| - map["ok"] = ok;
|
| - return map;
|
| + throw new bindings.MojoCodecError(
|
| + 'Object containing handles cannot be encoded to JSON.');
|
| }
|
| }
|
|
|
|
|
| -class _PingPongServicePingTargetServiceParams extends bindings.Struct {
|
| +class _SceneUpdateParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(24, 0)
|
| + const bindings.StructDataHeader(16, 0)
|
| ];
|
| - Object service = null;
|
| - int count = 0;
|
| + SceneUpdate update = null;
|
|
|
| - _PingPongServicePingTargetServiceParams() : super(kVersions.last.size);
|
| + _SceneUpdateParams() : super(kVersions.last.size);
|
|
|
| - static _PingPongServicePingTargetServiceParams deserialize(bindings.Message message) {
|
| + static _SceneUpdateParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -305,11 +351,11 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongServicePingTargetServiceParams decode(bindings.Decoder decoder0) {
|
| + static _SceneUpdateParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongServicePingTargetServiceParams result = new _PingPongServicePingTargetServiceParams();
|
| + _SceneUpdateParams result = new _SceneUpdateParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -331,11 +377,8 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.service = decoder0.decodeServiceInterface(8, false, PingPongServiceProxy.newFromEndpoint);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.count = decoder0.decodeUint16(16);
|
| + var decoder1 = decoder0.decodePointer(8, false);
|
| + result.update = SceneUpdate.decode(decoder1);
|
| }
|
| return result;
|
| }
|
| @@ -343,15 +386,12 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeInterface(service, 8, false);
|
| -
|
| - encoder0.encodeUint16(count, 16);
|
| + encoder0.encodeStruct(update, 8, false);
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongServicePingTargetServiceParams("
|
| - "service: $service" ", "
|
| - "count: $count" ")";
|
| + return "_SceneUpdateParams("
|
| + "update: $update" ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -361,15 +401,15 @@ class _PingPongServicePingTargetServiceParams extends bindings.Struct {
|
| }
|
|
|
|
|
| -class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
|
| +class _ScenePublishParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| ];
|
| - bool ok = false;
|
| + SceneMetadata metadata = null;
|
|
|
| - PingPongServicePingTargetServiceResponseParams() : super(kVersions.last.size);
|
| + _ScenePublishParams() : super(kVersions.last.size);
|
|
|
| - static PingPongServicePingTargetServiceResponseParams deserialize(bindings.Message message) {
|
| + static _ScenePublishParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -378,11 +418,11 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static PingPongServicePingTargetServiceResponseParams decode(bindings.Decoder decoder0) {
|
| + static _ScenePublishParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - PingPongServicePingTargetServiceResponseParams result = new PingPongServicePingTargetServiceResponseParams();
|
| + _ScenePublishParams result = new _ScenePublishParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -404,7 +444,8 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.ok = decoder0.decodeBool(8, 0);
|
| + var decoder1 = decoder0.decodePointer(8, true);
|
| + result.metadata = SceneMetadata.decode(decoder1);
|
| }
|
| return result;
|
| }
|
| @@ -412,31 +453,31 @@ class PingPongServicePingTargetServiceResponseParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeBool(ok, 8, 0);
|
| + encoder0.encodeStruct(metadata, 8, true);
|
| }
|
|
|
| String toString() {
|
| - return "PingPongServicePingTargetServiceResponseParams("
|
| - "ok: $ok" ")";
|
| + return "_ScenePublishParams("
|
| + "metadata: $metadata" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| - map["ok"] = ok;
|
| + map["metadata"] = metadata;
|
| return map;
|
| }
|
| }
|
|
|
|
|
| -class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
|
| +class _SceneGetSchedulerParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| ];
|
| - Object service = null;
|
| + Object scheduler = null;
|
|
|
| - _PingPongServiceGetPingPongServiceParams() : super(kVersions.last.size);
|
| + _SceneGetSchedulerParams() : super(kVersions.last.size);
|
|
|
| - static _PingPongServiceGetPingPongServiceParams deserialize(bindings.Message message) {
|
| + static _SceneGetSchedulerParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -445,11 +486,11 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongServiceGetPingPongServiceParams decode(bindings.Decoder decoder0) {
|
| + static _SceneGetSchedulerParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongServiceGetPingPongServiceParams result = new _PingPongServiceGetPingPongServiceParams();
|
| + _SceneGetSchedulerParams result = new _SceneGetSchedulerParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -471,7 +512,7 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.service = decoder0.decodeInterfaceRequest(8, false, PingPongServiceStub.newFromEndpoint);
|
| + result.scheduler = decoder0.decodeInterfaceRequest(8, false, scheduling_mojom.SceneSchedulerStub.newFromEndpoint);
|
| }
|
| return result;
|
| }
|
| @@ -479,12 +520,12 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeInterfaceRequest(service, 8, false);
|
| + encoder0.encodeInterfaceRequest(scheduler, 8, false);
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongServiceGetPingPongServiceParams("
|
| - "service: $service" ")";
|
| + return "_SceneGetSchedulerParams("
|
| + "scheduler: $scheduler" ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -494,14 +535,15 @@ class _PingPongServiceGetPingPongServiceParams extends bindings.Struct {
|
| }
|
|
|
|
|
| -class _PingPongServiceQuitParams extends bindings.Struct {
|
| +class _SceneListenerOnResourceUnavailableParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(8, 0)
|
| + const bindings.StructDataHeader(16, 0)
|
| ];
|
| + int resourceId = 0;
|
|
|
| - _PingPongServiceQuitParams() : super(kVersions.last.size);
|
| + _SceneListenerOnResourceUnavailableParams() : super(kVersions.last.size);
|
|
|
| - static _PingPongServiceQuitParams deserialize(bindings.Message message) {
|
| + static _SceneListenerOnResourceUnavailableParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -510,11 +552,11 @@ class _PingPongServiceQuitParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongServiceQuitParams decode(bindings.Decoder decoder0) {
|
| + static _SceneListenerOnResourceUnavailableParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongServiceQuitParams result = new _PingPongServiceQuitParams();
|
| + _SceneListenerOnResourceUnavailableParams result = new _SceneListenerOnResourceUnavailableParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -534,33 +576,40 @@ class _PingPongServiceQuitParams extends bindings.Struct {
|
| 'Message newer than the last known version cannot be shorter than '
|
| 'required by the last known version.');
|
| }
|
| + if (mainDataHeader.version >= 0) {
|
| +
|
| + result.resourceId = decoder0.decodeUint32(8);
|
| + }
|
| return result;
|
| }
|
|
|
| void encode(bindings.Encoder encoder) {
|
| - encoder.getStructEncoderAtOffset(kVersions.last);
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| +
|
| + encoder0.encodeUint32(resourceId, 8);
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongServiceQuitParams("")";
|
| + return "_SceneListenerOnResourceUnavailableParams("
|
| + "resourceId: $resourceId" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| + map["resourceId"] = resourceId;
|
| return map;
|
| }
|
| }
|
|
|
|
|
| -class _PingPongClientPongParams extends bindings.Struct {
|
| +class SceneListenerOnResourceUnavailableResponseParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(16, 0)
|
| + const bindings.StructDataHeader(8, 0)
|
| ];
|
| - int pongValue = 0;
|
|
|
| - _PingPongClientPongParams() : super(kVersions.last.size);
|
| + SceneListenerOnResourceUnavailableResponseParams() : super(kVersions.last.size);
|
|
|
| - static _PingPongClientPongParams deserialize(bindings.Message message) {
|
| + static SceneListenerOnResourceUnavailableResponseParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -569,11 +618,11 @@ class _PingPongClientPongParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _PingPongClientPongParams decode(bindings.Decoder decoder0) {
|
| + static SceneListenerOnResourceUnavailableResponseParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _PingPongClientPongParams result = new _PingPongClientPongParams();
|
| + SceneListenerOnResourceUnavailableResponseParams result = new SceneListenerOnResourceUnavailableResponseParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -593,106 +642,54 @@ class _PingPongClientPongParams extends bindings.Struct {
|
| 'Message newer than the last known version cannot be shorter than '
|
| 'required by the last known version.');
|
| }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.pongValue = decoder0.decodeUint16(8);
|
| - }
|
| return result;
|
| }
|
|
|
| void encode(bindings.Encoder encoder) {
|
| - var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| -
|
| - encoder0.encodeUint16(pongValue, 8);
|
| + encoder.getStructEncoderAtOffset(kVersions.last);
|
| }
|
|
|
| String toString() {
|
| - return "_PingPongClientPongParams("
|
| - "pongValue: $pongValue" ")";
|
| + return "SceneListenerOnResourceUnavailableResponseParams("")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| - map["pongValue"] = pongValue;
|
| return map;
|
| }
|
| }
|
|
|
| -const int _PingPongService_setClientName = 0;
|
| -const int _PingPongService_pingName = 1;
|
| -const int _PingPongService_pingTargetUrlName = 2;
|
| -const int _PingPongService_pingTargetServiceName = 3;
|
| -const int _PingPongService_getPingPongServiceName = 4;
|
| -const int _PingPongService_quitName = 5;
|
| -
|
| -abstract class PingPongService {
|
| - static const String serviceName = "test::PingPongService";
|
| - void setClient(Object client);
|
| - void ping(int pingValue);
|
| - dynamic pingTargetUrl(String url,int count,[Function responseFactory = null]);
|
| - dynamic pingTargetService(Object service,int count,[Function responseFactory = null]);
|
| - void getPingPongService(Object service);
|
| - void quit();
|
| +const int _Scene_setListenerName = 0;
|
| +const int _Scene_updateName = 1;
|
| +const int _Scene_publishName = 2;
|
| +const int _Scene_getSchedulerName = 3;
|
| +
|
| +abstract class Scene {
|
| + static const String serviceName = null;
|
| + void setListener(Object listener);
|
| + void update(SceneUpdate update);
|
| + void publish(SceneMetadata metadata);
|
| + void getScheduler(Object scheduler);
|
| }
|
|
|
|
|
| -class _PingPongServiceProxyImpl extends bindings.Proxy {
|
| - _PingPongServiceProxyImpl.fromEndpoint(
|
| +class _SceneProxyImpl extends bindings.Proxy {
|
| + _SceneProxyImpl.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
|
|
| - _PingPongServiceProxyImpl.fromHandle(core.MojoHandle handle) :
|
| + _SceneProxyImpl.fromHandle(core.MojoHandle handle) :
|
| super.fromHandle(handle);
|
|
|
| - _PingPongServiceProxyImpl.unbound() : super.unbound();
|
| + _SceneProxyImpl.unbound() : super.unbound();
|
|
|
| - static _PingPongServiceProxyImpl newFromEndpoint(
|
| + static _SceneProxyImpl newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For _PingPongServiceProxyImpl"));
|
| - return new _PingPongServiceProxyImpl.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For _SceneProxyImpl"));
|
| + return new _SceneProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| - case _PingPongService_pingTargetUrlName:
|
| - var r = PingPongServicePingTargetUrlResponseParams.deserialize(
|
| - message.payload);
|
| - if (!message.header.hasRequestId) {
|
| - proxyError("Expected a message with a valid request Id.");
|
| - return;
|
| - }
|
| - Completer c = completerMap[message.header.requestId];
|
| - if (c == null) {
|
| - proxyError(
|
| - "Message had unknown request Id: ${message.header.requestId}");
|
| - return;
|
| - }
|
| - completerMap.remove(message.header.requestId);
|
| - if (c.isCompleted) {
|
| - proxyError("Response completer already completed");
|
| - return;
|
| - }
|
| - c.complete(r);
|
| - break;
|
| - case _PingPongService_pingTargetServiceName:
|
| - var r = PingPongServicePingTargetServiceResponseParams.deserialize(
|
| - message.payload);
|
| - if (!message.header.hasRequestId) {
|
| - proxyError("Expected a message with a valid request Id.");
|
| - return;
|
| - }
|
| - Completer c = completerMap[message.header.requestId];
|
| - if (c == null) {
|
| - proxyError(
|
| - "Message had unknown request Id: ${message.header.requestId}");
|
| - return;
|
| - }
|
| - completerMap.remove(message.header.requestId);
|
| - if (c.isCompleted) {
|
| - proxyError("Response completer already completed");
|
| - return;
|
| - }
|
| - c.complete(r);
|
| - break;
|
| default:
|
| proxyError("Unexpected message type: ${message.header.type}");
|
| close(immediate: true);
|
| @@ -702,111 +699,92 @@ class _PingPongServiceProxyImpl extends bindings.Proxy {
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "_PingPongServiceProxyImpl($superString)";
|
| + return "_SceneProxyImpl($superString)";
|
| }
|
| }
|
|
|
|
|
| -class _PingPongServiceProxyCalls implements PingPongService {
|
| - _PingPongServiceProxyImpl _proxyImpl;
|
| +class _SceneProxyCalls implements Scene {
|
| + _SceneProxyImpl _proxyImpl;
|
|
|
| - _PingPongServiceProxyCalls(this._proxyImpl);
|
| - void setClient(Object client) {
|
| + _SceneProxyCalls(this._proxyImpl);
|
| + void setListener(Object listener) {
|
| if (!_proxyImpl.isBound) {
|
| _proxyImpl.proxyError("The Proxy is closed.");
|
| return;
|
| }
|
| - var params = new _PingPongServiceSetClientParams();
|
| - params.client = client;
|
| - _proxyImpl.sendMessage(params, _PingPongService_setClientName);
|
| + var params = new _SceneSetListenerParams();
|
| + params.listener = listener;
|
| + _proxyImpl.sendMessage(params, _Scene_setListenerName);
|
| }
|
| - void ping(int pingValue) {
|
| + void update(SceneUpdate update) {
|
| if (!_proxyImpl.isBound) {
|
| _proxyImpl.proxyError("The Proxy is closed.");
|
| return;
|
| }
|
| - var params = new _PingPongServicePingParams();
|
| - params.pingValue = pingValue;
|
| - _proxyImpl.sendMessage(params, _PingPongService_pingName);
|
| - }
|
| - dynamic pingTargetUrl(String url,int count,[Function responseFactory = null]) {
|
| - var params = new _PingPongServicePingTargetUrlParams();
|
| - params.url = url;
|
| - params.count = count;
|
| - return _proxyImpl.sendMessageWithRequestId(
|
| - params,
|
| - _PingPongService_pingTargetUrlName,
|
| - -1,
|
| - bindings.MessageHeader.kMessageExpectsResponse);
|
| - }
|
| - dynamic pingTargetService(Object service,int count,[Function responseFactory = null]) {
|
| - var params = new _PingPongServicePingTargetServiceParams();
|
| - params.service = service;
|
| - params.count = count;
|
| - return _proxyImpl.sendMessageWithRequestId(
|
| - params,
|
| - _PingPongService_pingTargetServiceName,
|
| - -1,
|
| - bindings.MessageHeader.kMessageExpectsResponse);
|
| + var params = new _SceneUpdateParams();
|
| + params.update = update;
|
| + _proxyImpl.sendMessage(params, _Scene_updateName);
|
| }
|
| - void getPingPongService(Object service) {
|
| + void publish(SceneMetadata metadata) {
|
| if (!_proxyImpl.isBound) {
|
| _proxyImpl.proxyError("The Proxy is closed.");
|
| return;
|
| }
|
| - var params = new _PingPongServiceGetPingPongServiceParams();
|
| - params.service = service;
|
| - _proxyImpl.sendMessage(params, _PingPongService_getPingPongServiceName);
|
| + var params = new _ScenePublishParams();
|
| + params.metadata = metadata;
|
| + _proxyImpl.sendMessage(params, _Scene_publishName);
|
| }
|
| - void quit() {
|
| + void getScheduler(Object scheduler) {
|
| if (!_proxyImpl.isBound) {
|
| _proxyImpl.proxyError("The Proxy is closed.");
|
| return;
|
| }
|
| - var params = new _PingPongServiceQuitParams();
|
| - _proxyImpl.sendMessage(params, _PingPongService_quitName);
|
| + var params = new _SceneGetSchedulerParams();
|
| + params.scheduler = scheduler;
|
| + _proxyImpl.sendMessage(params, _Scene_getSchedulerName);
|
| }
|
| }
|
|
|
|
|
| -class PingPongServiceProxy implements bindings.ProxyBase {
|
| +class SceneProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| - PingPongService ptr;
|
| + Scene ptr;
|
|
|
| - PingPongServiceProxy(_PingPongServiceProxyImpl proxyImpl) :
|
| + SceneProxy(_SceneProxyImpl proxyImpl) :
|
| impl = proxyImpl,
|
| - ptr = new _PingPongServiceProxyCalls(proxyImpl);
|
| + ptr = new _SceneProxyCalls(proxyImpl);
|
|
|
| - PingPongServiceProxy.fromEndpoint(
|
| + SceneProxy.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _PingPongServiceProxyImpl.fromEndpoint(endpoint) {
|
| - ptr = new _PingPongServiceProxyCalls(impl);
|
| + impl = new _SceneProxyImpl.fromEndpoint(endpoint) {
|
| + ptr = new _SceneProxyCalls(impl);
|
| }
|
|
|
| - PingPongServiceProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _PingPongServiceProxyImpl.fromHandle(handle) {
|
| - ptr = new _PingPongServiceProxyCalls(impl);
|
| + SceneProxy.fromHandle(core.MojoHandle handle) :
|
| + impl = new _SceneProxyImpl.fromHandle(handle) {
|
| + ptr = new _SceneProxyCalls(impl);
|
| }
|
|
|
| - PingPongServiceProxy.unbound() :
|
| - impl = new _PingPongServiceProxyImpl.unbound() {
|
| - ptr = new _PingPongServiceProxyCalls(impl);
|
| + SceneProxy.unbound() :
|
| + impl = new _SceneProxyImpl.unbound() {
|
| + ptr = new _SceneProxyCalls(impl);
|
| }
|
|
|
| - factory PingPongServiceProxy.connectToService(
|
| + factory SceneProxy.connectToService(
|
| bindings.ServiceConnector s, String url, [String serviceName]) {
|
| - PingPongServiceProxy p = new PingPongServiceProxy.unbound();
|
| + SceneProxy p = new SceneProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| }
|
|
|
| - static PingPongServiceProxy newFromEndpoint(
|
| + static SceneProxy newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For PingPongServiceProxy"));
|
| - return new PingPongServiceProxy.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For SceneProxy"));
|
| + return new SceneProxy.fromEndpoint(endpoint);
|
| }
|
|
|
| - String get serviceName => PingPongService.serviceName;
|
| + String get serviceName => Scene.serviceName;
|
|
|
| Future close({bool immediate: false}) => impl.close(immediate: immediate);
|
|
|
| @@ -823,40 +801,30 @@ class PingPongServiceProxy implements bindings.ProxyBase {
|
| }
|
|
|
| String toString() {
|
| - return "PingPongServiceProxy($impl)";
|
| + return "SceneProxy($impl)";
|
| }
|
| }
|
|
|
|
|
| -class PingPongServiceStub extends bindings.Stub {
|
| - PingPongService _impl = null;
|
| +class SceneStub extends bindings.Stub {
|
| + Scene _impl = null;
|
|
|
| - PingPongServiceStub.fromEndpoint(
|
| + SceneStub.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| - PingPongServiceStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| + SceneStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| : super.fromHandle(handle);
|
|
|
| - PingPongServiceStub.unbound() : super.unbound();
|
| + SceneStub.unbound() : super.unbound();
|
|
|
| - static PingPongServiceStub newFromEndpoint(
|
| + static SceneStub newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For PingPongServiceStub"));
|
| - return new PingPongServiceStub.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For SceneStub"));
|
| + return new SceneStub.fromEndpoint(endpoint);
|
| }
|
|
|
|
|
| - PingPongServicePingTargetUrlResponseParams _PingPongServicePingTargetUrlResponseParamsFactory(bool ok) {
|
| - var mojo_factory_result = new PingPongServicePingTargetUrlResponseParams();
|
| - mojo_factory_result.ok = ok;
|
| - return mojo_factory_result;
|
| - }
|
| - PingPongServicePingTargetServiceResponseParams _PingPongServicePingTargetServiceResponseParamsFactory(bool ok) {
|
| - var mojo_factory_result = new PingPongServicePingTargetServiceResponseParams();
|
| - mojo_factory_result.ok = ok;
|
| - return mojo_factory_result;
|
| - }
|
|
|
| dynamic handleMessage(bindings.ServiceMessage message) {
|
| if (bindings.ControlMessageHandler.isControlMessage(message)) {
|
| @@ -866,69 +834,25 @@ class PingPongServiceStub extends bindings.Stub {
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| - case _PingPongService_setClientName:
|
| - var params = _PingPongServiceSetClientParams.deserialize(
|
| - message.payload);
|
| - _impl.setClient(params.client);
|
| - break;
|
| - case _PingPongService_pingName:
|
| - var params = _PingPongServicePingParams.deserialize(
|
| + case _Scene_setListenerName:
|
| + var params = _SceneSetListenerParams.deserialize(
|
| message.payload);
|
| - _impl.ping(params.pingValue);
|
| - break;
|
| - case _PingPongService_pingTargetUrlName:
|
| - var params = _PingPongServicePingTargetUrlParams.deserialize(
|
| - message.payload);
|
| - var response = _impl.pingTargetUrl(params.url,params.count,_PingPongServicePingTargetUrlResponseParamsFactory);
|
| - if (response is Future) {
|
| - return response.then((response) {
|
| - if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _PingPongService_pingTargetUrlName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| - });
|
| - } else if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _PingPongService_pingTargetUrlName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| + _impl.setListener(params.listener);
|
| break;
|
| - case _PingPongService_pingTargetServiceName:
|
| - var params = _PingPongServicePingTargetServiceParams.deserialize(
|
| + case _Scene_updateName:
|
| + var params = _SceneUpdateParams.deserialize(
|
| message.payload);
|
| - var response = _impl.pingTargetService(params.service,params.count,_PingPongServicePingTargetServiceResponseParamsFactory);
|
| - if (response is Future) {
|
| - return response.then((response) {
|
| - if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _PingPongService_pingTargetServiceName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| - });
|
| - } else if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _PingPongService_pingTargetServiceName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| + _impl.update(params.update);
|
| break;
|
| - case _PingPongService_getPingPongServiceName:
|
| - var params = _PingPongServiceGetPingPongServiceParams.deserialize(
|
| + case _Scene_publishName:
|
| + var params = _ScenePublishParams.deserialize(
|
| message.payload);
|
| - _impl.getPingPongService(params.service);
|
| + _impl.publish(params.metadata);
|
| break;
|
| - case _PingPongService_quitName:
|
| - var params = _PingPongServiceQuitParams.deserialize(
|
| + case _Scene_getSchedulerName:
|
| + var params = _SceneGetSchedulerParams.deserialize(
|
| message.payload);
|
| - _impl.quit();
|
| + _impl.getScheduler(params.scheduler);
|
| break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| @@ -937,45 +861,65 @@ class PingPongServiceStub extends bindings.Stub {
|
| return null;
|
| }
|
|
|
| - PingPongService get impl => _impl;
|
| - set impl(PingPongService d) {
|
| + Scene get impl => _impl;
|
| + set impl(Scene d) {
|
| assert(_impl == null);
|
| _impl = d;
|
| }
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "PingPongServiceStub($superString)";
|
| + return "SceneStub($superString)";
|
| }
|
|
|
| int get version => 0;
|
| }
|
|
|
| -const int _PingPongClient_pongName = 0;
|
| +const int _SceneListener_onResourceUnavailableName = 0;
|
|
|
| -abstract class PingPongClient {
|
| +abstract class SceneListener {
|
| static const String serviceName = null;
|
| - void pong(int pongValue);
|
| + dynamic onResourceUnavailable(int resourceId,[Function responseFactory = null]);
|
| }
|
|
|
|
|
| -class _PingPongClientProxyImpl extends bindings.Proxy {
|
| - _PingPongClientProxyImpl.fromEndpoint(
|
| +class _SceneListenerProxyImpl extends bindings.Proxy {
|
| + _SceneListenerProxyImpl.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
|
|
| - _PingPongClientProxyImpl.fromHandle(core.MojoHandle handle) :
|
| + _SceneListenerProxyImpl.fromHandle(core.MojoHandle handle) :
|
| super.fromHandle(handle);
|
|
|
| - _PingPongClientProxyImpl.unbound() : super.unbound();
|
| + _SceneListenerProxyImpl.unbound() : super.unbound();
|
|
|
| - static _PingPongClientProxyImpl newFromEndpoint(
|
| + static _SceneListenerProxyImpl newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For _PingPongClientProxyImpl"));
|
| - return new _PingPongClientProxyImpl.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For _SceneListenerProxyImpl"));
|
| + return new _SceneListenerProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| + case _SceneListener_onResourceUnavailableName:
|
| + var r = SceneListenerOnResourceUnavailableResponseParams.deserialize(
|
| + message.payload);
|
| + if (!message.header.hasRequestId) {
|
| + proxyError("Expected a message with a valid request Id.");
|
| + return;
|
| + }
|
| + Completer c = completerMap[message.header.requestId];
|
| + if (c == null) {
|
| + proxyError(
|
| + "Message had unknown request Id: ${message.header.requestId}");
|
| + return;
|
| + }
|
| + completerMap.remove(message.header.requestId);
|
| + if (c.isCompleted) {
|
| + proxyError("Response completer already completed");
|
| + return;
|
| + }
|
| + c.complete(r);
|
| + break;
|
| default:
|
| proxyError("Unexpected message type: ${message.header.type}");
|
| close(immediate: true);
|
| @@ -985,65 +929,65 @@ class _PingPongClientProxyImpl extends bindings.Proxy {
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "_PingPongClientProxyImpl($superString)";
|
| + return "_SceneListenerProxyImpl($superString)";
|
| }
|
| }
|
|
|
|
|
| -class _PingPongClientProxyCalls implements PingPongClient {
|
| - _PingPongClientProxyImpl _proxyImpl;
|
| +class _SceneListenerProxyCalls implements SceneListener {
|
| + _SceneListenerProxyImpl _proxyImpl;
|
|
|
| - _PingPongClientProxyCalls(this._proxyImpl);
|
| - void pong(int pongValue) {
|
| - if (!_proxyImpl.isBound) {
|
| - _proxyImpl.proxyError("The Proxy is closed.");
|
| - return;
|
| - }
|
| - var params = new _PingPongClientPongParams();
|
| - params.pongValue = pongValue;
|
| - _proxyImpl.sendMessage(params, _PingPongClient_pongName);
|
| + _SceneListenerProxyCalls(this._proxyImpl);
|
| + dynamic onResourceUnavailable(int resourceId,[Function responseFactory = null]) {
|
| + var params = new _SceneListenerOnResourceUnavailableParams();
|
| + params.resourceId = resourceId;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _SceneListener_onResourceUnavailableName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| }
|
| }
|
|
|
|
|
| -class PingPongClientProxy implements bindings.ProxyBase {
|
| +class SceneListenerProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| - PingPongClient ptr;
|
| + SceneListener ptr;
|
|
|
| - PingPongClientProxy(_PingPongClientProxyImpl proxyImpl) :
|
| + SceneListenerProxy(_SceneListenerProxyImpl proxyImpl) :
|
| impl = proxyImpl,
|
| - ptr = new _PingPongClientProxyCalls(proxyImpl);
|
| + ptr = new _SceneListenerProxyCalls(proxyImpl);
|
|
|
| - PingPongClientProxy.fromEndpoint(
|
| + SceneListenerProxy.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _PingPongClientProxyImpl.fromEndpoint(endpoint) {
|
| - ptr = new _PingPongClientProxyCalls(impl);
|
| + impl = new _SceneListenerProxyImpl.fromEndpoint(endpoint) {
|
| + ptr = new _SceneListenerProxyCalls(impl);
|
| }
|
|
|
| - PingPongClientProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _PingPongClientProxyImpl.fromHandle(handle) {
|
| - ptr = new _PingPongClientProxyCalls(impl);
|
| + SceneListenerProxy.fromHandle(core.MojoHandle handle) :
|
| + impl = new _SceneListenerProxyImpl.fromHandle(handle) {
|
| + ptr = new _SceneListenerProxyCalls(impl);
|
| }
|
|
|
| - PingPongClientProxy.unbound() :
|
| - impl = new _PingPongClientProxyImpl.unbound() {
|
| - ptr = new _PingPongClientProxyCalls(impl);
|
| + SceneListenerProxy.unbound() :
|
| + impl = new _SceneListenerProxyImpl.unbound() {
|
| + ptr = new _SceneListenerProxyCalls(impl);
|
| }
|
|
|
| - factory PingPongClientProxy.connectToService(
|
| + factory SceneListenerProxy.connectToService(
|
| bindings.ServiceConnector s, String url, [String serviceName]) {
|
| - PingPongClientProxy p = new PingPongClientProxy.unbound();
|
| + SceneListenerProxy p = new SceneListenerProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| }
|
|
|
| - static PingPongClientProxy newFromEndpoint(
|
| + static SceneListenerProxy newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For PingPongClientProxy"));
|
| - return new PingPongClientProxy.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For SceneListenerProxy"));
|
| + return new SceneListenerProxy.fromEndpoint(endpoint);
|
| }
|
|
|
| - String get serviceName => PingPongClient.serviceName;
|
| + String get serviceName => SceneListener.serviceName;
|
|
|
| Future close({bool immediate: false}) => impl.close(immediate: immediate);
|
|
|
| @@ -1060,30 +1004,34 @@ class PingPongClientProxy implements bindings.ProxyBase {
|
| }
|
|
|
| String toString() {
|
| - return "PingPongClientProxy($impl)";
|
| + return "SceneListenerProxy($impl)";
|
| }
|
| }
|
|
|
|
|
| -class PingPongClientStub extends bindings.Stub {
|
| - PingPongClient _impl = null;
|
| +class SceneListenerStub extends bindings.Stub {
|
| + SceneListener _impl = null;
|
|
|
| - PingPongClientStub.fromEndpoint(
|
| + SceneListenerStub.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| - PingPongClientStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| + SceneListenerStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| : super.fromHandle(handle);
|
|
|
| - PingPongClientStub.unbound() : super.unbound();
|
| + SceneListenerStub.unbound() : super.unbound();
|
|
|
| - static PingPongClientStub newFromEndpoint(
|
| + static SceneListenerStub newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For PingPongClientStub"));
|
| - return new PingPongClientStub.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For SceneListenerStub"));
|
| + return new SceneListenerStub.fromEndpoint(endpoint);
|
| }
|
|
|
|
|
| + SceneListenerOnResourceUnavailableResponseParams _SceneListenerOnResourceUnavailableResponseParamsFactory() {
|
| + var mojo_factory_result = new SceneListenerOnResourceUnavailableResponseParams();
|
| + return mojo_factory_result;
|
| + }
|
|
|
| dynamic handleMessage(bindings.ServiceMessage message) {
|
| if (bindings.ControlMessageHandler.isControlMessage(message)) {
|
| @@ -1093,10 +1041,27 @@ class PingPongClientStub extends bindings.Stub {
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| - case _PingPongClient_pongName:
|
| - var params = _PingPongClientPongParams.deserialize(
|
| + case _SceneListener_onResourceUnavailableName:
|
| + var params = _SceneListenerOnResourceUnavailableParams.deserialize(
|
| message.payload);
|
| - _impl.pong(params.pongValue);
|
| + var response = _impl.onResourceUnavailable(params.resourceId,_SceneListenerOnResourceUnavailableResponseParamsFactory);
|
| + if (response is Future) {
|
| + return response.then((response) {
|
| + if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _SceneListener_onResourceUnavailableName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + });
|
| + } else if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _SceneListener_onResourceUnavailableName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| @@ -1105,15 +1070,15 @@ class PingPongClientStub extends bindings.Stub {
|
| return null;
|
| }
|
|
|
| - PingPongClient get impl => _impl;
|
| - set impl(PingPongClient d) {
|
| + SceneListener get impl => _impl;
|
| + set impl(SceneListener d) {
|
| assert(_impl == null);
|
| _impl = d;
|
| }
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "PingPongClientStub($superString)";
|
| + return "SceneListenerStub($superString)";
|
| }
|
|
|
| int get version => 0;
|
|
|