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

Side by Side Diff: mojo/dart/packages/mojo/lib/mojo/application.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 application_mojom; 5 library application_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 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom ; 13 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom ;
12 import 'package:mojo/mojo/shell.mojom.dart' as shell_mojom; 14 import 'package:mojo/mojo/shell.mojom.dart' as shell_mojom;
13 15
14 16
15 17
16 class _ApplicationInitializeParams extends bindings.Struct { 18 class _ApplicationInitializeParams extends bindings.Struct {
17 static const List<bindings.StructDataHeader> kVersions = const [ 19 static const List<bindings.StructDataHeader> kVersions = const [
18 const bindings.StructDataHeader(32, 0) 20 const bindings.StructDataHeader(32, 0)
19 ]; 21 ];
20 Object shell = null; 22 Object shell = null;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 "url: $url" ")"; 108 "url: $url" ")";
107 } 109 }
108 110
109 Map toJson() { 111 Map toJson() {
110 throw new bindings.MojoCodecError( 112 throw new bindings.MojoCodecError(
111 'Object containing handles cannot be encoded to JSON.'); 113 'Object containing handles cannot be encoded to JSON.');
112 } 114 }
113 } 115 }
114 116
115 117
118
119
116 class _ApplicationAcceptConnectionParams extends bindings.Struct { 120 class _ApplicationAcceptConnectionParams extends bindings.Struct {
117 static const List<bindings.StructDataHeader> kVersions = const [ 121 static const List<bindings.StructDataHeader> kVersions = const [
118 const bindings.StructDataHeader(40, 0) 122 const bindings.StructDataHeader(40, 0)
119 ]; 123 ];
120 String requestorUrl = null; 124 String requestorUrl = null;
121 Object services = null; 125 Object services = null;
122 Object exposedServices = null; 126 Object exposedServices = null;
123 String resolvedUrl = null; 127 String resolvedUrl = null;
124 128
125 _ApplicationAcceptConnectionParams() : super(kVersions.last.size); 129 _ApplicationAcceptConnectionParams() : super(kVersions.last.size);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 "resolvedUrl: $resolvedUrl" ")"; 200 "resolvedUrl: $resolvedUrl" ")";
197 } 201 }
198 202
199 Map toJson() { 203 Map toJson() {
200 throw new bindings.MojoCodecError( 204 throw new bindings.MojoCodecError(
201 'Object containing handles cannot be encoded to JSON.'); 205 'Object containing handles cannot be encoded to JSON.');
202 } 206 }
203 } 207 }
204 208
205 209
210
211
206 class _ApplicationRequestQuitParams extends bindings.Struct { 212 class _ApplicationRequestQuitParams extends bindings.Struct {
207 static const List<bindings.StructDataHeader> kVersions = const [ 213 static const List<bindings.StructDataHeader> kVersions = const [
208 const bindings.StructDataHeader(8, 0) 214 const bindings.StructDataHeader(8, 0)
209 ]; 215 ];
210 216
211 _ApplicationRequestQuitParams() : super(kVersions.last.size); 217 _ApplicationRequestQuitParams() : super(kVersions.last.size);
212 218
213 static _ApplicationRequestQuitParams deserialize(bindings.Message message) { 219 static _ApplicationRequestQuitParams deserialize(bindings.Message message) {
214 var decoder = new bindings.Decoder(message); 220 var decoder = new bindings.Decoder(message);
215 var result = decode(decoder); 221 var result = decode(decoder);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 String toString() { 259 String toString() {
254 return "_ApplicationRequestQuitParams("")"; 260 return "_ApplicationRequestQuitParams("")";
255 } 261 }
256 262
257 Map toJson() { 263 Map toJson() {
258 Map map = new Map(); 264 Map map = new Map();
259 return map; 265 return map;
260 } 266 }
261 } 267 }
262 268
269
270
271
263 const int _Application_initializeName = 0; 272 const int _Application_initializeName = 0;
264 const int _Application_acceptConnectionName = 1; 273 const int _Application_acceptConnectionName = 1;
265 const int _Application_requestQuitName = 2; 274 const int _Application_requestQuitName = 2;
266 275
276
277
278 class _ApplicationServiceDescription implements service_describer.ServiceDescrip tion {
279 dynamic getTopLevelInterface([Function responseFactory]) => null;
280
281 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
282
283 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
284 }
285
267 abstract class Application { 286 abstract class Application {
268 static const String serviceName = null; 287 static const String serviceName = null;
269 void initialize(Object shell, List<String> args, String url); 288 void initialize(Object shell, List<String> args, String url);
270 void acceptConnection(String requestorUrl, Object services, Object exposedServ ices, String resolvedUrl); 289 void acceptConnection(String requestorUrl, Object services, Object exposedServ ices, String resolvedUrl);
271 void requestQuit(); 290 void requestQuit();
272 } 291 }
273 292
274 293
275 class _ApplicationProxyImpl extends bindings.Proxy { 294 class _ApplicationProxyImpl extends bindings.Proxy {
276 _ApplicationProxyImpl.fromEndpoint( 295 _ApplicationProxyImpl.fromEndpoint(
277 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 296 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
278 297
279 _ApplicationProxyImpl.fromHandle(core.MojoHandle handle) : 298 _ApplicationProxyImpl.fromHandle(core.MojoHandle handle) :
280 super.fromHandle(handle); 299 super.fromHandle(handle);
281 300
282 _ApplicationProxyImpl.unbound() : super.unbound(); 301 _ApplicationProxyImpl.unbound() : super.unbound();
283 302
284 static _ApplicationProxyImpl newFromEndpoint( 303 static _ApplicationProxyImpl newFromEndpoint(
285 core.MojoMessagePipeEndpoint endpoint) { 304 core.MojoMessagePipeEndpoint endpoint) {
286 assert(endpoint.setDescription("For _ApplicationProxyImpl")); 305 assert(endpoint.setDescription("For _ApplicationProxyImpl"));
287 return new _ApplicationProxyImpl.fromEndpoint(endpoint); 306 return new _ApplicationProxyImpl.fromEndpoint(endpoint);
288 } 307 }
289 308
309 service_describer.ServiceDescription get serviceDescription =>
310 new _ApplicationServiceDescription();
311
290 void handleResponse(bindings.ServiceMessage message) { 312 void handleResponse(bindings.ServiceMessage message) {
291 switch (message.header.type) { 313 switch (message.header.type) {
292 default: 314 default:
293 proxyError("Unexpected message type: ${message.header.type}"); 315 proxyError("Unexpected message type: ${message.header.type}");
294 close(immediate: true); 316 close(immediate: true);
295 break; 317 break;
296 } 318 }
297 } 319 }
298 320
299 String toString() { 321 String toString() {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 assert(_impl == null); 477 assert(_impl == null);
456 _impl = d; 478 _impl = d;
457 } 479 }
458 480
459 String toString() { 481 String toString() {
460 var superString = super.toString(); 482 var superString = super.toString();
461 return "ApplicationStub($superString)"; 483 return "ApplicationStub($superString)";
462 } 484 }
463 485
464 int get version => 0; 486 int get version => 0;
487
488 service_describer.ServiceDescription get serviceDescription =>
489 new _ApplicationServiceDescription();
465 } 490 }
466 491
467 492
493
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/lib/bindings.dart ('k') | mojo/dart/packages/mojo/lib/mojo/application_connector.mojom.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698