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

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_included_unions.mojom.dart

Issue 1753013002: Mojom runtime type info: New implementation for Dart. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: No changes to sha1s Created 4 years, 10 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/mojo/test/test_included_unions.mojom.dart
diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_included_unions.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_included_unions.mojom.dart
index 7ee3cc38312b0ef59268f1b63613cf2bb9827dd9..37acc4462df3c7b4495a8a6e88732074a341529b 100644
--- a/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_included_unions.mojom.dart
+++ b/mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/test_included_unions.mojom.dart
@@ -4,6 +4,7 @@
library test_included_unions_mojom;
import 'dart:collection';
+import 'dart:typed_data';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
@@ -89,34 +90,23 @@ class IncludedUnion extends bindings.Union {
}
}
-mojom_types.MojomUnion _testIncludedUnionsIncludedUnion() {
- return new mojom_types.MojomUnion()
- ..declData = (new mojom_types.DeclarationData()
- ..shortName = 'IncludedUnion'
- ..fullIdentifier = 'mojo.test.IncludedUnion')
- ..fields = <mojom_types.UnionField>[
- new mojom_types.UnionField()
- ..declData = (new mojom_types.DeclarationData()
- ..shortName = 'A')
- ..type = (new mojom_types.Type()
- ..simpleType = mojom_types.SimpleType.int8)
- ..tag = 0,];
-}
-
-
-Map<String, mojom_types.UserDefinedType> _initDescriptions() {
- var map = new HashMap<String, mojom_types.UserDefinedType>();
- map["test_included_unions_IncludedUnion__"] =
- new mojom_types.UserDefinedType()
- ..unionType = _testIncludedUnionsIncludedUnion();
- return map;
-}
+mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ??
+ _initRuntimeTypeInfo();
-var _mojomDesc;
Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
- if (_mojomDesc == null) {
- _mojomDesc = _initDescriptions();
- }
- return _mojomDesc;
+ return getRuntimeTypeInfo().typeMap;
}
+var _runtimeTypeInfo;
+mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() {
+ // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of
+ // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this
+ // file.
+ var serializedRuntimeTypeInfo = new Uint8List.fromList(const [24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,32,0,0,0,84,89,80,69,95,75,69,89,58,109,111,106,111,46,116,101,115,116,46,73,110,99,108,117,100,101,100,85,110,105,111,110,24,0,0,0,1,0,0,0,16,0,0,0,2,0,0,0,8,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,1,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,48,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,13,0,0,0,73,110,99,108,117,100,101,100,85,110,105,111,110,0,0,0,31,0,0,0,23,0,0,0,109,111,106,111,46,116,101,115,116,46,73,110,99,108,117,100,101,100,85,110,105,111,110,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,97,0,0,0,89,0,0,0,47,104,111,109,101,47,114,117,100,111,109,105,110,101,114,47,109,111,106,111,47,115,114,99,47,109,111,106,111,47,112,117,98,108,105,99,47,105,110,116,101,114,102,97,99,101,115,47,98,105,110,100,105,110,103,115,47,116,101,115,116,115,47,116,101,115,116,95,105,110,99,108,117,100,101,100,95,117,110,105,111,110,115,46,109,111,106,111,109,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,48,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,1,0,0,0,97,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,8,0,0,0,7,0,0,0,97,0,0,0,89,0,0,0,47,104,111,109,101,47,114,117,100,111,109,105,110,101,114,47,109,111,106,111,47,115,114,99,47,109,111,106,111,47,112,117,98,108,105,99,47,105,110,116,101,114,102,97,99,101,115,47,98,105,110,100,105,110,103,115,47,116,101,115,116,115,47,116,101,115,116,95,105,110,99,108,117,100,101,100,95,117,110,105,111,110,115,46,109,111,106,111,109,0,0,0,0,0,0,0]);
+
+ // Deserialize RuntimeTypeInfo
+ var bdata = new ByteData.view(serializedRuntimeTypeInfo.buffer);
+ var message = new bindings.Message(bdata, null, serializedRuntimeTypeInfo.length, 0);
+ _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message);
+ return _runtimeTypeInfo;
+}

Powered by Google App Engine
This is Rietveld 408576698