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 dart_to_cpp_mojom; | 5 library dart_to_cpp_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | |
8 | 9 |
9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; | |
13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; | |
11 | 14 |
12 | 15 |
13 | 16 |
14 class EchoArgs extends bindings.Struct { | 17 class EchoArgs extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(104, 0) | 19 const bindings.StructDataHeader(104, 0) |
17 ]; | 20 ]; |
18 int si64 = 0; | 21 int si64 = 0; |
19 int si32 = 0; | 22 int si32 = 0; |
20 int si16 = 0; | 23 int si16 = 0; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 "doubleNan: $doubleNan" ", " | 224 "doubleNan: $doubleNan" ", " |
222 "name: $name" ", " | 225 "name: $name" ", " |
223 "stringArray: $stringArray" ", " | 226 "stringArray: $stringArray" ", " |
224 "dataHandle: $dataHandle" ")"; | 227 "dataHandle: $dataHandle" ")"; |
225 } | 228 } |
226 | 229 |
227 Map toJson() { | 230 Map toJson() { |
228 throw new bindings.MojoCodecError( | 231 throw new bindings.MojoCodecError( |
229 'Object containing handles cannot be encoded to JSON.'); | 232 'Object containing handles cannot be encoded to JSON.'); |
230 } | 233 } |
231 } | 234 } |
zra
2016/01/15 21:01:33
Missing whitespace.
alexfandrianto
2016/01/20 00:08:28
It's not easy to make this good, so while I will t
zra
2016/01/27 18:15:11
We may need to compare source files directly to ea
| |
235 mojom_types.MojomStruct _dart_to_cpp_EchoArgs__() { | |
zra
2016/01/15 21:01:33
Even though they're library-private, it would be n
alexfandrianto
2016/01/20 00:08:28
Done.
| |
236 return new mojom_types.MojomStruct() | |
237 ..declData = (new mojom_types.DeclarationData() | |
238 ..shortName = 'EchoArgs' | |
239 ..fullIdentifier = 'dart_to_cpp.EchoArgs') | |
240 ..fields = <mojom_types.StructField>[ | |
241 new mojom_types.StructField() | |
242 ..declData = (new mojom_types.DeclarationData()..shortName = 'Si64') | |
243 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in t64), | |
244 | |
245 new mojom_types.StructField() | |
246 ..declData = (new mojom_types.DeclarationData()..shortName = 'Si32') | |
247 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in t32), | |
248 | |
249 new mojom_types.StructField() | |
250 ..declData = (new mojom_types.DeclarationData()..shortName = 'Si16') | |
251 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in t16), | |
252 | |
253 new mojom_types.StructField() | |
254 ..declData = (new mojom_types.DeclarationData()..shortName = 'Si8') | |
255 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in t8), | |
256 | |
257 new mojom_types.StructField() | |
258 ..declData = (new mojom_types.DeclarationData()..shortName = 'Ui64') | |
259 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui nt64), | |
260 | |
261 new mojom_types.StructField() | |
262 ..declData = (new mojom_types.DeclarationData()..shortName = 'Ui32') | |
263 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui nt32), | |
264 | |
265 new mojom_types.StructField() | |
266 ..declData = (new mojom_types.DeclarationData()..shortName = 'Ui16') | |
267 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui nt16), | |
268 | |
269 new mojom_types.StructField() | |
270 ..declData = (new mojom_types.DeclarationData()..shortName = 'Ui8') | |
271 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui nt8), | |
272 | |
273 new mojom_types.StructField() | |
274 ..declData = (new mojom_types.DeclarationData()..shortName = 'FloatVal') | |
275 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.fl oat), | |
276 | |
277 new mojom_types.StructField() | |
278 ..declData = (new mojom_types.DeclarationData()..shortName = 'FloatInf') | |
279 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.fl oat), | |
280 | |
281 new mojom_types.StructField() | |
282 ..declData = (new mojom_types.DeclarationData()..shortName = 'FloatNan') | |
283 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.fl oat), | |
284 | |
285 new mojom_types.StructField() | |
286 ..declData = (new mojom_types.DeclarationData()..shortName = 'DoubleVal' ) | |
287 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.do uble), | |
288 | |
289 new mojom_types.StructField() | |
290 ..declData = (new mojom_types.DeclarationData()..shortName = 'DoubleInf' ) | |
291 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.do uble), | |
292 | |
293 new mojom_types.StructField() | |
294 ..declData = (new mojom_types.DeclarationData()..shortName = 'DoubleNan' ) | |
295 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.do uble), | |
296 | |
297 new mojom_types.StructField() | |
298 ..declData = (new mojom_types.DeclarationData()..shortName = 'Name') | |
299 ..type = (new mojom_types.Type() | |
300 ..stringType = (new mojom_types.StringType()..nullable = true)), | |
301 | |
302 new mojom_types.StructField() | |
303 ..declData = (new mojom_types.DeclarationData()..shortName = 'StringArra y') | |
304 ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType () | |
305 ..nullable = true | |
306 | |
307 ..elementType = (new mojom_types.Type() | |
308 ..stringType = (new mojom_types.StringType()..nullable = false)))), | |
309 | |
310 new mojom_types.StructField() | |
311 ..declData = (new mojom_types.DeclarationData()..shortName = 'MessageHan dle') | |
312 ..type = (new mojom_types.Type() | |
313 ..handleType = (new mojom_types.HandleType() | |
314 ..kind = mojom_types.HandleTypeKind.messagePipe | |
315 ..nullable = true)), | |
316 | |
317 new mojom_types.StructField() | |
318 ..declData = (new mojom_types.DeclarationData()..shortName = 'DataHandle ') | |
319 ..type = (new mojom_types.Type() | |
320 ..handleType = (new mojom_types.HandleType() | |
321 ..kind = mojom_types.HandleTypeKind.dataPipeConsumer | |
322 ..nullable = true)), | |
323 ]; | |
324 } | |
232 | 325 |
233 | 326 |
234 class EchoArgsList extends bindings.Struct { | 327 class EchoArgsList extends bindings.Struct { |
235 static const List<bindings.StructDataHeader> kVersions = const [ | 328 static const List<bindings.StructDataHeader> kVersions = const [ |
236 const bindings.StructDataHeader(24, 0) | 329 const bindings.StructDataHeader(24, 0) |
237 ]; | 330 ]; |
238 EchoArgsList next = null; | 331 EchoArgsList next = null; |
239 EchoArgs item = null; | 332 EchoArgs item = null; |
240 | 333 |
241 EchoArgsList() : super(kVersions.last.size); | 334 EchoArgsList() : super(kVersions.last.size); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 return "EchoArgsList(" | 391 return "EchoArgsList(" |
299 "next: $next" ", " | 392 "next: $next" ", " |
300 "item: $item" ")"; | 393 "item: $item" ")"; |
301 } | 394 } |
302 | 395 |
303 Map toJson() { | 396 Map toJson() { |
304 throw new bindings.MojoCodecError( | 397 throw new bindings.MojoCodecError( |
305 'Object containing handles cannot be encoded to JSON.'); | 398 'Object containing handles cannot be encoded to JSON.'); |
306 } | 399 } |
307 } | 400 } |
401 mojom_types.MojomStruct _dart_to_cpp_EchoArgsList__() { | |
402 return new mojom_types.MojomStruct() | |
403 ..declData = (new mojom_types.DeclarationData() | |
404 ..shortName = 'EchoArgsList' | |
405 ..fullIdentifier = 'dart_to_cpp.EchoArgsList') | |
406 ..fields = <mojom_types.StructField>[ | |
407 new mojom_types.StructField() | |
408 ..declData = (new mojom_types.DeclarationData()..shortName = 'Next') | |
409 ..type = (new mojom_types.Type() | |
410 ..typeReference = (new mojom_types.TypeReference() | |
411 ..nullable = true | |
412 | |
413 | |
414 ..identifier = '_dart_to_cpp_EchoArgsList__' | |
zra
2016/01/15 21:01:33
Is this string part of some publicly visible, lang
alexfandrianto
2016/01/20 00:08:28
Yes, it is public to all.
| |
415 ..typeKey = '_dart_to_cpp_EchoArgsList__' | |
416 )), | |
417 | |
418 new mojom_types.StructField() | |
419 ..declData = (new mojom_types.DeclarationData()..shortName = 'Item') | |
420 ..type = (new mojom_types.Type() | |
421 ..typeReference = (new mojom_types.TypeReference() | |
422 ..nullable = true | |
423 | |
424 | |
425 ..identifier = '_dart_to_cpp_EchoArgs__' | |
426 ..typeKey = '_dart_to_cpp_EchoArgs__' | |
427 )), | |
428 ]; | |
429 } | |
308 | 430 |
309 | 431 |
310 class _CppSideStartTestParams extends bindings.Struct { | 432 class _CppSideStartTestParams extends bindings.Struct { |
311 static const List<bindings.StructDataHeader> kVersions = const [ | 433 static const List<bindings.StructDataHeader> kVersions = const [ |
312 const bindings.StructDataHeader(8, 0) | 434 const bindings.StructDataHeader(8, 0) |
313 ]; | 435 ]; |
314 | 436 |
315 _CppSideStartTestParams() : super(kVersions.last.size); | 437 _CppSideStartTestParams() : super(kVersions.last.size); |
316 | 438 |
317 static _CppSideStartTestParams deserialize(bindings.Message message) { | 439 static _CppSideStartTestParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 | 478 |
357 String toString() { | 479 String toString() { |
358 return "_CppSideStartTestParams("")"; | 480 return "_CppSideStartTestParams("")"; |
359 } | 481 } |
360 | 482 |
361 Map toJson() { | 483 Map toJson() { |
362 Map map = new Map(); | 484 Map map = new Map(); |
363 return map; | 485 return map; |
364 } | 486 } |
365 } | 487 } |
488 mojom_types.MojomStruct _dart_to_cpp_CppSide_StartTest_Params__() { | |
489 return new mojom_types.MojomStruct() | |
490 ..declData = (new mojom_types.DeclarationData() | |
491 ..shortName = '_CppSideStartTestParams' | |
zra
2016/01/15 21:01:33
In the generated Dart bindings, this symbol is pri
alexfandrianto
2016/01/20 00:08:28
Yes, in discussions, we decided that we would only
| |
492 ..fullIdentifier = 'dart_to_cpp._CppSideStartTestParams') | |
493 ..fields = <mojom_types.StructField>[]; | |
494 } | |
366 | 495 |
367 | 496 |
368 class _CppSideTestFinishedParams extends bindings.Struct { | 497 class _CppSideTestFinishedParams extends bindings.Struct { |
369 static const List<bindings.StructDataHeader> kVersions = const [ | 498 static const List<bindings.StructDataHeader> kVersions = const [ |
370 const bindings.StructDataHeader(8, 0) | 499 const bindings.StructDataHeader(8, 0) |
371 ]; | 500 ]; |
372 | 501 |
373 _CppSideTestFinishedParams() : super(kVersions.last.size); | 502 _CppSideTestFinishedParams() : super(kVersions.last.size); |
374 | 503 |
375 static _CppSideTestFinishedParams deserialize(bindings.Message message) { | 504 static _CppSideTestFinishedParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 | 543 |
415 String toString() { | 544 String toString() { |
416 return "_CppSideTestFinishedParams("")"; | 545 return "_CppSideTestFinishedParams("")"; |
417 } | 546 } |
418 | 547 |
419 Map toJson() { | 548 Map toJson() { |
420 Map map = new Map(); | 549 Map map = new Map(); |
421 return map; | 550 return map; |
422 } | 551 } |
423 } | 552 } |
553 mojom_types.MojomStruct _dart_to_cpp_CppSide_TestFinished_Params__() { | |
554 return new mojom_types.MojomStruct() | |
555 ..declData = (new mojom_types.DeclarationData() | |
556 ..shortName = '_CppSideTestFinishedParams' | |
557 ..fullIdentifier = 'dart_to_cpp._CppSideTestFinishedParams') | |
558 ..fields = <mojom_types.StructField>[]; | |
559 } | |
424 | 560 |
425 | 561 |
426 class _CppSidePingResponseParams extends bindings.Struct { | 562 class _CppSidePingResponseParams extends bindings.Struct { |
427 static const List<bindings.StructDataHeader> kVersions = const [ | 563 static const List<bindings.StructDataHeader> kVersions = const [ |
428 const bindings.StructDataHeader(8, 0) | 564 const bindings.StructDataHeader(8, 0) |
429 ]; | 565 ]; |
430 | 566 |
431 _CppSidePingResponseParams() : super(kVersions.last.size); | 567 _CppSidePingResponseParams() : super(kVersions.last.size); |
432 | 568 |
433 static _CppSidePingResponseParams deserialize(bindings.Message message) { | 569 static _CppSidePingResponseParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 | 608 |
473 String toString() { | 609 String toString() { |
474 return "_CppSidePingResponseParams("")"; | 610 return "_CppSidePingResponseParams("")"; |
475 } | 611 } |
476 | 612 |
477 Map toJson() { | 613 Map toJson() { |
478 Map map = new Map(); | 614 Map map = new Map(); |
479 return map; | 615 return map; |
480 } | 616 } |
481 } | 617 } |
618 mojom_types.MojomStruct _dart_to_cpp_CppSide_PingResponse_Params__() { | |
619 return new mojom_types.MojomStruct() | |
620 ..declData = (new mojom_types.DeclarationData() | |
621 ..shortName = '_CppSidePingResponseParams' | |
622 ..fullIdentifier = 'dart_to_cpp._CppSidePingResponseParams') | |
623 ..fields = <mojom_types.StructField>[]; | |
624 } | |
482 | 625 |
483 | 626 |
484 class _CppSideEchoResponseParams extends bindings.Struct { | 627 class _CppSideEchoResponseParams extends bindings.Struct { |
485 static const List<bindings.StructDataHeader> kVersions = const [ | 628 static const List<bindings.StructDataHeader> kVersions = const [ |
486 const bindings.StructDataHeader(16, 0) | 629 const bindings.StructDataHeader(16, 0) |
487 ]; | 630 ]; |
488 EchoArgsList list = null; | 631 EchoArgsList list = null; |
489 | 632 |
490 _CppSideEchoResponseParams() : super(kVersions.last.size); | 633 _CppSideEchoResponseParams() : super(kVersions.last.size); |
491 | 634 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 String toString() { | 682 String toString() { |
540 return "_CppSideEchoResponseParams(" | 683 return "_CppSideEchoResponseParams(" |
541 "list: $list" ")"; | 684 "list: $list" ")"; |
542 } | 685 } |
543 | 686 |
544 Map toJson() { | 687 Map toJson() { |
545 throw new bindings.MojoCodecError( | 688 throw new bindings.MojoCodecError( |
546 'Object containing handles cannot be encoded to JSON.'); | 689 'Object containing handles cannot be encoded to JSON.'); |
547 } | 690 } |
548 } | 691 } |
692 mojom_types.MojomStruct _dart_to_cpp_CppSide_EchoResponse_Params__() { | |
693 return new mojom_types.MojomStruct() | |
694 ..declData = (new mojom_types.DeclarationData() | |
695 ..shortName = '_CppSideEchoResponseParams' | |
696 ..fullIdentifier = 'dart_to_cpp._CppSideEchoResponseParams') | |
697 ..fields = <mojom_types.StructField>[ | |
698 new mojom_types.StructField() | |
699 ..declData = (new mojom_types.DeclarationData()..shortName = 'List') | |
700 ..type = (new mojom_types.Type() | |
701 ..typeReference = (new mojom_types.TypeReference() | |
702 | |
703 ..identifier = '_dart_to_cpp_EchoArgsList__' | |
704 ..typeKey = '_dart_to_cpp_EchoArgsList__' | |
705 )), | |
zra
2016/01/15 21:01:33
Indentation problem.
azani
2016/01/15 23:21:57
To clarify, this mojom struct is automatically gen
alexfandrianto
2016/01/20 00:08:28
It's hard to get nested macros right, but it looks
| |
706 ]; | |
707 } | |
549 | 708 |
550 | 709 |
551 class _DartSideSetClientParams extends bindings.Struct { | 710 class _DartSideSetClientParams extends bindings.Struct { |
552 static const List<bindings.StructDataHeader> kVersions = const [ | 711 static const List<bindings.StructDataHeader> kVersions = const [ |
553 const bindings.StructDataHeader(16, 0) | 712 const bindings.StructDataHeader(16, 0) |
554 ]; | 713 ]; |
555 Object cppSide = null; | 714 Object cppSide = null; |
556 | 715 |
557 _DartSideSetClientParams() : super(kVersions.last.size); | 716 _DartSideSetClientParams() : super(kVersions.last.size); |
558 | 717 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
605 String toString() { | 764 String toString() { |
606 return "_DartSideSetClientParams(" | 765 return "_DartSideSetClientParams(" |
607 "cppSide: $cppSide" ")"; | 766 "cppSide: $cppSide" ")"; |
608 } | 767 } |
609 | 768 |
610 Map toJson() { | 769 Map toJson() { |
611 throw new bindings.MojoCodecError( | 770 throw new bindings.MojoCodecError( |
612 'Object containing handles cannot be encoded to JSON.'); | 771 'Object containing handles cannot be encoded to JSON.'); |
613 } | 772 } |
614 } | 773 } |
774 mojom_types.MojomStruct _dart_to_cpp_DartSide_SetClient_Params__() { | |
775 return new mojom_types.MojomStruct() | |
776 ..declData = (new mojom_types.DeclarationData() | |
777 ..shortName = '_DartSideSetClientParams' | |
778 ..fullIdentifier = 'dart_to_cpp._DartSideSetClientParams') | |
779 ..fields = <mojom_types.StructField>[ | |
780 new mojom_types.StructField() | |
781 ..declData = (new mojom_types.DeclarationData()..shortName = 'CppSide') | |
782 ..type = (new mojom_types.Type() | |
783 ..typeReference = (new mojom_types.TypeReference() | |
784 | |
785 ..identifier = '_dart_to_cpp_CppSide__' | |
786 ..typeKey = '_dart_to_cpp_CppSide__' | |
787 )), | |
788 ]; | |
789 } | |
615 | 790 |
616 | 791 |
617 class _DartSidePingParams extends bindings.Struct { | 792 class _DartSidePingParams extends bindings.Struct { |
618 static const List<bindings.StructDataHeader> kVersions = const [ | 793 static const List<bindings.StructDataHeader> kVersions = const [ |
619 const bindings.StructDataHeader(8, 0) | 794 const bindings.StructDataHeader(8, 0) |
620 ]; | 795 ]; |
621 | 796 |
622 _DartSidePingParams() : super(kVersions.last.size); | 797 _DartSidePingParams() : super(kVersions.last.size); |
623 | 798 |
624 static _DartSidePingParams deserialize(bindings.Message message) { | 799 static _DartSidePingParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
663 | 838 |
664 String toString() { | 839 String toString() { |
665 return "_DartSidePingParams("")"; | 840 return "_DartSidePingParams("")"; |
666 } | 841 } |
667 | 842 |
668 Map toJson() { | 843 Map toJson() { |
669 Map map = new Map(); | 844 Map map = new Map(); |
670 return map; | 845 return map; |
671 } | 846 } |
672 } | 847 } |
848 mojom_types.MojomStruct _dart_to_cpp_DartSide_Ping_Params__() { | |
849 return new mojom_types.MojomStruct() | |
850 ..declData = (new mojom_types.DeclarationData() | |
851 ..shortName = '_DartSidePingParams' | |
852 ..fullIdentifier = 'dart_to_cpp._DartSidePingParams') | |
853 ..fields = <mojom_types.StructField>[]; | |
854 } | |
673 | 855 |
674 | 856 |
675 class _DartSideEchoParams extends bindings.Struct { | 857 class _DartSideEchoParams extends bindings.Struct { |
676 static const List<bindings.StructDataHeader> kVersions = const [ | 858 static const List<bindings.StructDataHeader> kVersions = const [ |
677 const bindings.StructDataHeader(24, 0) | 859 const bindings.StructDataHeader(24, 0) |
678 ]; | 860 ]; |
679 int numIterations = 0; | 861 int numIterations = 0; |
680 EchoArgs arg = null; | 862 EchoArgs arg = null; |
681 | 863 |
682 _DartSideEchoParams() : super(kVersions.last.size); | 864 _DartSideEchoParams() : super(kVersions.last.size); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
738 return "_DartSideEchoParams(" | 920 return "_DartSideEchoParams(" |
739 "numIterations: $numIterations" ", " | 921 "numIterations: $numIterations" ", " |
740 "arg: $arg" ")"; | 922 "arg: $arg" ")"; |
741 } | 923 } |
742 | 924 |
743 Map toJson() { | 925 Map toJson() { |
744 throw new bindings.MojoCodecError( | 926 throw new bindings.MojoCodecError( |
745 'Object containing handles cannot be encoded to JSON.'); | 927 'Object containing handles cannot be encoded to JSON.'); |
746 } | 928 } |
747 } | 929 } |
930 mojom_types.MojomStruct _dart_to_cpp_DartSide_Echo_Params__() { | |
931 return new mojom_types.MojomStruct() | |
932 ..declData = (new mojom_types.DeclarationData() | |
933 ..shortName = '_DartSideEchoParams' | |
934 ..fullIdentifier = 'dart_to_cpp._DartSideEchoParams') | |
935 ..fields = <mojom_types.StructField>[ | |
936 new mojom_types.StructField() | |
937 ..declData = (new mojom_types.DeclarationData()..shortName = 'NumIterati ons') | |
938 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in t32), | |
939 | |
940 new mojom_types.StructField() | |
941 ..declData = (new mojom_types.DeclarationData()..shortName = 'Arg') | |
942 ..type = (new mojom_types.Type() | |
943 ..typeReference = (new mojom_types.TypeReference() | |
944 | |
945 ..identifier = '_dart_to_cpp_EchoArgs__' | |
946 ..typeKey = '_dart_to_cpp_EchoArgs__' | |
947 )), | |
948 ]; | |
949 } | |
950 | |
748 | 951 |
749 const int _CppSide_startTestName = 88888888; | 952 const int _CppSide_startTestName = 88888888; |
750 const int _CppSide_testFinishedName = 99999999; | 953 const int _CppSide_testFinishedName = 99999999; |
751 const int _CppSide_pingResponseName = 100000000; | 954 const int _CppSide_pingResponseName = 100000000; |
752 const int _CppSide_echoResponseName = 100000001; | 955 const int _CppSide_echoResponseName = 100000001; |
753 | 956 |
957 mojom_types.MojomInterface _dart_to_cpp_CppSide__() { | |
958 return new mojom_types.MojomInterface() | |
959 ..declData = (new mojom_types.DeclarationData() | |
960 ..shortName = 'CppSide' | |
961 ..fullIdentifier = 'dart_to_cpp.CppSide') | |
962 ..interfaceName = 'CppSide' | |
963 ..methods = <int, mojom_types.MojomMethod>{ | |
964 _CppSide_startTestName: new mojom_types.MojomMethod() | |
965 ..declData = (new mojom_types.DeclarationData()..shortName = 'StartTest' ) | |
966 ..ordinal = _CppSide_startTestName..parameters = _dart_to_cpp_CppSide_St artTest_Params__(),_CppSide_testFinishedName: new mojom_types.MojomMethod() | |
zra
2016/01/15 21:01:33
This doesn't look right.
Missing newline here: _
alexfandrianto
2016/01/20 00:08:28
Done.
| |
967 ..declData = (new mojom_types.DeclarationData()..shortName = 'TestFinish ed') | |
968 ..ordinal = _CppSide_testFinishedName..parameters = _dart_to_cpp_CppSide _TestFinished_Params__(),_CppSide_pingResponseName: new mojom_types.MojomMethod( ) | |
969 ..declData = (new mojom_types.DeclarationData()..shortName = 'PingRespon se') | |
970 ..ordinal = _CppSide_pingResponseName..parameters = _dart_to_cpp_CppSide _PingResponse_Params__(),_CppSide_echoResponseName: new mojom_types.MojomMethod( ) | |
971 ..declData = (new mojom_types.DeclarationData()..shortName = 'EchoRespon se') | |
972 ..ordinal = _CppSide_echoResponseName..parameters = _dart_to_cpp_CppSide _EchoResponse_Params__(), | |
973 }; | |
974 } | |
975 | |
976 class _CppSideServiceDescription implements service_describer.ServiceDescription { | |
977 dynamic getTopLevelInterface([Function responseFactory = null]) { | |
978 return _dart_to_cpp_CppSide__(); | |
979 } | |
980 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { | |
981 return getAllMojomTypeDefinitions()[typeKey]; | |
982 } | |
983 dynamic getAllTypeDefinitions([Function responseFactory = null]) { | |
984 return getAllMojomTypeDefinitions(); | |
985 } | |
986 } | |
987 | |
754 abstract class CppSide { | 988 abstract class CppSide { |
755 static const String serviceName = null; | 989 static const String serviceName = null; |
756 void startTest(); | 990 void startTest(); |
757 void testFinished(); | 991 void testFinished(); |
758 void pingResponse(); | 992 void pingResponse(); |
759 void echoResponse(EchoArgsList list); | 993 void echoResponse(EchoArgsList list); |
760 } | 994 } |
761 | 995 |
762 | 996 |
763 class _CppSideProxyImpl extends bindings.Proxy { | 997 class _CppSideProxyImpl extends bindings.Proxy { |
764 _CppSideProxyImpl.fromEndpoint( | 998 _CppSideProxyImpl.fromEndpoint( |
765 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 999 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
766 | 1000 |
767 _CppSideProxyImpl.fromHandle(core.MojoHandle handle) : | 1001 _CppSideProxyImpl.fromHandle(core.MojoHandle handle) : |
768 super.fromHandle(handle); | 1002 super.fromHandle(handle); |
769 | 1003 |
770 _CppSideProxyImpl.unbound() : super.unbound(); | 1004 _CppSideProxyImpl.unbound() : super.unbound(); |
771 | 1005 |
772 static _CppSideProxyImpl newFromEndpoint( | 1006 static _CppSideProxyImpl newFromEndpoint( |
773 core.MojoMessagePipeEndpoint endpoint) { | 1007 core.MojoMessagePipeEndpoint endpoint) { |
774 assert(endpoint.setDescription("For _CppSideProxyImpl")); | 1008 assert(endpoint.setDescription("For _CppSideProxyImpl")); |
775 return new _CppSideProxyImpl.fromEndpoint(endpoint); | 1009 return new _CppSideProxyImpl.fromEndpoint(endpoint); |
776 } | 1010 } |
777 | 1011 |
1012 service_describer.ServiceDescription get serviceDescription => | |
1013 new _CppSideServiceDescription(); | |
1014 | |
778 void handleResponse(bindings.ServiceMessage message) { | 1015 void handleResponse(bindings.ServiceMessage message) { |
779 switch (message.header.type) { | 1016 switch (message.header.type) { |
780 default: | 1017 default: |
781 proxyError("Unexpected message type: ${message.header.type}"); | 1018 proxyError("Unexpected message type: ${message.header.type}"); |
782 close(immediate: true); | 1019 close(immediate: true); |
783 break; | 1020 break; |
784 } | 1021 } |
785 } | 1022 } |
786 | 1023 |
787 String toString() { | 1024 String toString() { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
950 assert(_impl == null); | 1187 assert(_impl == null); |
951 _impl = d; | 1188 _impl = d; |
952 } | 1189 } |
953 | 1190 |
954 String toString() { | 1191 String toString() { |
955 var superString = super.toString(); | 1192 var superString = super.toString(); |
956 return "CppSideStub($superString)"; | 1193 return "CppSideStub($superString)"; |
957 } | 1194 } |
958 | 1195 |
959 int get version => 0; | 1196 int get version => 0; |
1197 | |
zra
2016/01/15 21:01:33
Extra newline.
alexfandrianto
2016/01/20 00:08:28
Done.
| |
1198 | |
1199 service_describer.ServiceDescription get serviceDescription => | |
1200 new _CppSideServiceDescription(); | |
960 } | 1201 } |
961 | 1202 |
962 const int _DartSide_setClientName = 0; | 1203 const int _DartSide_setClientName = 0; |
963 const int _DartSide_pingName = 1; | 1204 const int _DartSide_pingName = 1; |
964 const int _DartSide_echoName = 2; | 1205 const int _DartSide_echoName = 2; |
965 | 1206 |
1207 mojom_types.MojomInterface _dart_to_cpp_DartSide__() { | |
1208 return new mojom_types.MojomInterface() | |
1209 ..declData = (new mojom_types.DeclarationData() | |
1210 ..shortName = 'DartSide' | |
1211 ..fullIdentifier = 'dart_to_cpp.DartSide') | |
1212 ..interfaceName = 'DartSide' | |
1213 ..methods = <int, mojom_types.MojomMethod>{ | |
1214 _DartSide_setClientName: new mojom_types.MojomMethod() | |
1215 ..declData = (new mojom_types.DeclarationData()..shortName = 'SetClient' ) | |
1216 ..ordinal = _DartSide_setClientName..parameters = _dart_to_cpp_DartSide_ SetClient_Params__(),_DartSide_pingName: new mojom_types.MojomMethod() | |
1217 ..declData = (new mojom_types.DeclarationData()..shortName = 'Ping') | |
1218 ..ordinal = _DartSide_pingName..parameters = _dart_to_cpp_DartSide_Ping_ Params__(),_DartSide_echoName: new mojom_types.MojomMethod() | |
1219 ..declData = (new mojom_types.DeclarationData()..shortName = 'Echo') | |
1220 ..ordinal = _DartSide_echoName..parameters = _dart_to_cpp_DartSide_Echo_ Params__(), | |
1221 }; | |
1222 } | |
1223 | |
1224 class _DartSideServiceDescription implements service_describer.ServiceDescriptio n { | |
1225 dynamic getTopLevelInterface([Function responseFactory = null]) { | |
zra
2016/01/15 21:01:33
Indentation.
These functions can also be written
alexfandrianto
2016/01/20 00:08:28
Done.
| |
1226 return _dart_to_cpp_DartSide__(); | |
1227 } | |
zra
2016/01/15 21:01:33
Missing newline.
alexfandrianto
2016/01/20 00:08:28
Done.
| |
1228 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { | |
zra
2016/01/15 21:01:33
Missing space after ,
alexfandrianto
2016/01/20 00:08:28
Done.
| |
1229 return getAllMojomTypeDefinitions()[typeKey]; | |
1230 } | |
1231 dynamic getAllTypeDefinitions([Function responseFactory = null]) { | |
1232 return getAllMojomTypeDefinitions(); | |
1233 } | |
1234 } | |
1235 | |
966 abstract class DartSide { | 1236 abstract class DartSide { |
967 static const String serviceName = null; | 1237 static const String serviceName = null; |
968 void setClient(Object cppSide); | 1238 void setClient(Object cppSide); |
969 void ping(); | 1239 void ping(); |
970 void echo(int numIterations, EchoArgs arg); | 1240 void echo(int numIterations, EchoArgs arg); |
971 } | 1241 } |
972 | 1242 |
973 | 1243 |
974 class _DartSideProxyImpl extends bindings.Proxy { | 1244 class _DartSideProxyImpl extends bindings.Proxy { |
975 _DartSideProxyImpl.fromEndpoint( | 1245 _DartSideProxyImpl.fromEndpoint( |
976 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1246 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
977 | 1247 |
978 _DartSideProxyImpl.fromHandle(core.MojoHandle handle) : | 1248 _DartSideProxyImpl.fromHandle(core.MojoHandle handle) : |
979 super.fromHandle(handle); | 1249 super.fromHandle(handle); |
980 | 1250 |
981 _DartSideProxyImpl.unbound() : super.unbound(); | 1251 _DartSideProxyImpl.unbound() : super.unbound(); |
982 | 1252 |
983 static _DartSideProxyImpl newFromEndpoint( | 1253 static _DartSideProxyImpl newFromEndpoint( |
984 core.MojoMessagePipeEndpoint endpoint) { | 1254 core.MojoMessagePipeEndpoint endpoint) { |
985 assert(endpoint.setDescription("For _DartSideProxyImpl")); | 1255 assert(endpoint.setDescription("For _DartSideProxyImpl")); |
986 return new _DartSideProxyImpl.fromEndpoint(endpoint); | 1256 return new _DartSideProxyImpl.fromEndpoint(endpoint); |
987 } | 1257 } |
988 | 1258 |
1259 service_describer.ServiceDescription get serviceDescription => | |
1260 new _DartSideServiceDescription(); | |
1261 | |
989 void handleResponse(bindings.ServiceMessage message) { | 1262 void handleResponse(bindings.ServiceMessage message) { |
990 switch (message.header.type) { | 1263 switch (message.header.type) { |
991 default: | 1264 default: |
992 proxyError("Unexpected message type: ${message.header.type}"); | 1265 proxyError("Unexpected message type: ${message.header.type}"); |
993 close(immediate: true); | 1266 close(immediate: true); |
994 break; | 1267 break; |
995 } | 1268 } |
996 } | 1269 } |
997 | 1270 |
998 String toString() { | 1271 String toString() { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1150 assert(_impl == null); | 1423 assert(_impl == null); |
1151 _impl = d; | 1424 _impl = d; |
1152 } | 1425 } |
1153 | 1426 |
1154 String toString() { | 1427 String toString() { |
1155 var superString = super.toString(); | 1428 var superString = super.toString(); |
1156 return "DartSideStub($superString)"; | 1429 return "DartSideStub($superString)"; |
1157 } | 1430 } |
1158 | 1431 |
1159 int get version => 0; | 1432 int get version => 0; |
1433 | |
1434 | |
1435 service_describer.ServiceDescription get serviceDescription => | |
1436 new _DartSideServiceDescription(); | |
1160 } | 1437 } |
1161 | 1438 |
1162 | 1439 |
1440 | |
zra
2016/01/15 21:01:33
Lots of extra newlines.
| |
1441 | |
1442 | |
1443 | |
1444 | |
1445 Map<String, mojom_types.UserDefinedType> _initDescriptions() { | |
1446 var map = new HashMap<String, mojom_types.UserDefinedType>(); | |
1447 map["_dart_to_cpp_EchoArgs__"] = | |
zra
2016/01/15 21:01:33
Indentation.
| |
1448 new mojom_types.UserDefinedType() | |
1449 ..structType = _dart_to_cpp_EchoArgs__(); | |
1450 map["_dart_to_cpp_EchoArgsList__"] = | |
zra
2016/01/15 21:01:33
Can these keys be Dart-styled?
| |
1451 new mojom_types.UserDefinedType() | |
1452 ..structType = _dart_to_cpp_EchoArgsList__(); | |
1453 map["_dart_to_cpp_CppSide_StartTest_Params__"] = | |
1454 new mojom_types.UserDefinedType() | |
1455 ..structType = _dart_to_cpp_CppSide_StartTest_Params__(); | |
1456 map["_dart_to_cpp_CppSide_TestFinished_Params__"] = | |
1457 new mojom_types.UserDefinedType() | |
1458 ..structType = _dart_to_cpp_CppSide_TestFinished_Params__(); | |
1459 map["_dart_to_cpp_CppSide_PingResponse_Params__"] = | |
1460 new mojom_types.UserDefinedType() | |
1461 ..structType = _dart_to_cpp_CppSide_PingResponse_Params__(); | |
1462 map["_dart_to_cpp_CppSide_EchoResponse_Params__"] = | |
1463 new mojom_types.UserDefinedType() | |
1464 ..structType = _dart_to_cpp_CppSide_EchoResponse_Params__(); | |
1465 map["_dart_to_cpp_DartSide_SetClient_Params__"] = | |
1466 new mojom_types.UserDefinedType() | |
1467 ..structType = _dart_to_cpp_DartSide_SetClient_Params__(); | |
1468 map["_dart_to_cpp_DartSide_Ping_Params__"] = | |
1469 new mojom_types.UserDefinedType() | |
1470 ..structType = _dart_to_cpp_DartSide_Ping_Params__(); | |
1471 map["_dart_to_cpp_DartSide_Echo_Params__"] = | |
1472 new mojom_types.UserDefinedType() | |
1473 ..structType = _dart_to_cpp_DartSide_Echo_Params__(); | |
1474 map["_dart_to_cpp_CppSide__"] = | |
1475 new mojom_types.UserDefinedType() | |
1476 ..interfaceType = _dart_to_cpp_CppSide__(); | |
1477 map["_dart_to_cpp_DartSide__"] = | |
1478 new mojom_types.UserDefinedType() | |
1479 ..interfaceType = _dart_to_cpp_DartSide__(); | |
1480 | |
1481 return map; | |
1482 } | |
1483 | |
1484 var _MojomDesc; | |
zra
2016/01/15 21:01:33
Map<String, mojom_types.UserDefinedType> _mojomDes
| |
1485 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { | |
1486 if (_MojomDesc == null) { | |
1487 _MojomDesc = _initDescriptions(); | |
1488 } | |
1489 return _MojomDesc; | |
1490 } | |
1491 | |
OLD | NEW |