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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/icu_data/icu_data.mojom.dart

Issue 1433183002: Generate Mojom Types for Dart (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Simplify identifier_store for Go and Dart Created 5 years 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 icu_data_mojom; 5 library icu_data_mojom;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:mojo/bindings.dart' as bindings; 9 import 'package:mojo/bindings.dart' as bindings;
10 import 'package:mojo/core.dart' as core; 10 import 'package:mojo/core.dart' as core;
11 import 'package:mojo/mojo/mojom_types.mojom.dart' as mojom_types;
12 import 'package:mojo/mojo/service_describer.mojom.dart' as service_describer;
11 13
12 14
13 15
14 class IcuDataMapParams extends bindings.Struct { 16 class IcuDataMapParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 17 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(16, 0) 18 const bindings.StructDataHeader(16, 0)
17 ]; 19 ];
18 String sha1hash = null; 20 String sha1hash = null;
19 21
20 IcuDataMapParams() : super(kVersions.last.size); 22 IcuDataMapParams() : super(kVersions.last.size);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 "sha1hash: $sha1hash" ")"; 72 "sha1hash: $sha1hash" ")";
71 } 73 }
72 74
73 Map toJson() { 75 Map toJson() {
74 Map map = new Map(); 76 Map map = new Map();
75 map["sha1hash"] = sha1hash; 77 map["sha1hash"] = sha1hash;
76 return map; 78 return map;
77 } 79 }
78 } 80 }
79 81
82 mojom_types.MojomStruct _icu_data_ICUData_Map_Params__() {
83 return new mojom_types.MojomStruct()
84 ..declData = (new mojom_types.DeclarationData()..shortName = 'IcuDataMapPara ms')
85 ..fields = <mojom_types.StructField>[
86 new mojom_types.StructField()
87 ..declData = (new mojom_types.DeclarationData()..shortName = 'Sha1hash')
88 ..type = (new mojom_types.Type()
89 ..stringType = (new mojom_types.StringType()..nullable = false)),
90 ];
91 }
92
80 93
81 class IcuDataMapResponseParams extends bindings.Struct { 94 class IcuDataMapResponseParams extends bindings.Struct {
82 static const List<bindings.StructDataHeader> kVersions = const [ 95 static const List<bindings.StructDataHeader> kVersions = const [
83 const bindings.StructDataHeader(16, 0) 96 const bindings.StructDataHeader(16, 0)
84 ]; 97 ];
85 core.MojoSharedBuffer icuData = null; 98 core.MojoSharedBuffer icuData = null;
86 99
87 IcuDataMapResponseParams() : super(kVersions.last.size); 100 IcuDataMapResponseParams() : super(kVersions.last.size);
88 101
89 static IcuDataMapResponseParams deserialize(bindings.Message message) { 102 static IcuDataMapResponseParams deserialize(bindings.Message message) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return "IcuDataMapResponseParams(" 149 return "IcuDataMapResponseParams("
137 "icuData: $icuData" ")"; 150 "icuData: $icuData" ")";
138 } 151 }
139 152
140 Map toJson() { 153 Map toJson() {
141 throw new bindings.MojoCodecError( 154 throw new bindings.MojoCodecError(
142 'Object containing handles cannot be encoded to JSON.'); 155 'Object containing handles cannot be encoded to JSON.');
143 } 156 }
144 } 157 }
145 158
159 mojom_types.MojomStruct _icu_data_ICUData_Map_ResponseParams__() {
160 return new mojom_types.MojomStruct()
161 ..declData = (new mojom_types.DeclarationData()..shortName = 'IcuDataMapResp onseParams')
162 ..fields = <mojom_types.StructField>[
163 new mojom_types.StructField()
164 ..declData = (new mojom_types.DeclarationData()..shortName = 'IcuData')
165 ..type = (new mojom_types.Type()
166 ..handleType = (new mojom_types.HandleType()
167 ..kind = mojom_types.HandleTypeKind.SHARED_BUFFER
168 ..nullable = true)),
169 ];
170 }
171
172
146 const int kIcuData_map_name = 0; 173 const int kIcuData_map_name = 0;
147 174
148 const String IcuDataName = 175 const String IcuDataName =
149 'icu_data::ICUData'; 176 'icu_data::ICUData';
150 177
178 mojom_types.MojomInterface _icu_data_ICUData__() {
179 return new mojom_types.MojomInterface()
180 ..declData = (new mojom_types.DeclarationData()..shortName = "IcuData")
181 ..interfaceName = "IcuData"
182 ..methods = <int, mojom_types.MojomMethod>{
183 kIcuData_map_name: new mojom_types.MojomMethod()
184 ..declData = (new mojom_types.DeclarationData()..shortName = "Map")
185 ..ordinal = kIcuData_map_name
186 ..responseParams = _icu_data_ICUData_Map_ResponseParams__()..parameters = _icu_data_ICUData_Map_Params__(),
187 };
188 }
189
190 class _IcuDataServiceDescription extends service_describer.ServiceDescription {
191 // Avoid infinite loop by overriding serviceDescription field.
192 final service_describer.ServiceDescription serviceDescription = null;
193 dynamic getTopLevelInterface([Function responseFactory = null]) {
194 return _icu_data_ICUData__();
195 }
196 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
197 return getAllMojomTypeDefinitions()[typeKey];
198 }
199 dynamic getAllTypeDefinitions([Function responseFactory = null]) {
200 return getAllMojomTypeDefinitions();
201 }
202 }
203
151 abstract class IcuData { 204 abstract class IcuData {
152 dynamic map(String sha1hash,[Function responseFactory = null]); 205 dynamic map(String sha1hash,[Function responseFactory = null]);
153 206
154 } 207 }
155 208
156 209
157 class IcuDataProxyImpl extends bindings.Proxy { 210 class IcuDataProxyImpl extends bindings.Proxy {
158 IcuDataProxyImpl.fromEndpoint( 211 IcuDataProxyImpl.fromEndpoint(
159 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 212 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
160 213
161 IcuDataProxyImpl.fromHandle(core.MojoHandle handle) : 214 IcuDataProxyImpl.fromHandle(core.MojoHandle handle) :
162 super.fromHandle(handle); 215 super.fromHandle(handle);
163 216
164 IcuDataProxyImpl.unbound() : super.unbound(); 217 IcuDataProxyImpl.unbound() : super.unbound();
165 218
166 static IcuDataProxyImpl newFromEndpoint( 219 static IcuDataProxyImpl newFromEndpoint(
167 core.MojoMessagePipeEndpoint endpoint) { 220 core.MojoMessagePipeEndpoint endpoint) {
168 assert(endpoint.setDescription("For IcuDataProxyImpl")); 221 assert(endpoint.setDescription("For IcuDataProxyImpl"));
169 return new IcuDataProxyImpl.fromEndpoint(endpoint); 222 return new IcuDataProxyImpl.fromEndpoint(endpoint);
170 } 223 }
171 224
172 String get name => IcuDataName; 225 String get name => IcuDataName;
173 226
227 service_describer.ServiceDescription get serviceDescription =>
228 new _IcuDataServiceDescription();
229
174 void handleResponse(bindings.ServiceMessage message) { 230 void handleResponse(bindings.ServiceMessage message) {
175 switch (message.header.type) { 231 switch (message.header.type) {
176 case kIcuData_map_name: 232 case kIcuData_map_name:
177 var r = IcuDataMapResponseParams.deserialize( 233 var r = IcuDataMapResponseParams.deserialize(
178 message.payload); 234 message.payload);
179 if (!message.header.hasRequestId) { 235 if (!message.header.hasRequestId) {
180 proxyError("Expected a message with a valid request Id."); 236 proxyError("Expected a message with a valid request Id.");
181 return; 237 return;
182 } 238 }
183 Completer c = completerMap[message.header.requestId]; 239 Completer c = completerMap[message.header.requestId];
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 assert(_impl == null); 406 assert(_impl == null);
351 _impl = d; 407 _impl = d;
352 } 408 }
353 409
354 String toString() { 410 String toString() {
355 var superString = super.toString(); 411 var superString = super.toString();
356 return "IcuDataStub($superString)"; 412 return "IcuDataStub($superString)";
357 } 413 }
358 414
359 int get version => 0; 415 int get version => 0;
416
417 service_describer.ServiceDescription get serviceDescription =>
418 new _IcuDataServiceDescription();
360 } 419 }
361 420
362 421
422
423
424
425
426
427
428 var _MojomDesc__ = _initDescriptions();
429
430 Map<String, mojom_types.UserDefinedType> _initDescriptions() {
431 var map = new Map<String, mojom_types.UserDefinedType>();
432
433 map["_icu_data_ICUData_Map_Params__"] =
434 new mojom_types.UserDefinedType()
435 ..structType = _icu_data_ICUData_Map_Params__();
436
437
438
439
440
441 map["_icu_data_ICUData_Map_ResponseParams__"] =
442 new mojom_types.UserDefinedType()
443 ..structType = _icu_data_ICUData_Map_ResponseParams__();
444
445
446
447
448
449 map["_icu_data_ICUData__"] =
450 new mojom_types.UserDefinedType()
451 ..interfaceType = _icu_data_ICUData__();
452
453 return map;
454 }
455
456 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
457 return _MojomDesc__;
458 }
459
460
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698