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

Side by Side Diff: mojo/dart/packages/mojo/lib/mojo/application.mojom.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 6 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 // WARNING: DO NOT EDIT. This file was generated by a program. 1 // WARNING: DO NOT EDIT. This file was generated by a program.
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
3 3
4 library application_mojom; 4 library application_mojom;
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:mojo/bindings.dart' as bindings; 6 import 'package:mojo/bindings.dart' as bindings;
7 import 'package:mojo/core.dart' as core; 7 import 'package:mojo/core.dart' as core;
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
9 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom ; 9 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom ;
10 import 'package:mojo/mojo/shell.mojom.dart' as shell_mojom; 10 import 'package:mojo/mojo/shell.mojom.dart' as shell_mojom;
11 11
12 12
13 13
14 class _ApplicationInitializeParams extends bindings.Struct { 14 class _ApplicationInitializeParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 15 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(32, 0) 16 const bindings.StructDataHeader(32, 0)
17 ]; 17 ];
18 shell_mojom.ShellInterface shell = null; 18 shell_mojom.ShellInterface shell = null;
19 List<String> args = null; 19 List<String> args = null;
20 String url = null; 20 String url = null;
21 21
22 _ApplicationInitializeParams() : super(kVersions.last.size); 22 _ApplicationInitializeParams() : super(kVersions.last.size);
23 23
24 _ApplicationInitializeParams.init(
25 shell_mojom.ShellInterface this.shell,
26 List<String> this.args,
27 String this.url
28 ) : super(kVersions.last.size);
29
24 static _ApplicationInitializeParams deserialize(bindings.Message message) { 30 static _ApplicationInitializeParams deserialize(bindings.Message message) {
25 var decoder = new bindings.Decoder(message); 31 var decoder = new bindings.Decoder(message);
26 var result = decode(decoder); 32 var result = decode(decoder);
27 if (decoder.excessHandles != null) { 33 if (decoder.excessHandles != null) {
28 decoder.excessHandles.forEach((h) => h.close()); 34 decoder.excessHandles.forEach((h) => h.close());
29 } 35 }
30 return result; 36 return result;
31 } 37 }
32 38
33 static _ApplicationInitializeParams decode(bindings.Decoder decoder0) { 39 static _ApplicationInitializeParams decode(bindings.Decoder decoder0) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 class _ApplicationAcceptConnectionParams extends bindings.Struct { 134 class _ApplicationAcceptConnectionParams extends bindings.Struct {
129 static const List<bindings.StructDataHeader> kVersions = const [ 135 static const List<bindings.StructDataHeader> kVersions = const [
130 const bindings.StructDataHeader(32, 0) 136 const bindings.StructDataHeader(32, 0)
131 ]; 137 ];
132 String requestorUrl = null; 138 String requestorUrl = null;
133 String resolvedUrl = null; 139 String resolvedUrl = null;
134 service_provider_mojom.ServiceProviderInterfaceRequest services = null; 140 service_provider_mojom.ServiceProviderInterfaceRequest services = null;
135 141
136 _ApplicationAcceptConnectionParams() : super(kVersions.last.size); 142 _ApplicationAcceptConnectionParams() : super(kVersions.last.size);
137 143
144 _ApplicationAcceptConnectionParams.init(
145 String this.requestorUrl,
146 String this.resolvedUrl,
147 service_provider_mojom.ServiceProviderInterfaceRequest this.services
148 ) : super(kVersions.last.size);
149
138 static _ApplicationAcceptConnectionParams deserialize(bindings.Message message ) { 150 static _ApplicationAcceptConnectionParams deserialize(bindings.Message message ) {
139 var decoder = new bindings.Decoder(message); 151 var decoder = new bindings.Decoder(message);
140 var result = decode(decoder); 152 var result = decode(decoder);
141 if (decoder.excessHandles != null) { 153 if (decoder.excessHandles != null) {
142 decoder.excessHandles.forEach((h) => h.close()); 154 decoder.excessHandles.forEach((h) => h.close());
143 } 155 }
144 return result; 156 return result;
145 } 157 }
146 158
147 static _ApplicationAcceptConnectionParams decode(bindings.Decoder decoder0) { 159 static _ApplicationAcceptConnectionParams decode(bindings.Decoder decoder0) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 234 }
223 235
224 236
225 class _ApplicationRequestQuitParams extends bindings.Struct { 237 class _ApplicationRequestQuitParams extends bindings.Struct {
226 static const List<bindings.StructDataHeader> kVersions = const [ 238 static const List<bindings.StructDataHeader> kVersions = const [
227 const bindings.StructDataHeader(8, 0) 239 const bindings.StructDataHeader(8, 0)
228 ]; 240 ];
229 241
230 _ApplicationRequestQuitParams() : super(kVersions.last.size); 242 _ApplicationRequestQuitParams() : super(kVersions.last.size);
231 243
244 _ApplicationRequestQuitParams.init(
245 ) : super(kVersions.last.size);
246
232 static _ApplicationRequestQuitParams deserialize(bindings.Message message) { 247 static _ApplicationRequestQuitParams deserialize(bindings.Message message) {
233 var decoder = new bindings.Decoder(message); 248 var decoder = new bindings.Decoder(message);
234 var result = decode(decoder); 249 var result = decode(decoder);
235 if (decoder.excessHandles != null) { 250 if (decoder.excessHandles != null) {
236 decoder.excessHandles.forEach((h) => h.close()); 251 decoder.excessHandles.forEach((h) => h.close());
237 } 252 }
238 return result; 253 return result;
239 } 254 }
240 255
241 static _ApplicationRequestQuitParams decode(bindings.Decoder decoder0) { 256 static _ApplicationRequestQuitParams decode(bindings.Decoder decoder0) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 Map map = new Map(); 292 Map map = new Map();
278 return map; 293 return map;
279 } 294 }
280 } 295 }
281 296
282 const int _applicationMethodInitializeName = 0; 297 const int _applicationMethodInitializeName = 0;
283 const int _applicationMethodAcceptConnectionName = 1; 298 const int _applicationMethodAcceptConnectionName = 1;
284 const int _applicationMethodRequestQuitName = 2; 299 const int _applicationMethodRequestQuitName = 2;
285 300
286 class _ApplicationServiceDescription implements service_describer.ServiceDescrip tion { 301 class _ApplicationServiceDescription implements service_describer.ServiceDescrip tion {
287 dynamic getTopLevelInterface([Function responseFactory]) => 302 void getTopLevelInterface(Function responder) {
288 responseFactory(null); 303 responder(null);
304 }
289 305
290 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 306 void getTypeDefinition(String typeKey, Function responder) {
291 responseFactory(null); 307 responder(null);
308 }
292 309
293 dynamic getAllTypeDefinitions([Function responseFactory]) => 310 void getAllTypeDefinitions(Function responder) {
294 responseFactory(null); 311 responder(null);
312 }
295 } 313 }
296 314
297 abstract class Application { 315 abstract class Application {
298 static const String serviceName = null; 316 static const String serviceName = null;
299 317
300 static service_describer.ServiceDescription _cachedServiceDescription; 318 static service_describer.ServiceDescription _cachedServiceDescription;
301 static service_describer.ServiceDescription get serviceDescription { 319 static service_describer.ServiceDescription get serviceDescription {
302 if (_cachedServiceDescription == null) { 320 if (_cachedServiceDescription == null) {
303 _cachedServiceDescription = new _ApplicationServiceDescription(); 321 _cachedServiceDescription = new _ApplicationServiceDescription();
304 } 322 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 : super.fromHandle(handle, autoBegin: impl != null) { 485 : super.fromHandle(handle, autoBegin: impl != null) {
468 _impl = impl; 486 _impl = impl;
469 } 487 }
470 488
471 _ApplicationStubControl.unbound([this._impl]) : super.unbound(); 489 _ApplicationStubControl.unbound([this._impl]) : super.unbound();
472 490
473 String get serviceName => Application.serviceName; 491 String get serviceName => Application.serviceName;
474 492
475 493
476 494
477 dynamic handleMessage(bindings.ServiceMessage message) { 495 void handleMessage(bindings.ServiceMessage message) {
478 if (bindings.ControlMessageHandler.isControlMessage(message)) { 496 if (bindings.ControlMessageHandler.isControlMessage(message)) {
479 return bindings.ControlMessageHandler.handleMessage(this, 497 bindings.ControlMessageHandler.handleMessage(
480 0, 498 this, 0, message);
481 message); 499 return;
482 } 500 }
483 if (_impl == null) { 501 if (_impl == null) {
484 throw new core.MojoApiError("$this has no implementation set"); 502 throw new core.MojoApiError("$this has no implementation set");
485 } 503 }
486 switch (message.header.type) { 504 switch (message.header.type) {
487 case _applicationMethodInitializeName: 505 case _applicationMethodInitializeName:
488 var params = _ApplicationInitializeParams.deserialize( 506 var params = _ApplicationInitializeParams.deserialize(
489 message.payload); 507 message.payload);
490 _impl.initialize(params.shell, params.args, params.url); 508 _impl.initialize(params.shell, params.args, params.url);
491 break; 509 break;
492 case _applicationMethodAcceptConnectionName: 510 case _applicationMethodAcceptConnectionName:
493 var params = _ApplicationAcceptConnectionParams.deserialize( 511 var params = _ApplicationAcceptConnectionParams.deserialize(
494 message.payload); 512 message.payload);
495 _impl.acceptConnection(params.requestorUrl, params.resolvedUrl, params.s ervices); 513 _impl.acceptConnection(params.requestorUrl, params.resolvedUrl, params.s ervices);
496 break; 514 break;
497 case _applicationMethodRequestQuitName: 515 case _applicationMethodRequestQuitName:
498 _impl.requestQuit(); 516 _impl.requestQuit();
499 break; 517 break;
500 default: 518 default:
501 throw new bindings.MojoCodecError("Unexpected message name"); 519 throw new bindings.MojoCodecError("Unexpected message name");
502 break; 520 break;
503 } 521 }
504 return null;
505 } 522 }
506 523
507 Application get impl => _impl; 524 Application get impl => _impl;
508 set impl(Application d) { 525 set impl(Application d) {
509 if (d == null) { 526 if (d == null) {
510 throw new core.MojoApiError("$this: Cannot set a null implementation"); 527 throw new core.MojoApiError("$this: Cannot set a null implementation");
511 } 528 }
512 if (isBound && (_impl == null)) { 529 if (isBound && (_impl == null)) {
513 beginHandlingEvents(); 530 beginHandlingEvents();
514 } 531 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 void acceptConnection(String requestorUrl, String resolvedUrl, service_provide r_mojom.ServiceProviderInterfaceRequest services) { 578 void acceptConnection(String requestorUrl, String resolvedUrl, service_provide r_mojom.ServiceProviderInterfaceRequest services) {
562 return impl.acceptConnection(requestorUrl, resolvedUrl, services); 579 return impl.acceptConnection(requestorUrl, resolvedUrl, services);
563 } 580 }
564 void requestQuit() { 581 void requestQuit() {
565 return impl.requestQuit(); 582 return impl.requestQuit();
566 } 583 }
567 } 584 }
568 585
569 586
570 587
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698