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

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

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge with master 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 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 prediction_mojom; 5 library prediction_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 PrevWordInfo extends bindings.Struct { 16 class PrevWordInfo extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 17 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(24, 0) 18 const bindings.StructDataHeader(24, 0)
17 ]; 19 ];
18 String word = null; 20 String word = null;
19 bool isBeginningOfSentence = false; 21 bool isBeginningOfSentence = false;
20 22
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 82
81 Map toJson() { 83 Map toJson() {
82 Map map = new Map(); 84 Map map = new Map();
83 map["word"] = word; 85 map["word"] = word;
84 map["isBeginningOfSentence"] = isBeginningOfSentence; 86 map["isBeginningOfSentence"] = isBeginningOfSentence;
85 return map; 87 return map;
86 } 88 }
87 } 89 }
88 90
89 91
92
93
90 class PredictionInfo extends bindings.Struct { 94 class PredictionInfo extends bindings.Struct {
91 static const List<bindings.StructDataHeader> kVersions = const [ 95 static const List<bindings.StructDataHeader> kVersions = const [
92 const bindings.StructDataHeader(24, 0) 96 const bindings.StructDataHeader(24, 0)
93 ]; 97 ];
94 List<PrevWordInfo> previousWords = null; 98 List<PrevWordInfo> previousWords = null;
95 String currentWord = null; 99 String currentWord = null;
96 100
97 PredictionInfo() : super(kVersions.last.size); 101 PredictionInfo() : super(kVersions.last.size);
98 102
99 static PredictionInfo deserialize(bindings.Message message) { 103 static PredictionInfo deserialize(bindings.Message message) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 177
174 Map toJson() { 178 Map toJson() {
175 Map map = new Map(); 179 Map map = new Map();
176 map["previousWords"] = previousWords; 180 map["previousWords"] = previousWords;
177 map["currentWord"] = currentWord; 181 map["currentWord"] = currentWord;
178 return map; 182 return map;
179 } 183 }
180 } 184 }
181 185
182 186
187
188
183 class _PredictionServiceGetPredictionListParams extends bindings.Struct { 189 class _PredictionServiceGetPredictionListParams extends bindings.Struct {
184 static const List<bindings.StructDataHeader> kVersions = const [ 190 static const List<bindings.StructDataHeader> kVersions = const [
185 const bindings.StructDataHeader(16, 0) 191 const bindings.StructDataHeader(16, 0)
186 ]; 192 ];
187 PredictionInfo predictionInfo = null; 193 PredictionInfo predictionInfo = null;
188 194
189 _PredictionServiceGetPredictionListParams() : super(kVersions.last.size); 195 _PredictionServiceGetPredictionListParams() : super(kVersions.last.size);
190 196
191 static _PredictionServiceGetPredictionListParams deserialize(bindings.Message message) { 197 static _PredictionServiceGetPredictionListParams deserialize(bindings.Message message) {
192 var decoder = new bindings.Decoder(message); 198 var decoder = new bindings.Decoder(message);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 247 }
242 248
243 Map toJson() { 249 Map toJson() {
244 Map map = new Map(); 250 Map map = new Map();
245 map["predictionInfo"] = predictionInfo; 251 map["predictionInfo"] = predictionInfo;
246 return map; 252 return map;
247 } 253 }
248 } 254 }
249 255
250 256
257
258
251 class PredictionServiceGetPredictionListResponseParams extends bindings.Struct { 259 class PredictionServiceGetPredictionListResponseParams extends bindings.Struct {
252 static const List<bindings.StructDataHeader> kVersions = const [ 260 static const List<bindings.StructDataHeader> kVersions = const [
253 const bindings.StructDataHeader(16, 0) 261 const bindings.StructDataHeader(16, 0)
254 ]; 262 ];
255 List<String> predictionList = null; 263 List<String> predictionList = null;
256 264
257 PredictionServiceGetPredictionListResponseParams() : super(kVersions.last.size ); 265 PredictionServiceGetPredictionListResponseParams() : super(kVersions.last.size );
258 266
259 static PredictionServiceGetPredictionListResponseParams deserialize(bindings.M essage message) { 267 static PredictionServiceGetPredictionListResponseParams deserialize(bindings.M essage message) {
260 var decoder = new bindings.Decoder(message); 268 var decoder = new bindings.Decoder(message);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 "predictionList: $predictionList" ")"; 333 "predictionList: $predictionList" ")";
326 } 334 }
327 335
328 Map toJson() { 336 Map toJson() {
329 Map map = new Map(); 337 Map map = new Map();
330 map["predictionList"] = predictionList; 338 map["predictionList"] = predictionList;
331 return map; 339 return map;
332 } 340 }
333 } 341 }
334 342
343
344
345
335 const int _PredictionService_getPredictionListName = 0; 346 const int _PredictionService_getPredictionListName = 0;
336 347
348
349
350 class _PredictionServiceServiceDescription implements service_describer.ServiceD escription {
351 dynamic getTopLevelInterface([Function responseFactory]) => null;
352
353 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
354
355 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
356 }
357
337 abstract class PredictionService { 358 abstract class PredictionService {
338 static const String serviceName = "prediction::PredictionService"; 359 static const String serviceName = "prediction::PredictionService";
339 dynamic getPredictionList(PredictionInfo predictionInfo,[Function responseFact ory = null]); 360 dynamic getPredictionList(PredictionInfo predictionInfo,[Function responseFact ory = null]);
340 } 361 }
341 362
342 363
343 class _PredictionServiceProxyImpl extends bindings.Proxy { 364 class _PredictionServiceProxyImpl extends bindings.Proxy {
344 _PredictionServiceProxyImpl.fromEndpoint( 365 _PredictionServiceProxyImpl.fromEndpoint(
345 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 366 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
346 367
347 _PredictionServiceProxyImpl.fromHandle(core.MojoHandle handle) : 368 _PredictionServiceProxyImpl.fromHandle(core.MojoHandle handle) :
348 super.fromHandle(handle); 369 super.fromHandle(handle);
349 370
350 _PredictionServiceProxyImpl.unbound() : super.unbound(); 371 _PredictionServiceProxyImpl.unbound() : super.unbound();
351 372
352 static _PredictionServiceProxyImpl newFromEndpoint( 373 static _PredictionServiceProxyImpl newFromEndpoint(
353 core.MojoMessagePipeEndpoint endpoint) { 374 core.MojoMessagePipeEndpoint endpoint) {
354 assert(endpoint.setDescription("For _PredictionServiceProxyImpl")); 375 assert(endpoint.setDescription("For _PredictionServiceProxyImpl"));
355 return new _PredictionServiceProxyImpl.fromEndpoint(endpoint); 376 return new _PredictionServiceProxyImpl.fromEndpoint(endpoint);
356 } 377 }
357 378
379 service_describer.ServiceDescription get serviceDescription =>
380 new _PredictionServiceServiceDescription();
381
358 void handleResponse(bindings.ServiceMessage message) { 382 void handleResponse(bindings.ServiceMessage message) {
359 switch (message.header.type) { 383 switch (message.header.type) {
360 case _PredictionService_getPredictionListName: 384 case _PredictionService_getPredictionListName:
361 var r = PredictionServiceGetPredictionListResponseParams.deserialize( 385 var r = PredictionServiceGetPredictionListResponseParams.deserialize(
362 message.payload); 386 message.payload);
363 if (!message.header.hasRequestId) { 387 if (!message.header.hasRequestId) {
364 proxyError("Expected a message with a valid request Id."); 388 proxyError("Expected a message with a valid request Id.");
365 return; 389 return;
366 } 390 }
367 Completer c = completerMap[message.header.requestId]; 391 Completer c = completerMap[message.header.requestId];
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 assert(_impl == null); 557 assert(_impl == null);
534 _impl = d; 558 _impl = d;
535 } 559 }
536 560
537 String toString() { 561 String toString() {
538 var superString = super.toString(); 562 var superString = super.toString();
539 return "PredictionServiceStub($superString)"; 563 return "PredictionServiceStub($superString)";
540 } 564 }
541 565
542 int get version => 0; 566 int get version => 0;
567
568 service_describer.ServiceDescription get serviceDescription =>
569 new _PredictionServiceServiceDescription();
543 } 570 }
544 571
545 572
573
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698