| Index: mojo/dart/packages/mojo_services/lib/mojo/flog/flog.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/flog/flog.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/flog/flog.mojom.dart
|
| index 6933cc486a2b551744752b494fda9cdac348ee98..97f964dd4a1432c964f1593d9608a20ff7a182ae 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/flog/flog.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/flog/flog.mojom.dart
|
| @@ -12,14 +12,11 @@ import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
|
|
|
| class FlogDescription extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(48, 0)
|
| + const bindings.StructDataHeader(24, 0)
|
| ];
|
| - String label = null;
|
| int logId = 0;
|
| - int entryCount = 0;
|
| - int startTimeUs = 0;
|
| - int stopTimeUs = 0;
|
| bool open = false;
|
| + String label = null;
|
|
|
| FlogDescription() : super(kVersions.last.size);
|
|
|
| @@ -58,27 +55,15 @@ class FlogDescription extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.label = decoder0.decodeString(8, false);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.logId = decoder0.decodeUint32(16);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.entryCount = decoder0.decodeUint32(20);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.startTimeUs = decoder0.decodeInt64(24);
|
| + result.logId = decoder0.decodeUint32(8);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.stopTimeUs = decoder0.decodeInt64(32);
|
| + result.open = decoder0.decodeBool(12, 0);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.open = decoder0.decodeBool(40, 0);
|
| + result.label = decoder0.decodeString(16, false);
|
| }
|
| return result;
|
| }
|
| @@ -86,67 +71,40 @@ class FlogDescription extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| - encoder0.encodeString(label, 8, false);
|
| - } on bindings.MojoCodecError catch(e) {
|
| - e.message = "Error encountered while encoding field "
|
| - "label of struct FlogDescription: $e";
|
| - rethrow;
|
| - }
|
| - try {
|
| - encoder0.encodeUint32(logId, 16);
|
| + encoder0.encodeUint32(logId, 8);
|
| } on bindings.MojoCodecError catch(e) {
|
| e.message = "Error encountered while encoding field "
|
| "logId of struct FlogDescription: $e";
|
| rethrow;
|
| }
|
| try {
|
| - encoder0.encodeUint32(entryCount, 20);
|
| - } on bindings.MojoCodecError catch(e) {
|
| - e.message = "Error encountered while encoding field "
|
| - "entryCount of struct FlogDescription: $e";
|
| - rethrow;
|
| - }
|
| - try {
|
| - encoder0.encodeInt64(startTimeUs, 24);
|
| - } on bindings.MojoCodecError catch(e) {
|
| - e.message = "Error encountered while encoding field "
|
| - "startTimeUs of struct FlogDescription: $e";
|
| - rethrow;
|
| - }
|
| - try {
|
| - encoder0.encodeInt64(stopTimeUs, 32);
|
| + encoder0.encodeBool(open, 12, 0);
|
| } on bindings.MojoCodecError catch(e) {
|
| e.message = "Error encountered while encoding field "
|
| - "stopTimeUs of struct FlogDescription: $e";
|
| + "open of struct FlogDescription: $e";
|
| rethrow;
|
| }
|
| try {
|
| - encoder0.encodeBool(open, 40, 0);
|
| + encoder0.encodeString(label, 16, false);
|
| } on bindings.MojoCodecError catch(e) {
|
| e.message = "Error encountered while encoding field "
|
| - "open of struct FlogDescription: $e";
|
| + "label of struct FlogDescription: $e";
|
| rethrow;
|
| }
|
| }
|
|
|
| String toString() {
|
| return "FlogDescription("
|
| - "label: $label" ", "
|
| "logId: $logId" ", "
|
| - "entryCount: $entryCount" ", "
|
| - "startTimeUs: $startTimeUs" ", "
|
| - "stopTimeUs: $stopTimeUs" ", "
|
| - "open: $open" ")";
|
| + "open: $open" ", "
|
| + "label: $label" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| - map["label"] = label;
|
| map["logId"] = logId;
|
| - map["entryCount"] = entryCount;
|
| - map["startTimeUs"] = startTimeUs;
|
| - map["stopTimeUs"] = stopTimeUs;
|
| map["open"] = open;
|
| + map["label"] = label;
|
| return map;
|
| }
|
| }
|
| @@ -410,6 +368,64 @@ class FlogChannelMessageEntryDetails extends bindings.Struct {
|
| }
|
|
|
|
|
| +class FlogChannelDeletionEntryDetails extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(8, 0)
|
| + ];
|
| +
|
| + FlogChannelDeletionEntryDetails() : super(kVersions.last.size);
|
| +
|
| + static FlogChannelDeletionEntryDetails deserialize(bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static FlogChannelDeletionEntryDetails decode(bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + FlogChannelDeletionEntryDetails result = new FlogChannelDeletionEntryDetails();
|
| +
|
| + 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;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } 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.');
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + encoder.getStructEncoderAtOffset(kVersions.last);
|
| + }
|
| +
|
| + String toString() {
|
| + return "FlogChannelDeletionEntryDetails("")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + Map map = new Map();
|
| + return map;
|
| + }
|
| +}
|
| +
|
| +
|
| class _FlogServiceCreateLoggerParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(24, 0)
|
| @@ -1098,11 +1114,9 @@ class _FlogReaderGetEntriesParams extends bindings.Struct {
|
|
|
| class FlogReaderGetEntriesResponseParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(24, 0)
|
| + const bindings.StructDataHeader(16, 0)
|
| ];
|
| List<FlogEntry> entries = null;
|
| - int entryCount = 0;
|
| - bool open = false;
|
|
|
| FlogReaderGetEntriesResponseParams() : super(kVersions.last.size);
|
|
|
| @@ -1152,14 +1166,6 @@ class FlogReaderGetEntriesResponseParams extends bindings.Struct {
|
| }
|
| }
|
| }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.entryCount = decoder0.decodeUint32(16);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.open = decoder0.decodeBool(20, 0);
|
| - }
|
| return result;
|
| }
|
|
|
| @@ -1179,34 +1185,16 @@ class FlogReaderGetEntriesResponseParams extends bindings.Struct {
|
| "entries of struct FlogReaderGetEntriesResponseParams: $e";
|
| rethrow;
|
| }
|
| - try {
|
| - encoder0.encodeUint32(entryCount, 16);
|
| - } on bindings.MojoCodecError catch(e) {
|
| - e.message = "Error encountered while encoding field "
|
| - "entryCount of struct FlogReaderGetEntriesResponseParams: $e";
|
| - rethrow;
|
| - }
|
| - try {
|
| - encoder0.encodeBool(open, 20, 0);
|
| - } on bindings.MojoCodecError catch(e) {
|
| - e.message = "Error encountered while encoding field "
|
| - "open of struct FlogReaderGetEntriesResponseParams: $e";
|
| - rethrow;
|
| - }
|
| }
|
|
|
| String toString() {
|
| return "FlogReaderGetEntriesResponseParams("
|
| - "entries: $entries" ", "
|
| - "entryCount: $entryCount" ", "
|
| - "open: $open" ")";
|
| + "entries: $entries" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| map["entries"] = entries;
|
| - map["entryCount"] = entryCount;
|
| - map["open"] = open;
|
| return map;
|
| }
|
| }
|
| @@ -1216,6 +1204,7 @@ class FlogReaderGetEntriesResponseParams extends bindings.Struct {
|
| enum FlogEntryDetailsTag {
|
| channelCreation,
|
| channelMessage,
|
| + channelDeletion,
|
| unknown
|
| }
|
|
|
| @@ -1223,11 +1212,13 @@ class FlogEntryDetails extends bindings.Union {
|
| static final _tagToInt = const {
|
| FlogEntryDetailsTag.channelCreation: 0,
|
| FlogEntryDetailsTag.channelMessage: 1,
|
| + FlogEntryDetailsTag.channelDeletion: 2,
|
| };
|
|
|
| static final _intToTag = const {
|
| 0: FlogEntryDetailsTag.channelCreation,
|
| 1: FlogEntryDetailsTag.channelMessage,
|
| + 2: FlogEntryDetailsTag.channelDeletion,
|
| };
|
|
|
| var _data;
|
| @@ -1256,6 +1247,17 @@ class FlogEntryDetails extends bindings.Union {
|
| _tag = FlogEntryDetailsTag.channelMessage;
|
| _data = value;
|
| }
|
| + FlogChannelDeletionEntryDetails get channelDeletion {
|
| + if (_tag != FlogEntryDetailsTag.channelDeletion) {
|
| + throw new bindings.UnsetUnionTagError(_tag, FlogEntryDetailsTag.channelDeletion);
|
| + }
|
| + return _data;
|
| + }
|
| +
|
| + set channelDeletion(FlogChannelDeletionEntryDetails value) {
|
| + _tag = FlogEntryDetailsTag.channelDeletion;
|
| + _data = value;
|
| + }
|
|
|
| static FlogEntryDetails decode(bindings.Decoder decoder0, int offset) {
|
| int size = decoder0.decodeUint32(offset);
|
| @@ -1277,6 +1279,11 @@ class FlogEntryDetails extends bindings.Union {
|
| var decoder1 = decoder0.decodePointer(offset + 8, false);
|
| result.channelMessage = FlogChannelMessageEntryDetails.decode(decoder1);
|
| break;
|
| + case FlogEntryDetailsTag.channelDeletion:
|
| +
|
| + var decoder1 = decoder0.decodePointer(offset + 8, false);
|
| + result.channelDeletion = FlogChannelDeletionEntryDetails.decode(decoder1);
|
| + break;
|
| default:
|
| throw new bindings.MojoCodecError("Bad union tag: $tag");
|
| }
|
| @@ -1295,6 +1302,9 @@ class FlogEntryDetails extends bindings.Union {
|
| case FlogEntryDetailsTag.channelMessage:
|
| encoder0.encodeStruct(channelMessage, offset + 8, false);
|
| break;
|
| + case FlogEntryDetailsTag.channelDeletion:
|
| + encoder0.encodeStruct(channelDeletion, offset + 8, false);
|
| + break;
|
| default:
|
| throw new bindings.MojoCodecError("Bad union tag: $_tag");
|
| }
|
| @@ -1309,6 +1319,9 @@ class FlogEntryDetails extends bindings.Union {
|
| case FlogEntryDetailsTag.channelMessage:
|
| result += "channelMessage";
|
| break;
|
| + case FlogEntryDetailsTag.channelDeletion:
|
| + result += "channelDeletion";
|
| + break;
|
| default:
|
| result += "unknown";
|
| }
|
| @@ -2110,11 +2123,9 @@ class _FlogReaderStubControl
|
| String get serviceName => FlogReader.serviceName;
|
|
|
|
|
| - static FlogReaderGetEntriesResponseParams _flogReaderGetEntriesResponseParamsFactory(List<FlogEntry> entries, int entryCount, bool open) {
|
| + static FlogReaderGetEntriesResponseParams _flogReaderGetEntriesResponseParamsFactory(List<FlogEntry> entries) {
|
| var result = new FlogReaderGetEntriesResponseParams();
|
| result.entries = entries;
|
| - result.entryCount = entryCount;
|
| - result.open = open;
|
| return result;
|
| }
|
|
|
|
|