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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Move and Standardize Mojom Type Functions 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_for_test_only/lib/math/math_calculator.mojom.dart
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
index 0d1358afc7b59a79ebf8c5805b392ac22a2af4cf..5a15bdaee52519905d2b4f3ae825507d658826ad 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/math/math_calculator.mojom.dart
@@ -5,9 +5,12 @@
library math_calculator_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;
@@ -68,6 +71,14 @@ class _CalculatorClearParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorClearParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorClearParams'
+ ..fullIdentifier = 'math.Calculator_Clear_Params')
+ ..fields = <mojom_types.StructField>[];
+}
+
class CalculatorClearResponseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -135,6 +146,19 @@ class CalculatorClearResponseParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorClearResponseParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorClearResponseParams'
+ ..fullIdentifier = 'math.Calculator_Clear_ResponseParams')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Value')
+ ..type = (new mojom_types.Type()
+ ..simpleType = mojom_types.SimpleType.double),];
+}
+
class _CalculatorAddParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -202,6 +226,19 @@ class _CalculatorAddParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorAddParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorAddParams'
+ ..fullIdentifier = 'math.Calculator_Add_Params')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Value')
+ ..type = (new mojom_types.Type()
+ ..simpleType = mojom_types.SimpleType.double),];
+}
+
class CalculatorAddResponseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -269,6 +306,19 @@ class CalculatorAddResponseParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorAddResponseParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorAddResponseParams'
+ ..fullIdentifier = 'math.Calculator_Add_ResponseParams')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Value')
+ ..type = (new mojom_types.Type()
+ ..simpleType = mojom_types.SimpleType.double),];
+}
+
class _CalculatorMultiplyParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -336,6 +386,19 @@ class _CalculatorMultiplyParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorMultiplyParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorMultiplyParams'
+ ..fullIdentifier = 'math.Calculator_Multiply_Params')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Value')
+ ..type = (new mojom_types.Type()
+ ..simpleType = mojom_types.SimpleType.double),];
+}
+
class CalculatorMultiplyResponseParams extends bindings.Struct {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -403,10 +466,63 @@ class CalculatorMultiplyResponseParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _mathCalculatorCalculatorMultiplyResponseParams() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'CalculatorMultiplyResponseParams'
+ ..fullIdentifier = 'math.Calculator_Multiply_ResponseParams')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Value')
+ ..type = (new mojom_types.Type()
+ ..simpleType = mojom_types.SimpleType.double),];
+}
+
+
const int _Calculator_clearName = 0;
const int _Calculator_addName = 1;
const int _Calculator_multiplyName = 2;
+mojom_types.MojomInterface _mathCalculatorCalculator() {
+ return new mojom_types.MojomInterface()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Calculator'
+ ..fullIdentifier = 'math.Calculator')
+ ..interfaceName = 'Calculator'
+ ..methods = <int, mojom_types.MojomMethod>{
+ _Calculator_clearName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Clear')
+ ..ordinal = _Calculator_clearName
+ ..responseParams = _mathCalculatorCalculatorClearResponseParams()
+ ..parameters = _mathCalculatorCalculatorClearParams(),
+ _Calculator_addName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Add')
+ ..ordinal = _Calculator_addName
+ ..responseParams = _mathCalculatorCalculatorAddResponseParams()
+ ..parameters = _mathCalculatorCalculatorAddParams(),
+ _Calculator_multiplyName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'Multiply')
+ ..ordinal = _Calculator_multiplyName
+ ..responseParams = _mathCalculatorCalculatorMultiplyResponseParams()
+ ..parameters = _mathCalculatorCalculatorMultiplyParams(),
+ };
+}
+
+class _CalculatorServiceDescription implements service_describer.ServiceDescription {
+dynamic getTopLevelInterface([Function responseFactory = null]) =>
+ _mathCalculatorCalculator();
+
+ dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =>
+ getAllMojomTypeDefinitions()[typeKey];
+
+ dynamic getAllTypeDefinitions([Function responseFactory = null]) =>
+ getAllMojomTypeDefinitions();
+}
+
abstract class Calculator {
static const String serviceName = null;
dynamic clear([Function responseFactory = null]);
@@ -430,6 +546,9 @@ class _CalculatorProxyImpl extends bindings.Proxy {
return new _CalculatorProxyImpl.fromEndpoint(endpoint);
}
+ service_describer.ServiceDescription get serviceDescription =>
+ new _CalculatorServiceDescription();
+
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _Calculator_clearName:
@@ -726,6 +845,49 @@ class CalculatorStub extends bindings.Stub {
}
int get version => 0;
+
+ service_describer.ServiceDescription get serviceDescription =>
+ new _CalculatorServiceDescription();
+}
+
+
+
+
+
+
+
+Map<String, mojom_types.UserDefinedType> _initDescriptions() {
+ var map = new HashMap<String, mojom_types.UserDefinedType>();
+map["math_calculator_Calculator_Clear_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorClearParams();
+map["math_calculator_Calculator_Clear_ResponseParams__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorClearResponseParams();
+map["math_calculator_Calculator_Add_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorAddParams();
+map["math_calculator_Calculator_Add_ResponseParams__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorAddResponseParams();
+map["math_calculator_Calculator_Multiply_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorMultiplyParams();
+map["math_calculator_Calculator_Multiply_ResponseParams__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _mathCalculatorCalculatorMultiplyResponseParams();
+map["math_calculator_Calculator__"] =
+ new mojom_types.UserDefinedType()
+ ..interfaceType = _mathCalculatorCalculator();
+
+ 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