Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Update to master and regenerate mojoms Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart b/mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart
index 82bcd2a5c5c5fc959a9b7633814723e96614c8a9..0405d9bacf8449ba6049062397f730df16a6d81a 100644
--- a/mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/speech_recognizer/speech_recognizer.mojom.dart
@@ -5,10 +5,12 @@
library speech_recognizer_mojom;
import 'dart:async';
+import 'dart:collection';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
-
+import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
+import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
class Error extends bindings.MojoEnum {
static const Error networkTimeout = const Error._(1);
static const Error network = const Error._(2);
@@ -102,12 +104,49 @@ class Error extends bindings.MojoEnum {
return 'Error.recognizerBusy';
case insufficientPermissions:
return 'Error.insufficientPermissions';
+ default:
+ return null;
}
}
int toJson() => mojoEnumValue;
}
+mojom_types.MojomEnum _speech_recognizer_Error__() {
+ return new mojom_types.MojomEnum()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Error'
+ ..fullIdentifier = 'speech_recognizer.Error')
+ ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'NetworkTimeout')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 1,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Network')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 2,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Audio')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 3,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Server')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 4,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Client')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 5,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'SpeechTimeout')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 6,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'NoMatch')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 7,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'RecognizerBusy')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 8,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'InsufficientPermissions')
+ ..enumTypeKey = '_speech_recognizer_Error__'
+ ..intValue = 9,];
+}
+
class UtteranceCandidate extends bindings.Struct {
@@ -184,6 +223,22 @@ class UtteranceCandidate extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _speech_recognizer_UtteranceCandidate__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'UtteranceCandidate'
+ ..fullIdentifier = 'speech_recognizer.UtteranceCandidate')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Text')
+ ..type = (new mojom_types.Type()
+..stringType = (new mojom_types.StringType()..nullable = false)),
+
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'ConfidenceScore')
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.float),
+ ];
+}
class _SpeechRecognizerServiceListenParams extends bindings.Struct {
@@ -242,6 +297,13 @@ class _SpeechRecognizerServiceListenParams extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _speech_recognizer_SpeechRecognizerService_Listen_Params__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = '_SpeechRecognizerServiceListenParams'
+ ..fullIdentifier = 'speech_recognizer._SpeechRecognizerServiceListenParams')
+ ..fields = <mojom_types.StructField>[];
+}
class SpeechRecognizerServiceListenResponseParams extends bindings.Struct {
@@ -313,6 +375,22 @@ class SpeechRecognizerServiceListenResponseParams extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _speech_recognizer_SpeechRecognizerService_Listen_ResponseParams__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'SpeechRecognizerServiceListenResponseParams'
+ ..fullIdentifier = 'speech_recognizer.SpeechRecognizerServiceListenResponseParams')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'ResultOrError')
+ ..type = (new mojom_types.Type()
+ ..typeReference = (new mojom_types.TypeReference()
+
+ ..identifier = '_speech_recognizer_ResultOrError__'
+ ..typeKey = '_speech_recognizer_ResultOrError__'
+ )),
+ ];
+}
class _SpeechRecognizerServiceStopListeningParams extends bindings.Struct {
@@ -371,6 +449,13 @@ class _SpeechRecognizerServiceStopListeningParams extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _speech_recognizer_SpeechRecognizerService_StopListening_Params__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = '_SpeechRecognizerServiceStopListeningParams'
+ ..fullIdentifier = 'speech_recognizer._SpeechRecognizerServiceStopListeningParams')
+ ..fields = <mojom_types.StructField>[];
+}
@@ -498,9 +583,67 @@ class ResultOrError extends bindings.Union {
return result;
}
}
+
+mojom_types.MojomUnion _speech_recognizer_ResultOrError__() {
+ return new mojom_types.MojomUnion()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'ResultOrError'
+ ..fullIdentifier = 'speech_recognizer.ResultOrError')
+ ..fields = <mojom_types.UnionField>[
+ new mojom_types.UnionField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'ErrorCode')
+ ..type = (new mojom_types.Type()
+ ..typeReference = (new mojom_types.TypeReference()
+
+ ..identifier = '_speech_recognizer_Error__'
+ ..typeKey = '_speech_recognizer_Error__'
+ ))
+ ..tag = 0,
+
+ new mojom_types.UnionField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Results')
+ ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType()
+ ..elementType = (new mojom_types.Type()
+ ..typeReference = (new mojom_types.TypeReference()
+
+ ..identifier = '_speech_recognizer_UtteranceCandidate__'
+ ..typeKey = '_speech_recognizer_UtteranceCandidate__'
+ ))))
+ ..tag = 1,
+ ];
+}
+
const int _SpeechRecognizerService_listenName = 0;
const int _SpeechRecognizerService_stopListeningName = 1;
+mojom_types.MojomInterface _speech_recognizer_SpeechRecognizerService__() {
+ return new mojom_types.MojomInterface()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'SpeechRecognizerService'
+ ..fullIdentifier = 'speech_recognizer.SpeechRecognizerService')
+ ..interfaceName = 'SpeechRecognizerService'
+ ..methods = <int, mojom_types.MojomMethod>{
+_SpeechRecognizerService_listenName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Listen')
+ ..ordinal = _SpeechRecognizerService_listenName
+ ..responseParams = _speech_recognizer_SpeechRecognizerService_Listen_ResponseParams__()..parameters = _speech_recognizer_SpeechRecognizerService_Listen_Params__(),_SpeechRecognizerService_stopListeningName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'StopListening')
+ ..ordinal = _SpeechRecognizerService_stopListeningName..parameters = _speech_recognizer_SpeechRecognizerService_StopListening_Params__(),
+ };
+}
+
+class _SpeechRecognizerServiceServiceDescription implements service_describer.ServiceDescription {
+dynamic getTopLevelInterface([Function responseFactory = null]) {
+ return _speech_recognizer_SpeechRecognizerService__();
+ }
+ dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
+ return getAllMojomTypeDefinitions()[typeKey];
+ }
+ dynamic getAllTypeDefinitions([Function responseFactory = null]) {
+ return getAllMojomTypeDefinitions();
+ }
+}
+
abstract class SpeechRecognizerService {
static const String serviceName = "speech_recognizer::SpeechRecognizerService";
dynamic listen([Function responseFactory = null]);
@@ -523,6 +666,9 @@ class _SpeechRecognizerServiceProxyImpl extends bindings.Proxy {
return new _SpeechRecognizerServiceProxyImpl.fromEndpoint(endpoint);
}
+ service_describer.ServiceDescription get serviceDescription =>
+ new _SpeechRecognizerServiceServiceDescription();
+
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _SpeechRecognizerService_listenName:
@@ -720,6 +866,50 @@ class SpeechRecognizerServiceStub extends bindings.Stub {
}
int get version => 0;
+
+
+ service_describer.ServiceDescription get serviceDescription =>
+ new _SpeechRecognizerServiceServiceDescription();
}
+
+
+
+
+
+Map<String, mojom_types.UserDefinedType> _initDescriptions() {
+ var map = new HashMap<String, mojom_types.UserDefinedType>();
+map["_speech_recognizer_Error__"] =
+ new mojom_types.UserDefinedType()
+ ..enumType = _speech_recognizer_Error__();
+map["_speech_recognizer_UtteranceCandidate__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _speech_recognizer_UtteranceCandidate__();
+map["_speech_recognizer_SpeechRecognizerService_Listen_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _speech_recognizer_SpeechRecognizerService_Listen_Params__();
+map["_speech_recognizer_SpeechRecognizerService_Listen_ResponseParams__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _speech_recognizer_SpeechRecognizerService_Listen_ResponseParams__();
+map["_speech_recognizer_SpeechRecognizerService_StopListening_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _speech_recognizer_SpeechRecognizerService_StopListening_Params__();
+map["_speech_recognizer_ResultOrError__"] =
+ new mojom_types.UserDefinedType()
+ ..unionType = _speech_recognizer_ResultOrError__();
+map["_speech_recognizer_SpeechRecognizerService__"] =
+ new mojom_types.UserDefinedType()
+ ..interfaceType = _speech_recognizer_SpeechRecognizerService__();
+
+ return map;
+}
+
+var _MojomDesc;
+Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
+ if (_MojomDesc == null) {
+ _MojomDesc = _initDescriptions();
+ }
+ return _MojomDesc;
+}
+

Powered by Google App Engine
This is Rietveld 408576698