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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/resources.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 resources_mojom; 5 library resources_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_services/mojo/geometry.mojom.dart' as geometry_mojom; 13 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom;
12 import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as sc ene_token_mojom; 14 import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as sc ene_token_mojom;
13 15
14 16
15 17
16 class SceneResource extends bindings.Struct { 18 class SceneResource extends bindings.Struct {
17 static const List<bindings.StructDataHeader> kVersions = const [ 19 static const List<bindings.StructDataHeader> kVersions = const [
18 const bindings.StructDataHeader(16, 0) 20 const bindings.StructDataHeader(16, 0)
19 ]; 21 ];
20 scene_token_mojom.SceneToken sceneToken = null; 22 scene_token_mojom.SceneToken sceneToken = null;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 76 }
75 77
76 Map toJson() { 78 Map toJson() {
77 Map map = new Map(); 79 Map map = new Map();
78 map["sceneToken"] = sceneToken; 80 map["sceneToken"] = sceneToken;
79 return map; 81 return map;
80 } 82 }
81 } 83 }
82 84
83 85
86
87
84 class MailboxTextureResource extends bindings.Struct { 88 class MailboxTextureResource extends bindings.Struct {
85 static const List<bindings.StructDataHeader> kVersions = const [ 89 static const List<bindings.StructDataHeader> kVersions = const [
86 const bindings.StructDataHeader(40, 0) 90 const bindings.StructDataHeader(40, 0)
87 ]; 91 ];
88 List<int> mailboxName = null; 92 List<int> mailboxName = null;
89 int syncPoint = 0; 93 int syncPoint = 0;
90 geometry_mojom.Size size = null; 94 geometry_mojom.Size size = null;
91 Object callback = null; 95 Object callback = null;
92 96
93 MailboxTextureResource() : super(kVersions.last.size); 97 MailboxTextureResource() : super(kVersions.last.size);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 "callback: $callback" ")"; 169 "callback: $callback" ")";
166 } 170 }
167 171
168 Map toJson() { 172 Map toJson() {
169 throw new bindings.MojoCodecError( 173 throw new bindings.MojoCodecError(
170 'Object containing handles cannot be encoded to JSON.'); 174 'Object containing handles cannot be encoded to JSON.');
171 } 175 }
172 } 176 }
173 177
174 178
179
180
175 class _MailboxTextureCallbackOnMailboxTextureReleasedParams extends bindings.Str uct { 181 class _MailboxTextureCallbackOnMailboxTextureReleasedParams extends bindings.Str uct {
176 static const List<bindings.StructDataHeader> kVersions = const [ 182 static const List<bindings.StructDataHeader> kVersions = const [
177 const bindings.StructDataHeader(8, 0) 183 const bindings.StructDataHeader(8, 0)
178 ]; 184 ];
179 185
180 _MailboxTextureCallbackOnMailboxTextureReleasedParams() : super(kVersions.last .size); 186 _MailboxTextureCallbackOnMailboxTextureReleasedParams() : super(kVersions.last .size);
181 187
182 static _MailboxTextureCallbackOnMailboxTextureReleasedParams deserialize(bindi ngs.Message message) { 188 static _MailboxTextureCallbackOnMailboxTextureReleasedParams deserialize(bindi ngs.Message message) {
183 var decoder = new bindings.Decoder(message); 189 var decoder = new bindings.Decoder(message);
184 var result = decode(decoder); 190 var result = decode(decoder);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 230 }
225 231
226 Map toJson() { 232 Map toJson() {
227 Map map = new Map(); 233 Map map = new Map();
228 return map; 234 return map;
229 } 235 }
230 } 236 }
231 237
232 238
233 239
240
241
234 enum ResourceTag { 242 enum ResourceTag {
235 scene, 243 scene,
236 mailboxTexture, 244 mailboxTexture,
237 unknown 245 unknown
238 } 246 }
239 247
240 class Resource extends bindings.Union { 248 class Resource extends bindings.Union {
241 static final _tag_to_int = const { 249 static final _tag_to_int = const {
242 ResourceTag.scene: 0, 250 ResourceTag.scene: 0,
243 ResourceTag.mailboxTexture: 1, 251 ResourceTag.mailboxTexture: 1,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 case ResourceTag.mailboxTexture: 337 case ResourceTag.mailboxTexture:
330 result += "mailboxTexture"; 338 result += "mailboxTexture";
331 break; 339 break;
332 default: 340 default:
333 result += "unknown"; 341 result += "unknown";
334 } 342 }
335 result += ": $_data)"; 343 result += ": $_data)";
336 return result; 344 return result;
337 } 345 }
338 } 346 }
347
348
349
339 const int _MailboxTextureCallback_onMailboxTextureReleasedName = 0; 350 const int _MailboxTextureCallback_onMailboxTextureReleasedName = 0;
340 351
352
353
354 class _MailboxTextureCallbackServiceDescription implements service_describer.Ser viceDescription {
355 dynamic getTopLevelInterface([Function responseFactory]) => null;
356
357 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
358
359 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
360 }
361
341 abstract class MailboxTextureCallback { 362 abstract class MailboxTextureCallback {
342 static const String serviceName = null; 363 static const String serviceName = null;
343 void onMailboxTextureReleased(); 364 void onMailboxTextureReleased();
344 } 365 }
345 366
346 367
347 class _MailboxTextureCallbackProxyImpl extends bindings.Proxy { 368 class _MailboxTextureCallbackProxyImpl extends bindings.Proxy {
348 _MailboxTextureCallbackProxyImpl.fromEndpoint( 369 _MailboxTextureCallbackProxyImpl.fromEndpoint(
349 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 370 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
350 371
351 _MailboxTextureCallbackProxyImpl.fromHandle(core.MojoHandle handle) : 372 _MailboxTextureCallbackProxyImpl.fromHandle(core.MojoHandle handle) :
352 super.fromHandle(handle); 373 super.fromHandle(handle);
353 374
354 _MailboxTextureCallbackProxyImpl.unbound() : super.unbound(); 375 _MailboxTextureCallbackProxyImpl.unbound() : super.unbound();
355 376
356 static _MailboxTextureCallbackProxyImpl newFromEndpoint( 377 static _MailboxTextureCallbackProxyImpl newFromEndpoint(
357 core.MojoMessagePipeEndpoint endpoint) { 378 core.MojoMessagePipeEndpoint endpoint) {
358 assert(endpoint.setDescription("For _MailboxTextureCallbackProxyImpl")); 379 assert(endpoint.setDescription("For _MailboxTextureCallbackProxyImpl"));
359 return new _MailboxTextureCallbackProxyImpl.fromEndpoint(endpoint); 380 return new _MailboxTextureCallbackProxyImpl.fromEndpoint(endpoint);
360 } 381 }
361 382
383 service_describer.ServiceDescription get serviceDescription =>
384 new _MailboxTextureCallbackServiceDescription();
385
362 void handleResponse(bindings.ServiceMessage message) { 386 void handleResponse(bindings.ServiceMessage message) {
363 switch (message.header.type) { 387 switch (message.header.type) {
364 default: 388 default:
365 proxyError("Unexpected message type: ${message.header.type}"); 389 proxyError("Unexpected message type: ${message.header.type}");
366 close(immediate: true); 390 close(immediate: true);
367 break; 391 break;
368 } 392 }
369 } 393 }
370 394
371 String toString() { 395 String toString() {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 assert(_impl == null); 518 assert(_impl == null);
495 _impl = d; 519 _impl = d;
496 } 520 }
497 521
498 String toString() { 522 String toString() {
499 var superString = super.toString(); 523 var superString = super.toString();
500 return "MailboxTextureCallbackStub($superString)"; 524 return "MailboxTextureCallbackStub($superString)";
501 } 525 }
502 526
503 int get version => 0; 527 int get version => 0;
528
529 service_describer.ServiceDescription get serviceDescription =>
530 new _MailboxTextureCallbackServiceDescription();
504 } 531 }
505 532
506 533
534
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698