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

Side by Side Diff: mojo/dart/packages/_mojo_for_test_only/lib/mojo/test/rect.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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library rect_mojom; 5 library rect_mojom;
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:typed_data';
7 import 'package:mojo/bindings.dart' as bindings; 8 import 'package:mojo/bindings.dart' as bindings;
8 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; 9 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
9 10
10 11
11 12
12 13
13 class Rect extends bindings.Struct { 14 class Rect extends bindings.Struct {
14 static const List<bindings.StructDataHeader> kVersions = const [ 15 static const List<bindings.StructDataHeader> kVersions = const [
15 const bindings.StructDataHeader(24, 0) 16 const bindings.StructDataHeader(24, 0)
16 ]; 17 ];
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 Map toJson() { 117 Map toJson() {
117 Map map = new Map(); 118 Map map = new Map();
118 map["x"] = x; 119 map["x"] = x;
119 map["y"] = y; 120 map["y"] = y;
120 map["width"] = width; 121 map["width"] = width;
121 map["height"] = height; 122 map["height"] = height;
122 return map; 123 return map;
123 } 124 }
124 } 125 }
125 126
126 mojom_types.MojomStruct _rectRect() { 127
127 return new mojom_types.MojomStruct() 128 mojom_types.RuntimeTypeInfo getRuntimeTypeInfo() => _runtimeTypeInfo ??
128 ..declData = (new mojom_types.DeclarationData() 129 _initRuntimeTypeInfo();
129 ..shortName = 'Rect' 130
130 ..fullIdentifier = 'mojo.test.Rect') 131 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
131 ..fields = <mojom_types.StructField>[ 132 return getRuntimeTypeInfo().typeMap;
132 new mojom_types.StructField()
133 ..declData = (new mojom_types.DeclarationData()
134 ..shortName = 'X')
135 ..type = (new mojom_types.Type()
136 ..simpleType = mojom_types.SimpleType.int32),
137 new mojom_types.StructField()
138 ..declData = (new mojom_types.DeclarationData()
139 ..shortName = 'Y')
140 ..type = (new mojom_types.Type()
141 ..simpleType = mojom_types.SimpleType.int32),
142 new mojom_types.StructField()
143 ..declData = (new mojom_types.DeclarationData()
144 ..shortName = 'Width')
145 ..type = (new mojom_types.Type()
146 ..simpleType = mojom_types.SimpleType.int32),
147 new mojom_types.StructField()
148 ..declData = (new mojom_types.DeclarationData()
149 ..shortName = 'Height')
150 ..type = (new mojom_types.Type()
151 ..simpleType = mojom_types.SimpleType.int32),];
152 } 133 }
153 134
135 var _runtimeTypeInfo;
136 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() {
137 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of
138 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this
139 // file.
140 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,56,0,0,0 ,0,0,0,0,16,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,31,0,0,0,23,0,0,0,84,89,80,69,95,75,69 ,89,58,109,111,106,111,46,116,101,115,116,46,82,101,99,116,0,24,0,0,0,1,0,0,0,16 ,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,240,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,64,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,4,0,0,0,82,101,99,116,0,0,0,0,22,0,0,0,14,0,0,0, 109,111,106,111,46,116,101,115,116,46,82,101,99,116,0,0,24,0,0,0,0,0,0,0,16,0,0, 0,0,0,0,0,7,0,0,0,7,0,0,0,81,0,0,0,73,0,0,0,47,104,111,109,101,47,114,117,100,11 1,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,10 5,110,103,115,47,116,101,115,116,115,47,114,101,99,116,46,109,111,106,111,109,0, 0,0,0,0,0,0,40,0,0,0,4,0,0,0,32,0,0,0,0,0,0,0,24,1,0,0,0,0,0,0,16,2,0,0,0,0,0,0, 8,3,0,0,0,0,0,0,56,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,255,255,255,255,0,0 ,0,0,40,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,120,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,8,0,0,0,81,0,0,0,73,0,0,0,47,1 04,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,114,101, 99,116,46,109,111,106,111,109,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,16 ,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7 2,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,0,0,0,0 ,0,0,0,0,255,255,255,255,0,0,0,0,40,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,121,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,9,0,0,0,8, 0,0,0,81,0,0,0,73,0,0,0,47,104,111,109,101,47,114,117,100,111,109,105,110,101,11 4,47,109,111,106,111,47,115,114,99,47,109,111,106,111,47,112,117,98,108,105,99,4 7,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,114,101,99,116,46,109,111,106,111,109,0,0,0,0,0,0,0,56,0,0,0 ,0,0,0,0,48,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,
141 0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0, 0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,5,0,0,0,119,105,100, 116,104,0,0,0,24,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,10,0,0,0,8,0,0,0,81,0,0,0,73,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,1 14,101,99,116,46,109,111,106,111,109,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,48,0,0,0,0,0 ,0,0,16,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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, 0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,14,0,0,0,6,0,0,0,104,101,105,103,104,116,0,0,24,0,0,0,0,0,0,0,16,0,0,0, 0,0,0,0,11,0,0,0,8,0,0,0,81,0,0,0,73,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,114,101,99,116,46,109,111,106,111,109,0,0 ,0,0,0,0,0]);
154 142
155 143 // Deserialize RuntimeTypeInfo
156 Map<String, mojom_types.UserDefinedType> _initDescriptions() { 144 var bdata = new ByteData.view(serializedRuntimeTypeInfo.buffer);
157 var map = new HashMap<String, mojom_types.UserDefinedType>(); 145 var message = new bindings.Message(bdata, null, serializedRuntimeTypeInfo.leng th, 0);
158 map["rect_Rect__"] = 146 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message);
159 new mojom_types.UserDefinedType() 147 return _runtimeTypeInfo;
160 ..structType = _rectRect();
161 return map;
162 } 148 }
163
164 var _mojomDesc;
165 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
166 if (_mojomDesc == null) {
167 _mojomDesc = _initDescriptions();
168 }
169 return _mojomDesc;
170 }
171
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698