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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/display.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 display_mojom; 5 library display_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/context_provider.mojom.dart' as context_provi der_mojom; 13 import 'package:mojo_services/mojo/context_provider.mojom.dart' as context_provi der_mojom;
12 import 'package:mojo_services/mojo/viewport_parameter_listener.mojom.dart' as vi ewport_parameter_listener_mojom; 14 import 'package:mojo_services/mojo/viewport_parameter_listener.mojom.dart' as vi ewport_parameter_listener_mojom;
13 import 'package:mojo_services/mojo/surfaces.mojom.dart' as surfaces_mojom; 15 import 'package:mojo_services/mojo/surfaces.mojom.dart' as surfaces_mojom;
14 16
15 17
16 18
17 class _DisplaySubmitFrameParams extends bindings.Struct { 19 class _DisplaySubmitFrameParams extends bindings.Struct {
18 static const List<bindings.StructDataHeader> kVersions = const [ 20 static const List<bindings.StructDataHeader> kVersions = const [
19 const bindings.StructDataHeader(16, 0) 21 const bindings.StructDataHeader(16, 0)
20 ]; 22 ];
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 77 }
76 78
77 Map toJson() { 79 Map toJson() {
78 Map map = new Map(); 80 Map map = new Map();
79 map["frame"] = frame; 81 map["frame"] = frame;
80 return map; 82 return map;
81 } 83 }
82 } 84 }
83 85
84 86
87
88
85 class DisplaySubmitFrameResponseParams extends bindings.Struct { 89 class DisplaySubmitFrameResponseParams extends bindings.Struct {
86 static const List<bindings.StructDataHeader> kVersions = const [ 90 static const List<bindings.StructDataHeader> kVersions = const [
87 const bindings.StructDataHeader(8, 0) 91 const bindings.StructDataHeader(8, 0)
88 ]; 92 ];
89 93
90 DisplaySubmitFrameResponseParams() : super(kVersions.last.size); 94 DisplaySubmitFrameResponseParams() : super(kVersions.last.size);
91 95
92 static DisplaySubmitFrameResponseParams deserialize(bindings.Message message) { 96 static DisplaySubmitFrameResponseParams deserialize(bindings.Message message) {
93 var decoder = new bindings.Decoder(message); 97 var decoder = new bindings.Decoder(message);
94 var result = decode(decoder); 98 var result = decode(decoder);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return "DisplaySubmitFrameResponseParams("")"; 137 return "DisplaySubmitFrameResponseParams("")";
134 } 138 }
135 139
136 Map toJson() { 140 Map toJson() {
137 Map map = new Map(); 141 Map map = new Map();
138 return map; 142 return map;
139 } 143 }
140 } 144 }
141 145
142 146
147
148
143 class _DisplayFactoryCreateParams extends bindings.Struct { 149 class _DisplayFactoryCreateParams extends bindings.Struct {
144 static const List<bindings.StructDataHeader> kVersions = const [ 150 static const List<bindings.StructDataHeader> kVersions = const [
145 const bindings.StructDataHeader(32, 0) 151 const bindings.StructDataHeader(32, 0)
146 ]; 152 ];
147 Object contextProvider = null; 153 Object contextProvider = null;
148 Object returner = null; 154 Object returner = null;
149 Object displayRequest = null; 155 Object displayRequest = null;
150 156
151 _DisplayFactoryCreateParams() : super(kVersions.last.size); 157 _DisplayFactoryCreateParams() : super(kVersions.last.size);
152 158
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 "returner: $returner" ", " 220 "returner: $returner" ", "
215 "displayRequest: $displayRequest" ")"; 221 "displayRequest: $displayRequest" ")";
216 } 222 }
217 223
218 Map toJson() { 224 Map toJson() {
219 throw new bindings.MojoCodecError( 225 throw new bindings.MojoCodecError(
220 'Object containing handles cannot be encoded to JSON.'); 226 'Object containing handles cannot be encoded to JSON.');
221 } 227 }
222 } 228 }
223 229
230
231
232
224 const int _Display_submitFrameName = 0; 233 const int _Display_submitFrameName = 0;
225 234
235
236
237 class _DisplayServiceDescription implements service_describer.ServiceDescription {
238 dynamic getTopLevelInterface([Function responseFactory]) => null;
239
240 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
241
242 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
243 }
244
226 abstract class Display { 245 abstract class Display {
227 static const String serviceName = null; 246 static const String serviceName = null;
228 dynamic submitFrame(surfaces_mojom.Frame frame,[Function responseFactory = nul l]); 247 dynamic submitFrame(surfaces_mojom.Frame frame,[Function responseFactory = nul l]);
229 } 248 }
230 249
231 250
232 class _DisplayProxyImpl extends bindings.Proxy { 251 class _DisplayProxyImpl extends bindings.Proxy {
233 _DisplayProxyImpl.fromEndpoint( 252 _DisplayProxyImpl.fromEndpoint(
234 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 253 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
235 254
236 _DisplayProxyImpl.fromHandle(core.MojoHandle handle) : 255 _DisplayProxyImpl.fromHandle(core.MojoHandle handle) :
237 super.fromHandle(handle); 256 super.fromHandle(handle);
238 257
239 _DisplayProxyImpl.unbound() : super.unbound(); 258 _DisplayProxyImpl.unbound() : super.unbound();
240 259
241 static _DisplayProxyImpl newFromEndpoint( 260 static _DisplayProxyImpl newFromEndpoint(
242 core.MojoMessagePipeEndpoint endpoint) { 261 core.MojoMessagePipeEndpoint endpoint) {
243 assert(endpoint.setDescription("For _DisplayProxyImpl")); 262 assert(endpoint.setDescription("For _DisplayProxyImpl"));
244 return new _DisplayProxyImpl.fromEndpoint(endpoint); 263 return new _DisplayProxyImpl.fromEndpoint(endpoint);
245 } 264 }
246 265
266 service_describer.ServiceDescription get serviceDescription =>
267 new _DisplayServiceDescription();
268
247 void handleResponse(bindings.ServiceMessage message) { 269 void handleResponse(bindings.ServiceMessage message) {
248 switch (message.header.type) { 270 switch (message.header.type) {
249 case _Display_submitFrameName: 271 case _Display_submitFrameName:
250 var r = DisplaySubmitFrameResponseParams.deserialize( 272 var r = DisplaySubmitFrameResponseParams.deserialize(
251 message.payload); 273 message.payload);
252 if (!message.header.hasRequestId) { 274 if (!message.header.hasRequestId) {
253 proxyError("Expected a message with a valid request Id."); 275 proxyError("Expected a message with a valid request Id.");
254 return; 276 return;
255 } 277 }
256 Completer c = completerMap[message.header.requestId]; 278 Completer c = completerMap[message.header.requestId];
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 assert(_impl == null); 443 assert(_impl == null);
422 _impl = d; 444 _impl = d;
423 } 445 }
424 446
425 String toString() { 447 String toString() {
426 var superString = super.toString(); 448 var superString = super.toString();
427 return "DisplayStub($superString)"; 449 return "DisplayStub($superString)";
428 } 450 }
429 451
430 int get version => 0; 452 int get version => 0;
453
454 service_describer.ServiceDescription get serviceDescription =>
455 new _DisplayServiceDescription();
431 } 456 }
432 457
433 const int _DisplayFactory_createName = 0; 458 const int _DisplayFactory_createName = 0;
434 459
460
461
462 class _DisplayFactoryServiceDescription implements service_describer.ServiceDesc ription {
463 dynamic getTopLevelInterface([Function responseFactory]) => null;
464
465 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
466
467 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
468 }
469
435 abstract class DisplayFactory { 470 abstract class DisplayFactory {
436 static const String serviceName = "mojo::DisplayFactory"; 471 static const String serviceName = "mojo::DisplayFactory";
437 void create(Object contextProvider, Object returner, Object displayRequest); 472 void create(Object contextProvider, Object returner, Object displayRequest);
438 } 473 }
439 474
440 475
441 class _DisplayFactoryProxyImpl extends bindings.Proxy { 476 class _DisplayFactoryProxyImpl extends bindings.Proxy {
442 _DisplayFactoryProxyImpl.fromEndpoint( 477 _DisplayFactoryProxyImpl.fromEndpoint(
443 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 478 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
444 479
445 _DisplayFactoryProxyImpl.fromHandle(core.MojoHandle handle) : 480 _DisplayFactoryProxyImpl.fromHandle(core.MojoHandle handle) :
446 super.fromHandle(handle); 481 super.fromHandle(handle);
447 482
448 _DisplayFactoryProxyImpl.unbound() : super.unbound(); 483 _DisplayFactoryProxyImpl.unbound() : super.unbound();
449 484
450 static _DisplayFactoryProxyImpl newFromEndpoint( 485 static _DisplayFactoryProxyImpl newFromEndpoint(
451 core.MojoMessagePipeEndpoint endpoint) { 486 core.MojoMessagePipeEndpoint endpoint) {
452 assert(endpoint.setDescription("For _DisplayFactoryProxyImpl")); 487 assert(endpoint.setDescription("For _DisplayFactoryProxyImpl"));
453 return new _DisplayFactoryProxyImpl.fromEndpoint(endpoint); 488 return new _DisplayFactoryProxyImpl.fromEndpoint(endpoint);
454 } 489 }
455 490
491 service_describer.ServiceDescription get serviceDescription =>
492 new _DisplayFactoryServiceDescription();
493
456 void handleResponse(bindings.ServiceMessage message) { 494 void handleResponse(bindings.ServiceMessage message) {
457 switch (message.header.type) { 495 switch (message.header.type) {
458 default: 496 default:
459 proxyError("Unexpected message type: ${message.header.type}"); 497 proxyError("Unexpected message type: ${message.header.type}");
460 close(immediate: true); 498 close(immediate: true);
461 break; 499 break;
462 } 500 }
463 } 501 }
464 502
465 String toString() { 503 String toString() {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 assert(_impl == null); 629 assert(_impl == null);
592 _impl = d; 630 _impl = d;
593 } 631 }
594 632
595 String toString() { 633 String toString() {
596 var superString = super.toString(); 634 var superString = super.toString();
597 return "DisplayFactoryStub($superString)"; 635 return "DisplayFactoryStub($superString)";
598 } 636 }
599 637
600 int get version => 0; 638 int get version => 0;
639
640 service_describer.ServiceDescription get serviceDescription =>
641 new _DisplayFactoryServiceDescription();
601 } 642 }
602 643
603 644
645
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698