OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 Loading... |
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]) => null; |
| 352 |
| 353 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 354 null; |
| 355 |
| 356 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 357 } |
| 358 |
337 abstract class PredictionService { | 359 abstract class PredictionService { |
338 static const String serviceName = "prediction::PredictionService"; | 360 static const String serviceName = "prediction::PredictionService"; |
339 dynamic getPredictionList(PredictionInfo predictionInfo,[Function responseFact
ory = null]); | 361 dynamic getPredictionList(PredictionInfo predictionInfo,[Function responseFact
ory = null]); |
340 } | 362 } |
341 | 363 |
342 | 364 |
343 class _PredictionServiceProxyImpl extends bindings.Proxy { | 365 class _PredictionServiceProxyImpl extends bindings.Proxy { |
344 _PredictionServiceProxyImpl.fromEndpoint( | 366 _PredictionServiceProxyImpl.fromEndpoint( |
345 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 367 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
346 | 368 |
347 _PredictionServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 369 _PredictionServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
348 super.fromHandle(handle); | 370 super.fromHandle(handle); |
349 | 371 |
350 _PredictionServiceProxyImpl.unbound() : super.unbound(); | 372 _PredictionServiceProxyImpl.unbound() : super.unbound(); |
351 | 373 |
352 static _PredictionServiceProxyImpl newFromEndpoint( | 374 static _PredictionServiceProxyImpl newFromEndpoint( |
353 core.MojoMessagePipeEndpoint endpoint) { | 375 core.MojoMessagePipeEndpoint endpoint) { |
354 assert(endpoint.setDescription("For _PredictionServiceProxyImpl")); | 376 assert(endpoint.setDescription("For _PredictionServiceProxyImpl")); |
355 return new _PredictionServiceProxyImpl.fromEndpoint(endpoint); | 377 return new _PredictionServiceProxyImpl.fromEndpoint(endpoint); |
356 } | 378 } |
357 | 379 |
| 380 service_describer.ServiceDescription get serviceDescription => |
| 381 new _PredictionServiceServiceDescription(); |
| 382 |
358 void handleResponse(bindings.ServiceMessage message) { | 383 void handleResponse(bindings.ServiceMessage message) { |
359 switch (message.header.type) { | 384 switch (message.header.type) { |
360 case _PredictionService_getPredictionListName: | 385 case _PredictionService_getPredictionListName: |
361 var r = PredictionServiceGetPredictionListResponseParams.deserialize( | 386 var r = PredictionServiceGetPredictionListResponseParams.deserialize( |
362 message.payload); | 387 message.payload); |
363 if (!message.header.hasRequestId) { | 388 if (!message.header.hasRequestId) { |
364 proxyError("Expected a message with a valid request Id."); | 389 proxyError("Expected a message with a valid request Id."); |
365 return; | 390 return; |
366 } | 391 } |
367 Completer c = completerMap[message.header.requestId]; | 392 Completer c = completerMap[message.header.requestId]; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 assert(_impl == null); | 558 assert(_impl == null); |
534 _impl = d; | 559 _impl = d; |
535 } | 560 } |
536 | 561 |
537 String toString() { | 562 String toString() { |
538 var superString = super.toString(); | 563 var superString = super.toString(); |
539 return "PredictionServiceStub($superString)"; | 564 return "PredictionServiceStub($superString)"; |
540 } | 565 } |
541 | 566 |
542 int get version => 0; | 567 int get version => 0; |
| 568 |
| 569 service_describer.ServiceDescription get serviceDescription => |
| 570 new _PredictionServiceServiceDescription(); |
543 } | 571 } |
544 | 572 |
545 | 573 |
| 574 |
| 575 |
OLD | NEW |