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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/icu_data/icu_data.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 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/bindings/types/mojom_types.mojom.dart' as mojom_types;
12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
80 82
83
84
81 class IcuDataMapResponseParams extends bindings.Struct { 85 class IcuDataMapResponseParams extends bindings.Struct {
82 static const List<bindings.StructDataHeader> kVersions = const [ 86 static const List<bindings.StructDataHeader> kVersions = const [
83 const bindings.StructDataHeader(16, 0) 87 const bindings.StructDataHeader(16, 0)
84 ]; 88 ];
85 core.MojoSharedBuffer icuData = null; 89 core.MojoSharedBuffer icuData = null;
86 90
87 IcuDataMapResponseParams() : super(kVersions.last.size); 91 IcuDataMapResponseParams() : super(kVersions.last.size);
88 92
89 static IcuDataMapResponseParams deserialize(bindings.Message message) { 93 static IcuDataMapResponseParams deserialize(bindings.Message message) {
90 var decoder = new bindings.Decoder(message); 94 var decoder = new bindings.Decoder(message);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return "IcuDataMapResponseParams(" 140 return "IcuDataMapResponseParams("
137 "icuData: $icuData" ")"; 141 "icuData: $icuData" ")";
138 } 142 }
139 143
140 Map toJson() { 144 Map toJson() {
141 throw new bindings.MojoCodecError( 145 throw new bindings.MojoCodecError(
142 'Object containing handles cannot be encoded to JSON.'); 146 'Object containing handles cannot be encoded to JSON.');
143 } 147 }
144 } 148 }
145 149
150
151
152
146 const int _IcuData_mapName = 0; 153 const int _IcuData_mapName = 0;
147 154
155
156
157 class _IcuDataServiceDescription implements service_describer.ServiceDescription {
158 dynamic getTopLevelInterface([Function responseFactory = null]) => null;
159
160 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) = >
161 null;
162
163 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null;
164 }
165
148 abstract class IcuData { 166 abstract class IcuData {
149 static const String serviceName = "icu_data::ICUData"; 167 static const String serviceName = "icu_data::ICUData";
150 dynamic map(String sha1hash,[Function responseFactory = null]); 168 dynamic map(String sha1hash,[Function responseFactory = null]);
151 } 169 }
152 170
153 171
154 class _IcuDataProxyImpl extends bindings.Proxy { 172 class _IcuDataProxyImpl extends bindings.Proxy {
155 _IcuDataProxyImpl.fromEndpoint( 173 _IcuDataProxyImpl.fromEndpoint(
156 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 174 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
157 175
158 _IcuDataProxyImpl.fromHandle(core.MojoHandle handle) : 176 _IcuDataProxyImpl.fromHandle(core.MojoHandle handle) :
159 super.fromHandle(handle); 177 super.fromHandle(handle);
160 178
161 _IcuDataProxyImpl.unbound() : super.unbound(); 179 _IcuDataProxyImpl.unbound() : super.unbound();
162 180
163 static _IcuDataProxyImpl newFromEndpoint( 181 static _IcuDataProxyImpl newFromEndpoint(
164 core.MojoMessagePipeEndpoint endpoint) { 182 core.MojoMessagePipeEndpoint endpoint) {
165 assert(endpoint.setDescription("For _IcuDataProxyImpl")); 183 assert(endpoint.setDescription("For _IcuDataProxyImpl"));
166 return new _IcuDataProxyImpl.fromEndpoint(endpoint); 184 return new _IcuDataProxyImpl.fromEndpoint(endpoint);
167 } 185 }
168 186
187 service_describer.ServiceDescription get serviceDescription =>
188 new _IcuDataServiceDescription();
189
169 void handleResponse(bindings.ServiceMessage message) { 190 void handleResponse(bindings.ServiceMessage message) {
170 switch (message.header.type) { 191 switch (message.header.type) {
171 case _IcuData_mapName: 192 case _IcuData_mapName:
172 var r = IcuDataMapResponseParams.deserialize( 193 var r = IcuDataMapResponseParams.deserialize(
173 message.payload); 194 message.payload);
174 if (!message.header.hasRequestId) { 195 if (!message.header.hasRequestId) {
175 proxyError("Expected a message with a valid request Id."); 196 proxyError("Expected a message with a valid request Id.");
176 return; 197 return;
177 } 198 }
178 Completer c = completerMap[message.header.requestId]; 199 Completer c = completerMap[message.header.requestId];
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 assert(_impl == null); 365 assert(_impl == null);
345 _impl = d; 366 _impl = d;
346 } 367 }
347 368
348 String toString() { 369 String toString() {
349 var superString = super.toString(); 370 var superString = super.toString();
350 return "IcuDataStub($superString)"; 371 return "IcuDataStub($superString)";
351 } 372 }
352 373
353 int get version => 0; 374 int get version => 0;
375
376 service_describer.ServiceDescription get serviceDescription =>
377 new _IcuDataServiceDescription();
354 } 378 }
355 379
356 380
381
382
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698