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

Side by Side Diff: mojo/dart/packages/_mojo_for_test_only/lib/dart_to_cpp/dart_to_cpp.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 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
232 235
236 mojom_types.MojomStruct _dartToCppEchoArgs() {
237 return new mojom_types.MojomStruct()
238 ..declData = (new mojom_types.DeclarationData()
239 ..shortName = 'EchoArgs'
240 ..fullIdentifier = 'dart_to_cpp.EchoArgs')
241 ..fields = <mojom_types.StructField>[
242 new mojom_types.StructField()
243 ..declData = (new mojom_types.DeclarationData()
244 ..shortName = 'Si64')
245 ..type = (new mojom_types.Type()
246 ..simpleType = mojom_types.SimpleType.int64),
247 new mojom_types.StructField()
248 ..declData = (new mojom_types.DeclarationData()
249 ..shortName = 'Si32')
250 ..type = (new mojom_types.Type()
251 ..simpleType = mojom_types.SimpleType.int32),
252 new mojom_types.StructField()
253 ..declData = (new mojom_types.DeclarationData()
254 ..shortName = 'Si16')
255 ..type = (new mojom_types.Type()
256 ..simpleType = mojom_types.SimpleType.int16),
257 new mojom_types.StructField()
258 ..declData = (new mojom_types.DeclarationData()
259 ..shortName = 'Si8')
260 ..type = (new mojom_types.Type()
261 ..simpleType = mojom_types.SimpleType.int8),
262 new mojom_types.StructField()
263 ..declData = (new mojom_types.DeclarationData()
264 ..shortName = 'Ui64')
265 ..type = (new mojom_types.Type()
266 ..simpleType = mojom_types.SimpleType.uint64),
267 new mojom_types.StructField()
268 ..declData = (new mojom_types.DeclarationData()
269 ..shortName = 'Ui32')
270 ..type = (new mojom_types.Type()
271 ..simpleType = mojom_types.SimpleType.uint32),
272 new mojom_types.StructField()
273 ..declData = (new mojom_types.DeclarationData()
274 ..shortName = 'Ui16')
275 ..type = (new mojom_types.Type()
276 ..simpleType = mojom_types.SimpleType.uint16),
277 new mojom_types.StructField()
278 ..declData = (new mojom_types.DeclarationData()
279 ..shortName = 'Ui8')
280 ..type = (new mojom_types.Type()
281 ..simpleType = mojom_types.SimpleType.uint8),
282 new mojom_types.StructField()
283 ..declData = (new mojom_types.DeclarationData()
284 ..shortName = 'FloatVal')
285 ..type = (new mojom_types.Type()
286 ..simpleType = mojom_types.SimpleType.float),
287 new mojom_types.StructField()
288 ..declData = (new mojom_types.DeclarationData()
289 ..shortName = 'FloatInf')
290 ..type = (new mojom_types.Type()
291 ..simpleType = mojom_types.SimpleType.float),
292 new mojom_types.StructField()
293 ..declData = (new mojom_types.DeclarationData()
294 ..shortName = 'FloatNan')
295 ..type = (new mojom_types.Type()
296 ..simpleType = mojom_types.SimpleType.float),
297 new mojom_types.StructField()
298 ..declData = (new mojom_types.DeclarationData()
299 ..shortName = 'DoubleVal')
300 ..type = (new mojom_types.Type()
301 ..simpleType = mojom_types.SimpleType.double),
302 new mojom_types.StructField()
303 ..declData = (new mojom_types.DeclarationData()
304 ..shortName = 'DoubleInf')
305 ..type = (new mojom_types.Type()
306 ..simpleType = mojom_types.SimpleType.double),
307 new mojom_types.StructField()
308 ..declData = (new mojom_types.DeclarationData()
309 ..shortName = 'DoubleNan')
310 ..type = (new mojom_types.Type()
311 ..simpleType = mojom_types.SimpleType.double),
312 new mojom_types.StructField()
313 ..declData = (new mojom_types.DeclarationData()
314 ..shortName = 'Name')
315 ..type = (new mojom_types.Type()
316 ..stringType = (new mojom_types.StringType()
317 ..nullable = true
318 )),
319 new mojom_types.StructField()
320 ..declData = (new mojom_types.DeclarationData()
321 ..shortName = 'StringArray')
322 ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType ()
zra 2016/01/27 18:15:11 Other fields of type seem to be initialized on the
alexfandrianto 2016/01/28 03:45:12 Done.
323 ..nullable = true
324
325 ..elementType = (new mojom_types.Type()
326 ..stringType = (new mojom_types.StringType())))),
327 new mojom_types.StructField()
328 ..declData = (new mojom_types.DeclarationData()
329 ..shortName = 'MessageHandle')
330 ..type = (new mojom_types.Type()
331 ..handleType = (new mojom_types.HandleType()
332 ..kind = mojom_types.HandleTypeKind.messagePipe
333 ..nullable = true
334 )),
335 new mojom_types.StructField()
336 ..declData = (new mojom_types.DeclarationData()
337 ..shortName = 'DataHandle')
338 ..type = (new mojom_types.Type()
339 ..handleType = (new mojom_types.HandleType()
340 ..kind = mojom_types.HandleTypeKind.dataPipeConsumer
341 ..nullable = true
342 )),];
343 }
344
233 345
234 class EchoArgsList extends bindings.Struct { 346 class EchoArgsList extends bindings.Struct {
235 static const List<bindings.StructDataHeader> kVersions = const [ 347 static const List<bindings.StructDataHeader> kVersions = const [
236 const bindings.StructDataHeader(24, 0) 348 const bindings.StructDataHeader(24, 0)
237 ]; 349 ];
238 EchoArgsList next = null; 350 EchoArgsList next = null;
239 EchoArgs item = null; 351 EchoArgs item = null;
240 352
241 EchoArgsList() : super(kVersions.last.size); 353 EchoArgsList() : super(kVersions.last.size);
242 354
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 "next: $next" ", " 411 "next: $next" ", "
300 "item: $item" ")"; 412 "item: $item" ")";
301 } 413 }
302 414
303 Map toJson() { 415 Map toJson() {
304 throw new bindings.MojoCodecError( 416 throw new bindings.MojoCodecError(
305 'Object containing handles cannot be encoded to JSON.'); 417 'Object containing handles cannot be encoded to JSON.');
306 } 418 }
307 } 419 }
308 420
421 mojom_types.MojomStruct _dartToCppEchoArgsList() {
422 return new mojom_types.MojomStruct()
423 ..declData = (new mojom_types.DeclarationData()
424 ..shortName = 'EchoArgsList'
425 ..fullIdentifier = 'dart_to_cpp.EchoArgsList')
426 ..fields = <mojom_types.StructField>[
427 new mojom_types.StructField()
428 ..declData = (new mojom_types.DeclarationData()
429 ..shortName = 'Next')
430 ..type = (new mojom_types.Type()
431 ..typeReference = (new mojom_types.TypeReference()
432 ..nullable = true
433
zra 2016/01/27 18:15:11 Extra newlines.
434
435 ..identifier = 'dart_to_cpp_EchoArgsList__'
436 ..typeKey = 'dart_to_cpp_EchoArgsList__'
437 )),
438 new mojom_types.StructField()
439 ..declData = (new mojom_types.DeclarationData()
440 ..shortName = 'Item')
441 ..type = (new mojom_types.Type()
442 ..typeReference = (new mojom_types.TypeReference()
443 ..nullable = true
444
445
446 ..identifier = 'dart_to_cpp_EchoArgs__'
447 ..typeKey = 'dart_to_cpp_EchoArgs__'
448 )),];
449 }
450
309 451
310 class _CppSideStartTestParams extends bindings.Struct { 452 class _CppSideStartTestParams extends bindings.Struct {
311 static const List<bindings.StructDataHeader> kVersions = const [ 453 static const List<bindings.StructDataHeader> kVersions = const [
312 const bindings.StructDataHeader(8, 0) 454 const bindings.StructDataHeader(8, 0)
313 ]; 455 ];
314 456
315 _CppSideStartTestParams() : super(kVersions.last.size); 457 _CppSideStartTestParams() : super(kVersions.last.size);
316 458
317 static _CppSideStartTestParams deserialize(bindings.Message message) { 459 static _CppSideStartTestParams deserialize(bindings.Message message) {
318 var decoder = new bindings.Decoder(message); 460 var decoder = new bindings.Decoder(message);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 String toString() { 499 String toString() {
358 return "_CppSideStartTestParams("")"; 500 return "_CppSideStartTestParams("")";
359 } 501 }
360 502
361 Map toJson() { 503 Map toJson() {
362 Map map = new Map(); 504 Map map = new Map();
363 return map; 505 return map;
364 } 506 }
365 } 507 }
366 508
509 mojom_types.MojomStruct _dartToCppCppSideStartTestParams() {
510 return new mojom_types.MojomStruct()
511 ..declData = (new mojom_types.DeclarationData()
512 ..shortName = 'CppSideStartTestParams'
513 ..fullIdentifier = 'dart_to_cpp.CppSide_StartTest_Params')
514 ..fields = <mojom_types.StructField>[];
515 }
516
367 517
368 class _CppSideTestFinishedParams extends bindings.Struct { 518 class _CppSideTestFinishedParams extends bindings.Struct {
369 static const List<bindings.StructDataHeader> kVersions = const [ 519 static const List<bindings.StructDataHeader> kVersions = const [
370 const bindings.StructDataHeader(8, 0) 520 const bindings.StructDataHeader(8, 0)
371 ]; 521 ];
372 522
373 _CppSideTestFinishedParams() : super(kVersions.last.size); 523 _CppSideTestFinishedParams() : super(kVersions.last.size);
374 524
375 static _CppSideTestFinishedParams deserialize(bindings.Message message) { 525 static _CppSideTestFinishedParams deserialize(bindings.Message message) {
376 var decoder = new bindings.Decoder(message); 526 var decoder = new bindings.Decoder(message);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 String toString() { 565 String toString() {
416 return "_CppSideTestFinishedParams("")"; 566 return "_CppSideTestFinishedParams("")";
417 } 567 }
418 568
419 Map toJson() { 569 Map toJson() {
420 Map map = new Map(); 570 Map map = new Map();
421 return map; 571 return map;
422 } 572 }
423 } 573 }
424 574
575 mojom_types.MojomStruct _dartToCppCppSideTestFinishedParams() {
576 return new mojom_types.MojomStruct()
577 ..declData = (new mojom_types.DeclarationData()
578 ..shortName = 'CppSideTestFinishedParams'
579 ..fullIdentifier = 'dart_to_cpp.CppSide_TestFinished_Params')
580 ..fields = <mojom_types.StructField>[];
581 }
582
425 583
426 class _CppSidePingResponseParams extends bindings.Struct { 584 class _CppSidePingResponseParams extends bindings.Struct {
427 static const List<bindings.StructDataHeader> kVersions = const [ 585 static const List<bindings.StructDataHeader> kVersions = const [
428 const bindings.StructDataHeader(8, 0) 586 const bindings.StructDataHeader(8, 0)
429 ]; 587 ];
430 588
431 _CppSidePingResponseParams() : super(kVersions.last.size); 589 _CppSidePingResponseParams() : super(kVersions.last.size);
432 590
433 static _CppSidePingResponseParams deserialize(bindings.Message message) { 591 static _CppSidePingResponseParams deserialize(bindings.Message message) {
434 var decoder = new bindings.Decoder(message); 592 var decoder = new bindings.Decoder(message);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 String toString() { 631 String toString() {
474 return "_CppSidePingResponseParams("")"; 632 return "_CppSidePingResponseParams("")";
475 } 633 }
476 634
477 Map toJson() { 635 Map toJson() {
478 Map map = new Map(); 636 Map map = new Map();
479 return map; 637 return map;
480 } 638 }
481 } 639 }
482 640
641 mojom_types.MojomStruct _dartToCppCppSidePingResponseParams() {
642 return new mojom_types.MojomStruct()
643 ..declData = (new mojom_types.DeclarationData()
644 ..shortName = 'CppSidePingResponseParams'
645 ..fullIdentifier = 'dart_to_cpp.CppSide_PingResponse_Params')
646 ..fields = <mojom_types.StructField>[];
647 }
648
483 649
484 class _CppSideEchoResponseParams extends bindings.Struct { 650 class _CppSideEchoResponseParams extends bindings.Struct {
485 static const List<bindings.StructDataHeader> kVersions = const [ 651 static const List<bindings.StructDataHeader> kVersions = const [
486 const bindings.StructDataHeader(16, 0) 652 const bindings.StructDataHeader(16, 0)
487 ]; 653 ];
488 EchoArgsList list = null; 654 EchoArgsList list = null;
489 655
490 _CppSideEchoResponseParams() : super(kVersions.last.size); 656 _CppSideEchoResponseParams() : super(kVersions.last.size);
491 657
492 static _CppSideEchoResponseParams deserialize(bindings.Message message) { 658 static _CppSideEchoResponseParams deserialize(bindings.Message message) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return "_CppSideEchoResponseParams(" 706 return "_CppSideEchoResponseParams("
541 "list: $list" ")"; 707 "list: $list" ")";
542 } 708 }
543 709
544 Map toJson() { 710 Map toJson() {
545 throw new bindings.MojoCodecError( 711 throw new bindings.MojoCodecError(
546 'Object containing handles cannot be encoded to JSON.'); 712 'Object containing handles cannot be encoded to JSON.');
547 } 713 }
548 } 714 }
549 715
716 mojom_types.MojomStruct _dartToCppCppSideEchoResponseParams() {
717 return new mojom_types.MojomStruct()
718 ..declData = (new mojom_types.DeclarationData()
719 ..shortName = 'CppSideEchoResponseParams'
720 ..fullIdentifier = 'dart_to_cpp.CppSide_EchoResponse_Params')
721 ..fields = <mojom_types.StructField>[
722 new mojom_types.StructField()
723 ..declData = (new mojom_types.DeclarationData()
724 ..shortName = 'List')
725 ..type = (new mojom_types.Type()
726 ..typeReference = (new mojom_types.TypeReference()
727
728 ..identifier = 'dart_to_cpp_EchoArgsList__'
729 ..typeKey = 'dart_to_cpp_EchoArgsList__'
730 )),];
731 }
732
550 733
551 class _DartSideSetClientParams extends bindings.Struct { 734 class _DartSideSetClientParams extends bindings.Struct {
552 static const List<bindings.StructDataHeader> kVersions = const [ 735 static const List<bindings.StructDataHeader> kVersions = const [
553 const bindings.StructDataHeader(16, 0) 736 const bindings.StructDataHeader(16, 0)
554 ]; 737 ];
555 Object cppSide = null; 738 Object cppSide = null;
556 739
557 _DartSideSetClientParams() : super(kVersions.last.size); 740 _DartSideSetClientParams() : super(kVersions.last.size);
558 741
559 static _DartSideSetClientParams deserialize(bindings.Message message) { 742 static _DartSideSetClientParams deserialize(bindings.Message message) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 return "_DartSideSetClientParams(" 789 return "_DartSideSetClientParams("
607 "cppSide: $cppSide" ")"; 790 "cppSide: $cppSide" ")";
608 } 791 }
609 792
610 Map toJson() { 793 Map toJson() {
611 throw new bindings.MojoCodecError( 794 throw new bindings.MojoCodecError(
612 'Object containing handles cannot be encoded to JSON.'); 795 'Object containing handles cannot be encoded to JSON.');
613 } 796 }
614 } 797 }
615 798
799 mojom_types.MojomStruct _dartToCppDartSideSetClientParams() {
800 return new mojom_types.MojomStruct()
801 ..declData = (new mojom_types.DeclarationData()
802 ..shortName = 'DartSideSetClientParams'
803 ..fullIdentifier = 'dart_to_cpp.DartSide_SetClient_Params')
804 ..fields = <mojom_types.StructField>[
805 new mojom_types.StructField()
806 ..declData = (new mojom_types.DeclarationData()
807 ..shortName = 'CppSide')
808 ..type = (new mojom_types.Type()
809 ..typeReference = (new mojom_types.TypeReference()
810
811 ..identifier = 'dart_to_cpp_CppSide__'
812 ..typeKey = 'dart_to_cpp_CppSide__'
813 )),];
814 }
815
616 816
617 class _DartSidePingParams extends bindings.Struct { 817 class _DartSidePingParams extends bindings.Struct {
618 static const List<bindings.StructDataHeader> kVersions = const [ 818 static const List<bindings.StructDataHeader> kVersions = const [
619 const bindings.StructDataHeader(8, 0) 819 const bindings.StructDataHeader(8, 0)
620 ]; 820 ];
621 821
622 _DartSidePingParams() : super(kVersions.last.size); 822 _DartSidePingParams() : super(kVersions.last.size);
623 823
624 static _DartSidePingParams deserialize(bindings.Message message) { 824 static _DartSidePingParams deserialize(bindings.Message message) {
625 var decoder = new bindings.Decoder(message); 825 var decoder = new bindings.Decoder(message);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 String toString() { 864 String toString() {
665 return "_DartSidePingParams("")"; 865 return "_DartSidePingParams("")";
666 } 866 }
667 867
668 Map toJson() { 868 Map toJson() {
669 Map map = new Map(); 869 Map map = new Map();
670 return map; 870 return map;
671 } 871 }
672 } 872 }
673 873
874 mojom_types.MojomStruct _dartToCppDartSidePingParams() {
875 return new mojom_types.MojomStruct()
876 ..declData = (new mojom_types.DeclarationData()
877 ..shortName = 'DartSidePingParams'
878 ..fullIdentifier = 'dart_to_cpp.DartSide_Ping_Params')
879 ..fields = <mojom_types.StructField>[];
880 }
881
674 882
675 class _DartSideEchoParams extends bindings.Struct { 883 class _DartSideEchoParams extends bindings.Struct {
676 static const List<bindings.StructDataHeader> kVersions = const [ 884 static const List<bindings.StructDataHeader> kVersions = const [
677 const bindings.StructDataHeader(24, 0) 885 const bindings.StructDataHeader(24, 0)
678 ]; 886 ];
679 int numIterations = 0; 887 int numIterations = 0;
680 EchoArgs arg = null; 888 EchoArgs arg = null;
681 889
682 _DartSideEchoParams() : super(kVersions.last.size); 890 _DartSideEchoParams() : super(kVersions.last.size);
683 891
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 "numIterations: $numIterations" ", " 947 "numIterations: $numIterations" ", "
740 "arg: $arg" ")"; 948 "arg: $arg" ")";
741 } 949 }
742 950
743 Map toJson() { 951 Map toJson() {
744 throw new bindings.MojoCodecError( 952 throw new bindings.MojoCodecError(
745 'Object containing handles cannot be encoded to JSON.'); 953 'Object containing handles cannot be encoded to JSON.');
746 } 954 }
747 } 955 }
748 956
957 mojom_types.MojomStruct _dartToCppDartSideEchoParams() {
958 return new mojom_types.MojomStruct()
959 ..declData = (new mojom_types.DeclarationData()
960 ..shortName = 'DartSideEchoParams'
961 ..fullIdentifier = 'dart_to_cpp.DartSide_Echo_Params')
962 ..fields = <mojom_types.StructField>[
963 new mojom_types.StructField()
964 ..declData = (new mojom_types.DeclarationData()
965 ..shortName = 'NumIterations')
966 ..type = (new mojom_types.Type()
967 ..simpleType = mojom_types.SimpleType.int32),
968 new mojom_types.StructField()
969 ..declData = (new mojom_types.DeclarationData()
970 ..shortName = 'Arg')
971 ..type = (new mojom_types.Type()
972 ..typeReference = (new mojom_types.TypeReference()
973
974 ..identifier = 'dart_to_cpp_EchoArgs__'
975 ..typeKey = 'dart_to_cpp_EchoArgs__'
976 )),];
977 }
978
979
749 const int _CppSide_startTestName = 88888888; 980 const int _CppSide_startTestName = 88888888;
750 const int _CppSide_testFinishedName = 99999999; 981 const int _CppSide_testFinishedName = 99999999;
751 const int _CppSide_pingResponseName = 100000000; 982 const int _CppSide_pingResponseName = 100000000;
752 const int _CppSide_echoResponseName = 100000001; 983 const int _CppSide_echoResponseName = 100000001;
753 984
985 mojom_types.MojomInterface _dartToCppCppSide() {
986 return new mojom_types.MojomInterface()
987 ..declData = (new mojom_types.DeclarationData()
988 ..shortName = 'CppSide'
989 ..fullIdentifier = 'dart_to_cpp.CppSide')
990 ..interfaceName = 'CppSide'
991 ..methods = <int, mojom_types.MojomMethod>{
992 _CppSide_startTestName: new mojom_types.MojomMethod()
993 ..declData = (new mojom_types.DeclarationData()
994 ..shortName = 'StartTest')
995 ..ordinal = _CppSide_startTestName
996 ..parameters = _dartToCppCppSideStartTestParams(),
997 _CppSide_testFinishedName: new mojom_types.MojomMethod()
998 ..declData = (new mojom_types.DeclarationData()
999 ..shortName = 'TestFinished')
1000 ..ordinal = _CppSide_testFinishedName
1001 ..parameters = _dartToCppCppSideTestFinishedParams(),
1002 _CppSide_pingResponseName: new mojom_types.MojomMethod()
1003 ..declData = (new mojom_types.DeclarationData()
1004 ..shortName = 'PingResponse')
1005 ..ordinal = _CppSide_pingResponseName
1006 ..parameters = _dartToCppCppSidePingResponseParams(),
1007 _CppSide_echoResponseName: new mojom_types.MojomMethod()
1008 ..declData = (new mojom_types.DeclarationData()
1009 ..shortName = 'EchoResponse')
1010 ..ordinal = _CppSide_echoResponseName
1011 ..parameters = _dartToCppCppSideEchoResponseParams(),
1012 };
1013 }
1014
1015 class _CppSideServiceDescription implements service_describer.ServiceDescription {
1016 dynamic getTopLevelInterface([Function responseFactory = null]) =>
zra 2016/01/27 18:15:11 indentation
1017 _dartToCppCppSide();
1018
1019 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) = >
1020 getAllMojomTypeDefinitions()[typeKey];
1021
1022 dynamic getAllTypeDefinitions([Function responseFactory = null]) =>
1023 getAllMojomTypeDefinitions();
1024 }
1025
754 abstract class CppSide { 1026 abstract class CppSide {
755 static const String serviceName = null; 1027 static const String serviceName = null;
756 void startTest(); 1028 void startTest();
757 void testFinished(); 1029 void testFinished();
758 void pingResponse(); 1030 void pingResponse();
759 void echoResponse(EchoArgsList list); 1031 void echoResponse(EchoArgsList list);
760 } 1032 }
761 1033
762 1034
763 class _CppSideProxyImpl extends bindings.Proxy { 1035 class _CppSideProxyImpl extends bindings.Proxy {
764 _CppSideProxyImpl.fromEndpoint( 1036 _CppSideProxyImpl.fromEndpoint(
765 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1037 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
766 1038
767 _CppSideProxyImpl.fromHandle(core.MojoHandle handle) : 1039 _CppSideProxyImpl.fromHandle(core.MojoHandle handle) :
768 super.fromHandle(handle); 1040 super.fromHandle(handle);
769 1041
770 _CppSideProxyImpl.unbound() : super.unbound(); 1042 _CppSideProxyImpl.unbound() : super.unbound();
771 1043
772 static _CppSideProxyImpl newFromEndpoint( 1044 static _CppSideProxyImpl newFromEndpoint(
773 core.MojoMessagePipeEndpoint endpoint) { 1045 core.MojoMessagePipeEndpoint endpoint) {
774 assert(endpoint.setDescription("For _CppSideProxyImpl")); 1046 assert(endpoint.setDescription("For _CppSideProxyImpl"));
775 return new _CppSideProxyImpl.fromEndpoint(endpoint); 1047 return new _CppSideProxyImpl.fromEndpoint(endpoint);
776 } 1048 }
777 1049
1050 service_describer.ServiceDescription get serviceDescription =>
1051 new _CppSideServiceDescription();
1052
778 void handleResponse(bindings.ServiceMessage message) { 1053 void handleResponse(bindings.ServiceMessage message) {
779 switch (message.header.type) { 1054 switch (message.header.type) {
780 default: 1055 default:
781 proxyError("Unexpected message type: ${message.header.type}"); 1056 proxyError("Unexpected message type: ${message.header.type}");
782 close(immediate: true); 1057 close(immediate: true);
783 break; 1058 break;
784 } 1059 }
785 } 1060 }
786 1061
787 String toString() { 1062 String toString() {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 assert(_impl == null); 1225 assert(_impl == null);
951 _impl = d; 1226 _impl = d;
952 } 1227 }
953 1228
954 String toString() { 1229 String toString() {
955 var superString = super.toString(); 1230 var superString = super.toString();
956 return "CppSideStub($superString)"; 1231 return "CppSideStub($superString)";
957 } 1232 }
958 1233
959 int get version => 0; 1234 int get version => 0;
1235
1236 service_describer.ServiceDescription get serviceDescription =>
1237 new _CppSideServiceDescription();
960 } 1238 }
961 1239
962 const int _DartSide_setClientName = 0; 1240 const int _DartSide_setClientName = 0;
963 const int _DartSide_pingName = 1; 1241 const int _DartSide_pingName = 1;
964 const int _DartSide_echoName = 2; 1242 const int _DartSide_echoName = 2;
965 1243
1244 mojom_types.MojomInterface _dartToCppDartSide() {
1245 return new mojom_types.MojomInterface()
1246 ..declData = (new mojom_types.DeclarationData()
1247 ..shortName = 'DartSide'
1248 ..fullIdentifier = 'dart_to_cpp.DartSide')
1249 ..interfaceName = 'DartSide'
1250 ..methods = <int, mojom_types.MojomMethod>{
1251 _DartSide_setClientName: new mojom_types.MojomMethod()
1252 ..declData = (new mojom_types.DeclarationData()
1253 ..shortName = 'SetClient')
1254 ..ordinal = _DartSide_setClientName
1255 ..parameters = _dartToCppDartSideSetClientParams(),
1256 _DartSide_pingName: new mojom_types.MojomMethod()
1257 ..declData = (new mojom_types.DeclarationData()
1258 ..shortName = 'Ping')
1259 ..ordinal = _DartSide_pingName
1260 ..parameters = _dartToCppDartSidePingParams(),
1261 _DartSide_echoName: new mojom_types.MojomMethod()
1262 ..declData = (new mojom_types.DeclarationData()
1263 ..shortName = 'Echo')
1264 ..ordinal = _DartSide_echoName
1265 ..parameters = _dartToCppDartSideEchoParams(),
1266 };
1267 }
1268
1269 class _DartSideServiceDescription implements service_describer.ServiceDescriptio n {
1270 dynamic getTopLevelInterface([Function responseFactory = null]) =>
1271 _dartToCppDartSide();
1272
1273 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) = >
1274 getAllMojomTypeDefinitions()[typeKey];
1275
1276 dynamic getAllTypeDefinitions([Function responseFactory = null]) =>
1277 getAllMojomTypeDefinitions();
1278 }
1279
966 abstract class DartSide { 1280 abstract class DartSide {
967 static const String serviceName = null; 1281 static const String serviceName = null;
968 void setClient(Object cppSide); 1282 void setClient(Object cppSide);
969 void ping(); 1283 void ping();
970 void echo(int numIterations, EchoArgs arg); 1284 void echo(int numIterations, EchoArgs arg);
971 } 1285 }
972 1286
973 1287
974 class _DartSideProxyImpl extends bindings.Proxy { 1288 class _DartSideProxyImpl extends bindings.Proxy {
975 _DartSideProxyImpl.fromEndpoint( 1289 _DartSideProxyImpl.fromEndpoint(
976 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1290 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
977 1291
978 _DartSideProxyImpl.fromHandle(core.MojoHandle handle) : 1292 _DartSideProxyImpl.fromHandle(core.MojoHandle handle) :
979 super.fromHandle(handle); 1293 super.fromHandle(handle);
980 1294
981 _DartSideProxyImpl.unbound() : super.unbound(); 1295 _DartSideProxyImpl.unbound() : super.unbound();
982 1296
983 static _DartSideProxyImpl newFromEndpoint( 1297 static _DartSideProxyImpl newFromEndpoint(
984 core.MojoMessagePipeEndpoint endpoint) { 1298 core.MojoMessagePipeEndpoint endpoint) {
985 assert(endpoint.setDescription("For _DartSideProxyImpl")); 1299 assert(endpoint.setDescription("For _DartSideProxyImpl"));
986 return new _DartSideProxyImpl.fromEndpoint(endpoint); 1300 return new _DartSideProxyImpl.fromEndpoint(endpoint);
987 } 1301 }
988 1302
1303 service_describer.ServiceDescription get serviceDescription =>
1304 new _DartSideServiceDescription();
1305
989 void handleResponse(bindings.ServiceMessage message) { 1306 void handleResponse(bindings.ServiceMessage message) {
990 switch (message.header.type) { 1307 switch (message.header.type) {
991 default: 1308 default:
992 proxyError("Unexpected message type: ${message.header.type}"); 1309 proxyError("Unexpected message type: ${message.header.type}");
993 close(immediate: true); 1310 close(immediate: true);
994 break; 1311 break;
995 } 1312 }
996 } 1313 }
997 1314
998 String toString() { 1315 String toString() {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 assert(_impl == null); 1467 assert(_impl == null);
1151 _impl = d; 1468 _impl = d;
1152 } 1469 }
1153 1470
1154 String toString() { 1471 String toString() {
1155 var superString = super.toString(); 1472 var superString = super.toString();
1156 return "DartSideStub($superString)"; 1473 return "DartSideStub($superString)";
1157 } 1474 }
1158 1475
1159 int get version => 0; 1476 int get version => 0;
1477
1478 service_describer.ServiceDescription get serviceDescription =>
1479 new _DartSideServiceDescription();
1160 } 1480 }
1161 1481
1162 1482
1483
zra 2016/01/27 18:15:11 Extra newlines.
1484
1485
1486
1487
1488 Map<String, mojom_types.UserDefinedType> _initDescriptions() {
1489 var map = new HashMap<String, mojom_types.UserDefinedType>();
1490 map["dart_to_cpp_EchoArgs__"] =
1491 new mojom_types.UserDefinedType()
1492 ..structType = _dartToCppEchoArgs();
1493 map["dart_to_cpp_EchoArgsList__"] =
1494 new mojom_types.UserDefinedType()
1495 ..structType = _dartToCppEchoArgsList();
1496 map["dart_to_cpp_CppSide_StartTest_Params__"] =
1497 new mojom_types.UserDefinedType()
1498 ..structType = _dartToCppCppSideStartTestParams();
1499 map["dart_to_cpp_CppSide_TestFinished_Params__"] =
1500 new mojom_types.UserDefinedType()
1501 ..structType = _dartToCppCppSideTestFinishedParams();
1502 map["dart_to_cpp_CppSide_PingResponse_Params__"] =
1503 new mojom_types.UserDefinedType()
1504 ..structType = _dartToCppCppSidePingResponseParams();
1505 map["dart_to_cpp_CppSide_EchoResponse_Params__"] =
1506 new mojom_types.UserDefinedType()
1507 ..structType = _dartToCppCppSideEchoResponseParams();
1508 map["dart_to_cpp_DartSide_SetClient_Params__"] =
1509 new mojom_types.UserDefinedType()
1510 ..structType = _dartToCppDartSideSetClientParams();
1511 map["dart_to_cpp_DartSide_Ping_Params__"] =
1512 new mojom_types.UserDefinedType()
1513 ..structType = _dartToCppDartSidePingParams();
1514 map["dart_to_cpp_DartSide_Echo_Params__"] =
1515 new mojom_types.UserDefinedType()
1516 ..structType = _dartToCppDartSideEchoParams();
1517 map["dart_to_cpp_CppSide__"] =
1518 new mojom_types.UserDefinedType()
1519 ..interfaceType = _dartToCppCppSide();
1520 map["dart_to_cpp_DartSide__"] =
1521 new mojom_types.UserDefinedType()
1522 ..interfaceType = _dartToCppDartSide();
1523
1524 return map;
1525 }
1526
1527 var _mojomDesc;
1528 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
1529 if (_mojomDesc == null) {
1530 _mojomDesc = _initDescriptions();
1531 }
1532 return _mojomDesc;
1533 }
1534
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698