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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/contacts/contacts.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 contacts_mojom; 5 library contacts_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 Contact extends bindings.Struct { 16 class Contact 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 int id = 0; 20 int id = 0;
19 String name = null; 21 String name = null;
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["id"] = id; 85 map["id"] = id;
84 map["name"] = name; 86 map["name"] = name;
85 return map; 87 return map;
86 } 88 }
87 } 89 }
88 90
89 91
92
93
90 class _ContactsServiceGetCountParams extends bindings.Struct { 94 class _ContactsServiceGetCountParams extends bindings.Struct {
91 static const List<bindings.StructDataHeader> kVersions = const [ 95 static const List<bindings.StructDataHeader> kVersions = const [
92 const bindings.StructDataHeader(16, 0) 96 const bindings.StructDataHeader(16, 0)
93 ]; 97 ];
94 String filter = null; 98 String filter = null;
95 99
96 _ContactsServiceGetCountParams() : super(kVersions.last.size); 100 _ContactsServiceGetCountParams() : super(kVersions.last.size);
97 101
98 static _ContactsServiceGetCountParams deserialize(bindings.Message message) { 102 static _ContactsServiceGetCountParams deserialize(bindings.Message message) {
99 var decoder = new bindings.Decoder(message); 103 var decoder = new bindings.Decoder(message);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 151 }
148 152
149 Map toJson() { 153 Map toJson() {
150 Map map = new Map(); 154 Map map = new Map();
151 map["filter"] = filter; 155 map["filter"] = filter;
152 return map; 156 return map;
153 } 157 }
154 } 158 }
155 159
156 160
161
162
157 class ContactsServiceGetCountResponseParams extends bindings.Struct { 163 class ContactsServiceGetCountResponseParams extends bindings.Struct {
158 static const List<bindings.StructDataHeader> kVersions = const [ 164 static const List<bindings.StructDataHeader> kVersions = const [
159 const bindings.StructDataHeader(16, 0) 165 const bindings.StructDataHeader(16, 0)
160 ]; 166 ];
161 int count = 0; 167 int count = 0;
162 168
163 ContactsServiceGetCountResponseParams() : super(kVersions.last.size); 169 ContactsServiceGetCountResponseParams() : super(kVersions.last.size);
164 170
165 static ContactsServiceGetCountResponseParams deserialize(bindings.Message mess age) { 171 static ContactsServiceGetCountResponseParams deserialize(bindings.Message mess age) {
166 var decoder = new bindings.Decoder(message); 172 var decoder = new bindings.Decoder(message);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 220 }
215 221
216 Map toJson() { 222 Map toJson() {
217 Map map = new Map(); 223 Map map = new Map();
218 map["count"] = count; 224 map["count"] = count;
219 return map; 225 return map;
220 } 226 }
221 } 227 }
222 228
223 229
230
231
224 class _ContactsServiceGetParams extends bindings.Struct { 232 class _ContactsServiceGetParams extends bindings.Struct {
225 static const List<bindings.StructDataHeader> kVersions = const [ 233 static const List<bindings.StructDataHeader> kVersions = const [
226 const bindings.StructDataHeader(24, 0) 234 const bindings.StructDataHeader(24, 0)
227 ]; 235 ];
228 String filter = null; 236 String filter = null;
229 int offset = 0; 237 int offset = 0;
230 int limit = 0; 238 int limit = 0;
231 239
232 _ContactsServiceGetParams() : super(kVersions.last.size); 240 _ContactsServiceGetParams() : super(kVersions.last.size);
233 241
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 Map toJson() { 307 Map toJson() {
300 Map map = new Map(); 308 Map map = new Map();
301 map["filter"] = filter; 309 map["filter"] = filter;
302 map["offset"] = offset; 310 map["offset"] = offset;
303 map["limit"] = limit; 311 map["limit"] = limit;
304 return map; 312 return map;
305 } 313 }
306 } 314 }
307 315
308 316
317
318
309 class ContactsServiceGetResponseParams extends bindings.Struct { 319 class ContactsServiceGetResponseParams extends bindings.Struct {
310 static const List<bindings.StructDataHeader> kVersions = const [ 320 static const List<bindings.StructDataHeader> kVersions = const [
311 const bindings.StructDataHeader(16, 0) 321 const bindings.StructDataHeader(16, 0)
312 ]; 322 ];
313 List<Contact> contacts = null; 323 List<Contact> contacts = null;
314 324
315 ContactsServiceGetResponseParams() : super(kVersions.last.size); 325 ContactsServiceGetResponseParams() : super(kVersions.last.size);
316 326
317 static ContactsServiceGetResponseParams deserialize(bindings.Message message) { 327 static ContactsServiceGetResponseParams deserialize(bindings.Message message) {
318 var decoder = new bindings.Decoder(message); 328 var decoder = new bindings.Decoder(message);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 393 }
384 394
385 Map toJson() { 395 Map toJson() {
386 Map map = new Map(); 396 Map map = new Map();
387 map["contacts"] = contacts; 397 map["contacts"] = contacts;
388 return map; 398 return map;
389 } 399 }
390 } 400 }
391 401
392 402
403
404
393 class _ContactsServiceGetEmailsParams extends bindings.Struct { 405 class _ContactsServiceGetEmailsParams extends bindings.Struct {
394 static const List<bindings.StructDataHeader> kVersions = const [ 406 static const List<bindings.StructDataHeader> kVersions = const [
395 const bindings.StructDataHeader(16, 0) 407 const bindings.StructDataHeader(16, 0)
396 ]; 408 ];
397 int id = 0; 409 int id = 0;
398 410
399 _ContactsServiceGetEmailsParams() : super(kVersions.last.size); 411 _ContactsServiceGetEmailsParams() : super(kVersions.last.size);
400 412
401 static _ContactsServiceGetEmailsParams deserialize(bindings.Message message) { 413 static _ContactsServiceGetEmailsParams deserialize(bindings.Message message) {
402 var decoder = new bindings.Decoder(message); 414 var decoder = new bindings.Decoder(message);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 462 }
451 463
452 Map toJson() { 464 Map toJson() {
453 Map map = new Map(); 465 Map map = new Map();
454 map["id"] = id; 466 map["id"] = id;
455 return map; 467 return map;
456 } 468 }
457 } 469 }
458 470
459 471
472
473
460 class ContactsServiceGetEmailsResponseParams extends bindings.Struct { 474 class ContactsServiceGetEmailsResponseParams extends bindings.Struct {
461 static const List<bindings.StructDataHeader> kVersions = const [ 475 static const List<bindings.StructDataHeader> kVersions = const [
462 const bindings.StructDataHeader(16, 0) 476 const bindings.StructDataHeader(16, 0)
463 ]; 477 ];
464 List<String> emails = null; 478 List<String> emails = null;
465 479
466 ContactsServiceGetEmailsResponseParams() : super(kVersions.last.size); 480 ContactsServiceGetEmailsResponseParams() : super(kVersions.last.size);
467 481
468 static ContactsServiceGetEmailsResponseParams deserialize(bindings.Message mes sage) { 482 static ContactsServiceGetEmailsResponseParams deserialize(bindings.Message mes sage) {
469 var decoder = new bindings.Decoder(message); 483 var decoder = new bindings.Decoder(message);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 } 547 }
534 548
535 Map toJson() { 549 Map toJson() {
536 Map map = new Map(); 550 Map map = new Map();
537 map["emails"] = emails; 551 map["emails"] = emails;
538 return map; 552 return map;
539 } 553 }
540 } 554 }
541 555
542 556
557
558
543 class _ContactsServiceGetPhotoParams extends bindings.Struct { 559 class _ContactsServiceGetPhotoParams extends bindings.Struct {
544 static const List<bindings.StructDataHeader> kVersions = const [ 560 static const List<bindings.StructDataHeader> kVersions = const [
545 const bindings.StructDataHeader(24, 0) 561 const bindings.StructDataHeader(24, 0)
546 ]; 562 ];
547 int id = 0; 563 int id = 0;
548 bool highResolution = false; 564 bool highResolution = false;
549 565
550 _ContactsServiceGetPhotoParams() : super(kVersions.last.size); 566 _ContactsServiceGetPhotoParams() : super(kVersions.last.size);
551 567
552 static _ContactsServiceGetPhotoParams deserialize(bindings.Message message) { 568 static _ContactsServiceGetPhotoParams deserialize(bindings.Message message) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 625
610 Map toJson() { 626 Map toJson() {
611 Map map = new Map(); 627 Map map = new Map();
612 map["id"] = id; 628 map["id"] = id;
613 map["highResolution"] = highResolution; 629 map["highResolution"] = highResolution;
614 return map; 630 return map;
615 } 631 }
616 } 632 }
617 633
618 634
635
636
619 class ContactsServiceGetPhotoResponseParams extends bindings.Struct { 637 class ContactsServiceGetPhotoResponseParams extends bindings.Struct {
620 static const List<bindings.StructDataHeader> kVersions = const [ 638 static const List<bindings.StructDataHeader> kVersions = const [
621 const bindings.StructDataHeader(16, 0) 639 const bindings.StructDataHeader(16, 0)
622 ]; 640 ];
623 String photoUrl = null; 641 String photoUrl = null;
624 642
625 ContactsServiceGetPhotoResponseParams() : super(kVersions.last.size); 643 ContactsServiceGetPhotoResponseParams() : super(kVersions.last.size);
626 644
627 static ContactsServiceGetPhotoResponseParams deserialize(bindings.Message mess age) { 645 static ContactsServiceGetPhotoResponseParams deserialize(bindings.Message mess age) {
628 var decoder = new bindings.Decoder(message); 646 var decoder = new bindings.Decoder(message);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 "photoUrl: $photoUrl" ")"; 693 "photoUrl: $photoUrl" ")";
676 } 694 }
677 695
678 Map toJson() { 696 Map toJson() {
679 Map map = new Map(); 697 Map map = new Map();
680 map["photoUrl"] = photoUrl; 698 map["photoUrl"] = photoUrl;
681 return map; 699 return map;
682 } 700 }
683 } 701 }
684 702
703
704
705
685 const int _ContactsService_getCountName = 0; 706 const int _ContactsService_getCountName = 0;
686 const int _ContactsService_getName = 1; 707 const int _ContactsService_getName = 1;
687 const int _ContactsService_getEmailsName = 2; 708 const int _ContactsService_getEmailsName = 2;
688 const int _ContactsService_getPhotoName = 3; 709 const int _ContactsService_getPhotoName = 3;
689 710
711
712
713 class _ContactsServiceServiceDescription implements service_describer.ServiceDes cription {
714 dynamic getTopLevelInterface([Function responseFactory]) => null;
715
716 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
717
718 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
719 }
720
690 abstract class ContactsService { 721 abstract class ContactsService {
691 static const String serviceName = "contacts::ContactsService"; 722 static const String serviceName = "contacts::ContactsService";
692 dynamic getCount(String filter,[Function responseFactory = null]); 723 dynamic getCount(String filter,[Function responseFactory = null]);
693 dynamic get(String filter,int offset,int limit,[Function responseFactory = nul l]); 724 dynamic get(String filter,int offset,int limit,[Function responseFactory = nul l]);
694 dynamic getEmails(int id,[Function responseFactory = null]); 725 dynamic getEmails(int id,[Function responseFactory = null]);
695 dynamic getPhoto(int id,bool highResolution,[Function responseFactory = null]) ; 726 dynamic getPhoto(int id,bool highResolution,[Function responseFactory = null]) ;
696 } 727 }
697 728
698 729
699 class _ContactsServiceProxyImpl extends bindings.Proxy { 730 class _ContactsServiceProxyImpl extends bindings.Proxy {
700 _ContactsServiceProxyImpl.fromEndpoint( 731 _ContactsServiceProxyImpl.fromEndpoint(
701 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 732 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
702 733
703 _ContactsServiceProxyImpl.fromHandle(core.MojoHandle handle) : 734 _ContactsServiceProxyImpl.fromHandle(core.MojoHandle handle) :
704 super.fromHandle(handle); 735 super.fromHandle(handle);
705 736
706 _ContactsServiceProxyImpl.unbound() : super.unbound(); 737 _ContactsServiceProxyImpl.unbound() : super.unbound();
707 738
708 static _ContactsServiceProxyImpl newFromEndpoint( 739 static _ContactsServiceProxyImpl newFromEndpoint(
709 core.MojoMessagePipeEndpoint endpoint) { 740 core.MojoMessagePipeEndpoint endpoint) {
710 assert(endpoint.setDescription("For _ContactsServiceProxyImpl")); 741 assert(endpoint.setDescription("For _ContactsServiceProxyImpl"));
711 return new _ContactsServiceProxyImpl.fromEndpoint(endpoint); 742 return new _ContactsServiceProxyImpl.fromEndpoint(endpoint);
712 } 743 }
713 744
745 service_describer.ServiceDescription get serviceDescription =>
746 new _ContactsServiceServiceDescription();
747
714 void handleResponse(bindings.ServiceMessage message) { 748 void handleResponse(bindings.ServiceMessage message) {
715 switch (message.header.type) { 749 switch (message.header.type) {
716 case _ContactsService_getCountName: 750 case _ContactsService_getCountName:
717 var r = ContactsServiceGetCountResponseParams.deserialize( 751 var r = ContactsServiceGetCountResponseParams.deserialize(
718 message.payload); 752 message.payload);
719 if (!message.header.hasRequestId) { 753 if (!message.header.hasRequestId) {
720 proxyError("Expected a message with a valid request Id."); 754 proxyError("Expected a message with a valid request Id.");
721 return; 755 return;
722 } 756 }
723 Completer c = completerMap[message.header.requestId]; 757 Completer c = completerMap[message.header.requestId];
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 assert(_impl == null); 1094 assert(_impl == null);
1061 _impl = d; 1095 _impl = d;
1062 } 1096 }
1063 1097
1064 String toString() { 1098 String toString() {
1065 var superString = super.toString(); 1099 var superString = super.toString();
1066 return "ContactsServiceStub($superString)"; 1100 return "ContactsServiceStub($superString)";
1067 } 1101 }
1068 1102
1069 int get version => 0; 1103 int get version => 0;
1104
1105 service_describer.ServiceDescription get serviceDescription =>
1106 new _ContactsServiceServiceDescription();
1070 } 1107 }
1071 1108
1072 1109
1110
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698