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

Unified Diff: mojo/dart/packages/mojo_services/lib/mojo/device_info.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/mojo/device_info.mojom.dart
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/device_info.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/device_info.mojom.dart
index 4d196bea662c16de423c11e344efac01a5f4f0a1..586bd5006c0e736c07d559b8064422b622b93caf 100644
--- a/mojo/dart/packages/mojo_services/lib/mojo/device_info.mojom.dart
+++ b/mojo/dart/packages/mojo_services/lib/mojo/device_info.mojom.dart
@@ -5,9 +5,12 @@
library device_info_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;
@@ -67,6 +70,13 @@ class _DeviceInfoGetDeviceTypeParams extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _device_info_DeviceInfo_GetDeviceType_Params__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = '_DeviceInfoGetDeviceTypeParams'
+ ..fullIdentifier = 'mojo._DeviceInfoGetDeviceTypeParams')
+ ..fields = <mojom_types.StructField>[];
+}
class DeviceInfoGetDeviceTypeResponseParams extends bindings.Struct {
@@ -138,10 +148,26 @@ class DeviceInfoGetDeviceTypeResponseParams extends bindings.Struct {
return map;
}
}
+mojom_types.MojomStruct _device_info_DeviceInfo_GetDeviceType_ResponseParams__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'DeviceInfoGetDeviceTypeResponseParams'
+ ..fullIdentifier = 'mojo.DeviceInfoGetDeviceTypeResponseParams')
+ ..fields = <mojom_types.StructField>[
+ new mojom_types.StructField()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'DeviceType')
+ ..type = (new mojom_types.Type()
+ ..typeReference = (new mojom_types.TypeReference()
+
+ ..identifier = '_device_info_DeviceType__'
+ ..typeKey = '_device_info_DeviceType__'
+ )),
+ ];
+}
+
const int _DeviceInfo_getDeviceTypeName = 0;
-
-class DeviceInfoDeviceType extends bindings.MojoEnum {
+ class DeviceInfoDeviceType extends bindings.MojoEnum {
static const DeviceInfoDeviceType unknown = const DeviceInfoDeviceType._(0);
static const DeviceInfoDeviceType headless = const DeviceInfoDeviceType._(1);
static const DeviceInfoDeviceType watch = const DeviceInfoDeviceType._(2);
@@ -220,12 +246,69 @@ class DeviceInfoDeviceType extends bindings.MojoEnum {
return 'DeviceInfoDeviceType.desktop';
case tv:
return 'DeviceInfoDeviceType.tv';
+ default:
+ return null;
}
}
int toJson() => mojoEnumValue;
}
+mojom_types.MojomEnum _device_info_DeviceType__() {
+ return new mojom_types.MojomEnum()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'DeviceInfoDeviceType'
+ ..fullIdentifier = 'mojo.DeviceInfoDeviceType')
+ ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Unknown')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 0,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Headless')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 1,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Watch')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 2,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Phone')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 3,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Tablet')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 4,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Desktop')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 5,new mojom_types.EnumValue()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Tv')
+ ..enumTypeKey = '_device_info_DeviceType__'
+ ..intValue = 6,];
+}
+
+mojom_types.MojomInterface _device_info_DeviceInfo__() {
+ return new mojom_types.MojomInterface()
+ ..declData = (new mojom_types.DeclarationData()
+ ..shortName = 'DeviceInfo'
+ ..fullIdentifier = 'mojo.DeviceInfo')
+ ..interfaceName = 'DeviceInfo'
+ ..methods = <int, mojom_types.MojomMethod>{
+_DeviceInfo_getDeviceTypeName: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'GetDeviceType')
+ ..ordinal = _DeviceInfo_getDeviceTypeName
+ ..responseParams = _device_info_DeviceInfo_GetDeviceType_ResponseParams__()..parameters = _device_info_DeviceInfo_GetDeviceType_Params__(),
+ };
+}
+
+class _DeviceInfoServiceDescription implements service_describer.ServiceDescription {
+dynamic getTopLevelInterface([Function responseFactory = null]) {
+ return _device_info_DeviceInfo__();
+ }
+ dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
+ return getAllMojomTypeDefinitions()[typeKey];
+ }
+ dynamic getAllTypeDefinitions([Function responseFactory = null]) {
+ return getAllMojomTypeDefinitions();
+ }
+}
+
abstract class DeviceInfo {
static const String serviceName = "mojo::DeviceInfo";
dynamic getDeviceType([Function responseFactory = null]);
@@ -247,6 +330,9 @@ class _DeviceInfoProxyImpl extends bindings.Proxy {
return new _DeviceInfoProxyImpl.fromEndpoint(endpoint);
}
+ service_describer.ServiceDescription get serviceDescription =>
+ new _DeviceInfoServiceDescription();
+
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
case _DeviceInfo_getDeviceTypeName:
@@ -431,6 +517,41 @@ class DeviceInfoStub extends bindings.Stub {
}
int get version => 0;
+
+
+ service_describer.ServiceDescription get serviceDescription =>
+ new _DeviceInfoServiceDescription();
}
+
+
+
+
+
+Map<String, mojom_types.UserDefinedType> _initDescriptions() {
+ var map = new HashMap<String, mojom_types.UserDefinedType>();
+map["_device_info_DeviceInfo_GetDeviceType_Params__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _device_info_DeviceInfo_GetDeviceType_Params__();
+map["_device_info_DeviceInfo_GetDeviceType_ResponseParams__"] =
+ new mojom_types.UserDefinedType()
+ ..structType = _device_info_DeviceInfo_GetDeviceType_ResponseParams__();
+map["_device_info_DeviceInfo__"] =
+ new mojom_types.UserDefinedType()
+ ..interfaceType = _device_info_DeviceInfo__();
+ map["_device_info_DeviceType__"] =
+ new mojom_types.UserDefinedType()
+ ..enumType = _device_info_DeviceType__();
+
+ 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