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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/authentication/authentication.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 authentication_mojom; 5 library authentication_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 _AuthenticationServiceSelectAccountParams extends bindings.Struct { 16 class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 17 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(16, 0) 18 const bindings.StructDataHeader(16, 0)
17 ]; 19 ];
18 bool returnLastSelected = false; 20 bool returnLastSelected = false;
19 21
20 _AuthenticationServiceSelectAccountParams() : super(kVersions.last.size); 22 _AuthenticationServiceSelectAccountParams() : super(kVersions.last.size);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 73 }
72 74
73 Map toJson() { 75 Map toJson() {
74 Map map = new Map(); 76 Map map = new Map();
75 map["returnLastSelected"] = returnLastSelected; 77 map["returnLastSelected"] = returnLastSelected;
76 return map; 78 return map;
77 } 79 }
78 } 80 }
79 81
80 82
83
84
81 class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct { 85 class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
82 static const List<bindings.StructDataHeader> kVersions = const [ 86 static const List<bindings.StructDataHeader> kVersions = const [
83 const bindings.StructDataHeader(24, 0) 87 const bindings.StructDataHeader(24, 0)
84 ]; 88 ];
85 String username = null; 89 String username = null;
86 String error = null; 90 String error = null;
87 91
88 AuthenticationServiceSelectAccountResponseParams() : super(kVersions.last.size ); 92 AuthenticationServiceSelectAccountResponseParams() : super(kVersions.last.size );
89 93
90 static AuthenticationServiceSelectAccountResponseParams deserialize(bindings.M essage message) { 94 static AuthenticationServiceSelectAccountResponseParams deserialize(bindings.M essage message) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 151
148 Map toJson() { 152 Map toJson() {
149 Map map = new Map(); 153 Map map = new Map();
150 map["username"] = username; 154 map["username"] = username;
151 map["error"] = error; 155 map["error"] = error;
152 return map; 156 return map;
153 } 157 }
154 } 158 }
155 159
156 160
161
162
157 class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct { 163 class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
158 static const List<bindings.StructDataHeader> kVersions = const [ 164 static const List<bindings.StructDataHeader> kVersions = const [
159 const bindings.StructDataHeader(24, 0) 165 const bindings.StructDataHeader(24, 0)
160 ]; 166 ];
161 String username = null; 167 String username = null;
162 List<String> scopes = null; 168 List<String> scopes = null;
163 169
164 _AuthenticationServiceGetOAuth2TokenParams() : super(kVersions.last.size); 170 _AuthenticationServiceGetOAuth2TokenParams() : super(kVersions.last.size);
165 171
166 static _AuthenticationServiceGetOAuth2TokenParams deserialize(bindings.Message message) { 172 static _AuthenticationServiceGetOAuth2TokenParams deserialize(bindings.Message message) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 245
240 Map toJson() { 246 Map toJson() {
241 Map map = new Map(); 247 Map map = new Map();
242 map["username"] = username; 248 map["username"] = username;
243 map["scopes"] = scopes; 249 map["scopes"] = scopes;
244 return map; 250 return map;
245 } 251 }
246 } 252 }
247 253
248 254
255
256
249 class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct { 257 class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct {
250 static const List<bindings.StructDataHeader> kVersions = const [ 258 static const List<bindings.StructDataHeader> kVersions = const [
251 const bindings.StructDataHeader(24, 0) 259 const bindings.StructDataHeader(24, 0)
252 ]; 260 ];
253 String token = null; 261 String token = null;
254 String error = null; 262 String error = null;
255 263
256 AuthenticationServiceGetOAuth2TokenResponseParams() : super(kVersions.last.siz e); 264 AuthenticationServiceGetOAuth2TokenResponseParams() : super(kVersions.last.siz e);
257 265
258 static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(bindings. Message message) { 266 static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(bindings. Message message) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 323
316 Map toJson() { 324 Map toJson() {
317 Map map = new Map(); 325 Map map = new Map();
318 map["token"] = token; 326 map["token"] = token;
319 map["error"] = error; 327 map["error"] = error;
320 return map; 328 return map;
321 } 329 }
322 } 330 }
323 331
324 332
333
334
325 class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct { 335 class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
326 static const List<bindings.StructDataHeader> kVersions = const [ 336 static const List<bindings.StructDataHeader> kVersions = const [
327 const bindings.StructDataHeader(16, 0) 337 const bindings.StructDataHeader(16, 0)
328 ]; 338 ];
329 String token = null; 339 String token = null;
330 340
331 _AuthenticationServiceClearOAuth2TokenParams() : super(kVersions.last.size); 341 _AuthenticationServiceClearOAuth2TokenParams() : super(kVersions.last.size);
332 342
333 static _AuthenticationServiceClearOAuth2TokenParams deserialize(bindings.Messa ge message) { 343 static _AuthenticationServiceClearOAuth2TokenParams deserialize(bindings.Messa ge message) {
334 var decoder = new bindings.Decoder(message); 344 var decoder = new bindings.Decoder(message);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 "token: $token" ")"; 391 "token: $token" ")";
382 } 392 }
383 393
384 Map toJson() { 394 Map toJson() {
385 Map map = new Map(); 395 Map map = new Map();
386 map["token"] = token; 396 map["token"] = token;
387 return map; 397 return map;
388 } 398 }
389 } 399 }
390 400
401
402
403
391 const int _AuthenticationService_selectAccountName = 0; 404 const int _AuthenticationService_selectAccountName = 0;
392 const int _AuthenticationService_getOAuth2TokenName = 1; 405 const int _AuthenticationService_getOAuth2TokenName = 1;
393 const int _AuthenticationService_clearOAuth2TokenName = 2; 406 const int _AuthenticationService_clearOAuth2TokenName = 2;
394 407
408
409
410 class _AuthenticationServiceServiceDescription implements service_describer.Serv iceDescription {
411 dynamic getTopLevelInterface([Function responseFactory]) => null;
412
413 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
414
415 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
416 }
417
395 abstract class AuthenticationService { 418 abstract class AuthenticationService {
396 static const String serviceName = "authentication::AuthenticationService"; 419 static const String serviceName = "authentication::AuthenticationService";
397 dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null ]); 420 dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null ]);
398 dynamic getOAuth2Token(String username,List<String> scopes,[Function responseF actory = null]); 421 dynamic getOAuth2Token(String username,List<String> scopes,[Function responseF actory = null]);
399 void clearOAuth2Token(String token); 422 void clearOAuth2Token(String token);
400 } 423 }
401 424
402 425
403 class _AuthenticationServiceProxyImpl extends bindings.Proxy { 426 class _AuthenticationServiceProxyImpl extends bindings.Proxy {
404 _AuthenticationServiceProxyImpl.fromEndpoint( 427 _AuthenticationServiceProxyImpl.fromEndpoint(
405 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 428 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
406 429
407 _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle) : 430 _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle) :
408 super.fromHandle(handle); 431 super.fromHandle(handle);
409 432
410 _AuthenticationServiceProxyImpl.unbound() : super.unbound(); 433 _AuthenticationServiceProxyImpl.unbound() : super.unbound();
411 434
412 static _AuthenticationServiceProxyImpl newFromEndpoint( 435 static _AuthenticationServiceProxyImpl newFromEndpoint(
413 core.MojoMessagePipeEndpoint endpoint) { 436 core.MojoMessagePipeEndpoint endpoint) {
414 assert(endpoint.setDescription("For _AuthenticationServiceProxyImpl")); 437 assert(endpoint.setDescription("For _AuthenticationServiceProxyImpl"));
415 return new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint); 438 return new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint);
416 } 439 }
417 440
441 service_describer.ServiceDescription get serviceDescription =>
442 new _AuthenticationServiceServiceDescription();
443
418 void handleResponse(bindings.ServiceMessage message) { 444 void handleResponse(bindings.ServiceMessage message) {
419 switch (message.header.type) { 445 switch (message.header.type) {
420 case _AuthenticationService_selectAccountName: 446 case _AuthenticationService_selectAccountName:
421 var r = AuthenticationServiceSelectAccountResponseParams.deserialize( 447 var r = AuthenticationServiceSelectAccountResponseParams.deserialize(
422 message.payload); 448 message.payload);
423 if (!message.header.hasRequestId) { 449 if (!message.header.hasRequestId) {
424 proxyError("Expected a message with a valid request Id."); 450 proxyError("Expected a message with a valid request Id.");
425 return; 451 return;
426 } 452 }
427 Completer c = completerMap[message.header.requestId]; 453 Completer c = completerMap[message.header.requestId];
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 assert(_impl == null); 692 assert(_impl == null);
667 _impl = d; 693 _impl = d;
668 } 694 }
669 695
670 String toString() { 696 String toString() {
671 var superString = super.toString(); 697 var superString = super.toString();
672 return "AuthenticationServiceStub($superString)"; 698 return "AuthenticationServiceStub($superString)";
673 } 699 }
674 700
675 int get version => 0; 701 int get version => 0;
702
703 service_describer.ServiceDescription get serviceDescription =>
704 new _AuthenticationServiceServiceDescription();
676 } 705 }
677 706
678 707
708
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698